libqalculate-0.9.7/0000777000175100017510000000000011320655052011177 500000000000000libqalculate-0.9.7/autogen.sh0000755000175100017510000001005011305546371013116 00000000000000#!/bin/sh # Run this to generate all the initial makefiles, etc. srcdir=`dirname $0` test -z "$srcdir" && srcdir=. DIE=0 if [ -n "$GNOME2_DIR" ]; then ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS" LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH" PATH="$GNOME2_DIR/bin:$PATH" export PATH export LD_LIBRARY_PATH fi (test -f $srcdir/configure.in) || { echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" echo " top-level package directory" exit 1 } (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`autoconf' installed." echo "Download the appropriate package for your distribution," echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" DIE=1 } (grep "^AC_PROG_INTLTOOL" $srcdir/configure.in >/dev/null) && { (intltoolize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`intltool' installed." echo "You can get it from:" echo " ftp://ftp.gnome.org/pub/GNOME/stable/sources/intltool/" DIE=1 } } (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && { (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`libtool' installed." echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" DIE=1 } } grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.in >/dev/null && { grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \ (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`glib' installed." echo "You can get it from: ftp://ftp.gtk.org/pub/gtk" DIE=1 } } (automake --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`automake' installed." echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" DIE=1 NO_AUTOMAKE=yes } # if no automake, don't bother testing for aclocal test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: Missing \`aclocal'. The version of \`automake'" echo "installed doesn't appear recent enough." echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" DIE=1 } if test "$DIE" -eq 1; then exit 1 fi if test -z "$*"; then echo "**Warning**: I am going to run \`configure' with no arguments." echo "If you wish to pass any to it, please specify them on the" echo \`$0\'" command line." echo fi case $CC in xlc ) am_opt=--include-deps;; esac for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.in -print` do dr=`dirname $coin` if test -f $dr/NO-AUTO-GEN; then echo skipping $dr -- flagged as no auto-gen else echo processing $dr ( cd $dr aclocalinclude="$ACLOCAL_FLAGS" if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then echo "Creating $dr/aclocal.m4 ..." test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 echo "Running glib-gettextize... Ignore non-fatal messages." echo "no" | glib-gettextize --force --copy echo "Making $dr/aclocal.m4 writable ..." test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 fi if grep "^AC_PROG_INTLTOOL" configure.in >/dev/null; then echo "Running intltoolize..." intltoolize --copy --force --automake fi if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then if test -z "$NO_LIBTOOLIZE" ; then echo "Running libtoolize..." libtoolize --force --copy fi fi echo "Running aclocal $aclocalinclude ..." aclocal $aclocalinclude if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then echo "Running autoheader..." autoheader fi echo "Running automake --gnu $am_opt ..." automake --add-missing --gnu $am_opt echo "Running autoconf ..." autoconf ) fi done conf_flags="--enable-maintainer-mode" if test x$NOCONFIGURE = x; then echo Running $srcdir/configure $conf_flags "$@" ... $srcdir/configure $conf_flags "$@" \ && echo Now type \`make\' to compile. || exit 1 else echo Skipping configure process. fi cd $srcdir/docs/reference echo "Generating API docs" doxygen Doxyfile cd $srcdir libqalculate-0.9.7/po-defs/0000777000175100017510000000000011320655052012534 500000000000000libqalculate-0.9.7/po-defs/Makefile.am0000644000175100017510000000011211305546373014506 00000000000000# # po-defs/Makefile.am for qalculate # EXTRA_DIST = \ POTFILES.in *.po libqalculate-0.9.7/po-defs/nl.po0000644000175100017510000052074211305546373013443 00000000000000# translation of libqalculate-defs.po to # This file is distributed under the same license as the PACKAGE package. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. # # Rinse de Vries , 2006. # Jaap Woldringh , 2006, 2007. # R.F. Pels , 2006. msgid "" msgstr "" "Project-Id-Version: libqalculate-defs\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-06-10 19:49+0200\n" "PO-Revision-Date: 2007-05-18 15:47+0200\n" "Last-Translator: Jaap Woldringh \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../data/currencies.xml.in.h:1 msgid "Australian Dollars" msgstr "Australische dollar" #: ../data/currencies.xml.in.h:2 msgid "Austrian Schilling" msgstr "Oostenrijkse schilling" #: ../data/currencies.xml.in.h:3 msgid "Belgian Franc" msgstr "Belgische frank" #: ../data/currencies.xml.in.h:4 msgid "British Pounds" msgstr "Britse Pond" #: ../data/currencies.xml.in.h:5 msgid "Bulgarian Lev" msgstr "Bulgaarse Lev" #: ../data/currencies.xml.in.h:6 msgid "Canadian Dollars" msgstr "Canadese dollar" #: ../data/currencies.xml.in.h:7 msgid "Cent (USD)" msgstr "Cent (USD)" #: ../data/currencies.xml.in.h:8 msgid "Croatian Kuna" msgstr "Kroatische kuna" #: ../data/currencies.xml.in.h:9 msgid "Currency" msgstr "Valuta" #: ../data/currencies.xml.in.h:10 msgid "Cypriot Pound" msgstr "Cypriotische pond" #: ../data/currencies.xml.in.h:11 msgid "Czech Koruna" msgstr "Tsjechische kroon" #: ../data/currencies.xml.in.h:12 msgid "Danish Kroner" msgstr "Deense kroon" #: ../data/currencies.xml.in.h:13 msgid "Deutche Mark" msgstr "Duitse mark" #: ../data/currencies.xml.in.h:14 msgid "Dutch Guilder" msgstr "Nederlandse gulden" #: ../data/currencies.xml.in.h:15 msgid "Estonian Kroon" msgstr "Estlandse kroon" #: ../data/currencies.xml.in.h:16 msgid "Euro Cent" msgstr "Eurocent" #: ../data/currencies.xml.in.h:17 msgid "European Euros" msgstr "Europese euro" #: ../data/currencies.xml.in.h:18 msgid "Finnish Markka" msgstr "Finse mark" #: ../data/currencies.xml.in.h:19 msgid "French Franc" msgstr "Franse franc" #: ../data/currencies.xml.in.h:20 msgid "Greek Drachma" msgstr "Griekse drachme" #: ../data/currencies.xml.in.h:21 msgid "Hong Kong Dollars" msgstr "Hongkong dollar" #: ../data/currencies.xml.in.h:22 msgid "Hungarian Forint" msgstr "Hongaarse forint" #: ../data/currencies.xml.in.h:23 msgid "Icelandic Krona" msgstr "IJslandse kroon" #: ../data/currencies.xml.in.h:24 msgid "Indonesian Rupiah" msgstr "Indonesische roepiah" #: ../data/currencies.xml.in.h:25 msgid "Irish Pound" msgstr "Ierse pond" #: ../data/currencies.xml.in.h:26 msgid "Italian Lira" msgstr "Italiaanse lire" #: ../data/currencies.xml.in.h:27 msgid "Japanese Yen" msgstr "Japanse yen" #: ../data/currencies.xml.in.h:28 msgid "Latvian Lat" msgstr "Letlandse lat" #: ../data/currencies.xml.in.h:29 msgid "Lithuanian Lit" msgstr "Litouwse lit" #: ../data/currencies.xml.in.h:30 msgid "Luxembourg Franc" msgstr "Luxemburgse frank" #: ../data/currencies.xml.in.h:31 msgid "Malaysian Ringgit" msgstr "Maleisische ringgit" #: ../data/currencies.xml.in.h:32 msgid "Maltese Lira" msgstr "Maltese Lira" #: ../data/currencies.xml.in.h:33 msgid "New Zealand Dollars" msgstr "Nieuwzeelandse dollar" #: ../data/currencies.xml.in.h:34 msgid "Norwegian Kroner" msgstr "Noorse kroon" #: ../data/currencies.xml.in.h:35 msgid "Phillipine Peso" msgstr "Filippijnse peso" #: ../data/currencies.xml.in.h:36 msgid "Polish Zloty" msgstr "Poolse zloty" #: ../data/currencies.xml.in.h:37 msgid "Portuguese Escudo" msgstr "Portugese escudo" #: ../data/currencies.xml.in.h:38 msgid "Romanian New Leu" msgstr "Nieuwe Roemeense leu" #: ../data/currencies.xml.in.h:39 msgid "Russian Ruble" msgstr "Russische roebel" #: ../data/currencies.xml.in.h:40 msgid "Singapore Dollars" msgstr "Singapore dollar" #: ../data/currencies.xml.in.h:41 msgid "Slovakian Koruna" msgstr "Slowaakse kroon" #: ../data/currencies.xml.in.h:42 msgid "Slovenian Tolar" msgstr "Sloveense tolar" #: ../data/currencies.xml.in.h:43 msgid "South African Rand" msgstr "Zuid-Afrikaanse rand" #: ../data/currencies.xml.in.h:44 msgid "South Korean Won" msgstr "Zuid-Koreaanse won" #: ../data/currencies.xml.in.h:45 msgid "Spanish Peseta" msgstr "Spaanse peseta" #: ../data/currencies.xml.in.h:46 msgid "Swedish Krona" msgstr "Zweedse kroon" #: ../data/currencies.xml.in.h:47 msgid "Swiss Francs" msgstr "Zwitserse franc" #: ../data/currencies.xml.in.h:48 msgid "Thai Bat" msgstr "Thailandse bat" #: ../data/currencies.xml.in.h:49 msgid "Turkish New Lira" msgstr "Nieuwe Turkse lire" #: ../data/currencies.xml.in.h:50 msgid "U.S. Dollars" msgstr "U.S. dollar" #: ../data/currencies.xml.in.h:51 msgid "Yuan Renmimbi (PR China)" msgstr "Yuan Renmimbi (PR China)" #: ../data/currencies.xml.in.h:52 msgid "a:$,ar:USD,dollar,p:dollars" msgstr "" #: ../data/currencies.xml.in.h:53 msgid "ar:ATS,schilling" msgstr "" #: ../data/currencies.xml.in.h:54 msgid "ar:AUD" msgstr "" #: ../data/currencies.xml.in.h:55 msgid "ar:BEF" msgstr "" #: ../data/currencies.xml.in.h:56 msgid "ar:CAD" msgstr "" #: ../data/currencies.xml.in.h:57 msgid "ar:CHF" msgstr "" #: ../data/currencies.xml.in.h:58 msgid "ar:CNY" msgstr "" #: ../data/currencies.xml.in.h:59 msgid "ar:CYP" msgstr "" #: ../data/currencies.xml.in.h:60 msgid "ar:CZK" msgstr "" #: ../data/currencies.xml.in.h:61 msgid "ar:DEM,mark" msgstr "" #: ../data/currencies.xml.in.h:62 msgid "ar:DKK" msgstr "" #: ../data/currencies.xml.in.h:63 msgid "ar:EEK" msgstr "" #: ../data/currencies.xml.in.h:64 msgid "ar:ESP,peseta,p:pesetas" msgstr "" #: ../data/currencies.xml.in.h:65 msgid "ar:EUR,au:€,euro,p:euros" msgstr "" #: ../data/currencies.xml.in.h:66 msgid "ar:FIM,markka" msgstr "" #: ../data/currencies.xml.in.h:67 msgid "ar:FRF,franc" msgstr "" #: ../data/currencies.xml.in.h:68 msgid "ar:GBP,au:£" msgstr "" #: ../data/currencies.xml.in.h:69 msgid "ar:GRD" msgstr "" #: ../data/currencies.xml.in.h:70 msgid "ar:HKD" msgstr "" #: ../data/currencies.xml.in.h:71 msgid "ar:HRK" msgstr "" #: ../data/currencies.xml.in.h:72 msgid "ar:IDR" msgstr "" #: ../data/currencies.xml.in.h:73 msgid "ar:IEP" msgstr "" #: ../data/currencies.xml.in.h:74 msgid "ar:ISK" msgstr "" #: ../data/currencies.xml.in.h:75 msgid "ar:ITL,lira" msgstr "ITL,lire" #: ../data/currencies.xml.in.h:76 msgid "ar:JPY,au:¥,yen" msgstr "" #: ../data/currencies.xml.in.h:77 msgid "ar:KRW" msgstr "" #: ../data/currencies.xml.in.h:78 msgid "ar:LUF" msgstr "" #: ../data/currencies.xml.in.h:79 msgid "ar:MTL" msgstr "" #: ../data/currencies.xml.in.h:80 msgid "ar:MYR" msgstr "" #: ../data/currencies.xml.in.h:81 msgid "ar:NLG,guilder" msgstr "NLG,gulden" #: ../data/currencies.xml.in.h:82 msgid "ar:NOK" msgstr "" #: ../data/currencies.xml.in.h:83 msgid "ar:NZD" msgstr "" #: ../data/currencies.xml.in.h:84 msgid "ar:PHP" msgstr "" #: ../data/currencies.xml.in.h:85 msgid "ar:PTE,escudo" msgstr "" #: ../data/currencies.xml.in.h:86 msgid "ar:RUB,ruble" msgstr "RUB,roebel" #: ../data/currencies.xml.in.h:87 msgid "ar:SEK" msgstr "" #: ../data/currencies.xml.in.h:88 msgid "ar:SGD" msgstr "" #: ../data/currencies.xml.in.h:89 msgid "ar:SKK" msgstr "" #: ../data/currencies.xml.in.h:90 msgid "ar:THB" msgstr "" #: ../data/currencies.xml.in.h:91 msgid "ar:TRY" msgstr "" #: ../data/currencies.xml.in.h:92 msgid "ar:ZAR" msgstr "" #: ../data/currencies.xml.in.h:93 msgid "au:¢,r:cent,p:cents" msgstr "¢,cent,centen" #: ../data/currencies.xml.in.h:94 msgid "forint,ar:HUF" msgstr "" #: ../data/currencies.xml.in.h:95 msgid "lat,ar:LVL" msgstr "" #: ../data/currencies.xml.in.h:96 msgid "leu,ar:RON" msgstr "" #: ../data/currencies.xml.in.h:97 msgid "lev,ar:BGN" msgstr "" #: ../data/currencies.xml.in.h:98 msgid "lit,ar:LTL" msgstr "" #: ../data/currencies.xml.in.h:99 msgid "r:eurocent,p:eurocents" msgstr "eurocent,eurocenten" #: ../data/currencies.xml.in.h:100 msgid "tolar,ar:SIT" msgstr "" #: ../data/currencies.xml.in.h:101 msgid "zloty,ar:PLN" msgstr "" #. Object argument for chemical elements data set #: ../data/datasets.xml.in.h:2 msgid "!datasets!Element" msgstr "" #. Data set for chemical elements #: ../data/datasets.xml.in.h:4 msgid "!datasets!Elements" msgstr "Elementen" #. Planet mass #: ../data/datasets.xml.in.h:6 msgid "!datasets!Mass" msgstr "Massa" #. Chemical elements number #: ../data/datasets.xml.in.h:8 msgid "!datasets!Number" msgstr "Getal" #. Surface area of planet #: ../data/datasets.xml.in.h:10 msgid "!datasets!r:area" msgstr "oppervlak" #. Chemical elements number #: ../data/datasets.xml.in.h:12 msgid "!datasets!r:number" msgstr "getal" #. Orbital period for planet #: ../data/datasets.xml.in.h:14 msgid "!datasets!r:year" msgstr "jaar" #: ../data/datasets.xml.in.h:15 msgid "" "A number representing an element group: 1 Alkali Metal 2 Alkaline-" "Earth Metal 3 Lanthanide 4 Actinide 5 Transition Metal 6 " "Metal 7 Metalloid 8 Non-Metal 9 Halogen 10 Noble Gas 11 " "Transactinide" msgstr "" "Een getal vertegenwoordigt een groep van elementen: 1 Alkalisch " "metaal 2 Alkalischaardmetaal 3 Lanthanide 4 Actinide 5 " "Overgangsmetaal 6 Metaal 7 Metalloïde 8 Niet-metaal 9 " "Halogeen 10 Edelgas 11 Transactinide" #: ../data/datasets.xml.in.h:16 msgid "Average Orbital Speed" msgstr "Gemiddelde baansnelheid" #: ../data/datasets.xml.in.h:17 msgid "Boiling Point" msgstr "Kookpunt" #: ../data/datasets.xml.in.h:18 msgid "Classification" msgstr "Klassificatie" #: ../data/datasets.xml.in.h:19 msgid "Covalent Radius" msgstr "Covalente straal" #: ../data/datasets.xml.in.h:20 msgid "Data Sets" msgstr "Gegevensverzamelingen" #: ../data/datasets.xml.in.h:21 ../data/units.xml.in.h:77 msgid "Density" msgstr "Dichtheid" #: ../data/datasets.xml.in.h:22 msgid "Density at 295K" msgstr "Dichtheid bij 295K" #: ../data/datasets.xml.in.h:23 msgid "Eccentricity" msgstr "Excentriciteit" #: ../data/datasets.xml.in.h:24 msgid "Equatorial Gravity" msgstr "Equatoriale zwaartekracht" #: ../data/datasets.xml.in.h:25 msgid "Inclination" msgstr "Inclinatie" #: ../data/datasets.xml.in.h:26 msgid "Ionization Potential" msgstr "Ionisatiepotentiaal" #: ../data/datasets.xml.in.h:27 msgid "Mean Density" msgstr "Gemiddelde dichtheid" #: ../data/datasets.xml.in.h:28 msgid "Mean Surface Temperature" msgstr "Gemiddelde oppervlaktetemperatuur" #: ../data/datasets.xml.in.h:29 msgid "Melting Point" msgstr "Smeltpunt" #: ../data/datasets.xml.in.h:30 ../data/functions.xml.in.h:321 msgid "Name" msgstr "Naam" #: ../data/datasets.xml.in.h:31 msgid "Number of Satellites" msgstr "Aantal satellieten" #: ../data/datasets.xml.in.h:32 msgid "Orbital Period (Year)" msgstr "Omloopperiode (Jaar)" #: ../data/datasets.xml.in.h:33 msgid "Planet" msgstr "Planeet" #: ../data/datasets.xml.in.h:34 msgid "Planets" msgstr "Planeten" #: ../data/datasets.xml.in.h:35 msgid "Surface Area" msgstr "Oppervlak (3D)" #: ../data/datasets.xml.in.h:36 msgid "Symbol" msgstr "Symbool" #: ../data/datasets.xml.in.h:37 ../data/functions.xml.in.h:604 msgid "Weight" msgstr "Gewicht" #: ../data/datasets.xml.in.h:38 msgid "X Position" msgstr "X Positie" #: ../data/datasets.xml.in.h:39 msgid "Y Position" msgstr "Y Positie" #: ../data/datasets.xml.in.h:40 msgid "r:atom" msgstr "atoom" #: ../data/datasets.xml.in.h:41 msgid "r:boiling" msgstr "kokend" #: ../data/datasets.xml.in.h:42 msgid "r:class" msgstr "klasse" #: ../data/datasets.xml.in.h:43 msgid "r:covalent" msgstr "covalent" #: ../data/datasets.xml.in.h:44 msgid "r:density" msgstr "dichtheid" #: ../data/datasets.xml.in.h:45 msgid "r:eccentricity" msgstr "excentriciteit" #: ../data/datasets.xml.in.h:46 msgid "r:gravity" msgstr "zwaartekracht" #: ../data/datasets.xml.in.h:47 msgid "r:inclination" msgstr "inclinatie" #: ../data/datasets.xml.in.h:48 msgid "r:ionization" msgstr "ionisatie" #: ../data/datasets.xml.in.h:49 msgid "r:mass" msgstr "massa" #: ../data/datasets.xml.in.h:50 msgid "r:melting" msgstr "smeltend" #: ../data/datasets.xml.in.h:51 msgid "r:name" msgstr "naam" #: ../data/datasets.xml.in.h:52 msgid "r:planet" msgstr "planeet" #: ../data/datasets.xml.in.h:53 msgid "r:satellites" msgstr "satellieten" #: ../data/datasets.xml.in.h:54 msgid "r:speed" msgstr "snelheid" #: ../data/datasets.xml.in.h:55 msgid "r:symbol" msgstr "symbool" #: ../data/datasets.xml.in.h:56 msgid "r:temperature" msgstr "temperatuur" #: ../data/datasets.xml.in.h:57 msgid "r:weight,mass" msgstr "gewicht,massa" #: ../data/datasets.xml.in.h:58 msgid "r:x_pos" msgstr "" #: ../data/datasets.xml.in.h:59 msgid "r:y_pos" msgstr "" #. Chemical element #: ../data/elements.xml.in.h:2 msgid "!elements!Mercury" msgstr "Kwik" #: ../data/elements.xml.in.h:3 msgid "Actinium" msgstr "Actinium" #: ../data/elements.xml.in.h:4 msgid "Aluminum" msgstr "Aluminium" #: ../data/elements.xml.in.h:5 msgid "Americium" msgstr "Americium" #: ../data/elements.xml.in.h:6 msgid "Antimony" msgstr "Antimoon" #: ../data/elements.xml.in.h:7 msgid "Argon" msgstr "Argon" #: ../data/elements.xml.in.h:8 msgid "Arsenic" msgstr "Arsenicum" #: ../data/elements.xml.in.h:9 msgid "Astatine" msgstr "Astatine" #: ../data/elements.xml.in.h:10 msgid "Barium" msgstr "Barium" #: ../data/elements.xml.in.h:11 msgid "Berkelium" msgstr "Berkelium" #: ../data/elements.xml.in.h:12 msgid "Beryllium" msgstr "Beryllium" #: ../data/elements.xml.in.h:13 msgid "Bismuth" msgstr "Bismut" #: ../data/elements.xml.in.h:14 msgid "Bohrium" msgstr "Bohrium" #: ../data/elements.xml.in.h:15 msgid "Boron" msgstr "Boor" #: ../data/elements.xml.in.h:16 msgid "Bromine" msgstr "Broom" #: ../data/elements.xml.in.h:17 msgid "Cadmium" msgstr "Cadmium" #: ../data/elements.xml.in.h:18 msgid "Calcium" msgstr "Calcium" #: ../data/elements.xml.in.h:19 msgid "Californium" msgstr "Californium" #: ../data/elements.xml.in.h:20 msgid "Carbon" msgstr "Koolstof" #: ../data/elements.xml.in.h:21 msgid "Cerium" msgstr "Cerium" #: ../data/elements.xml.in.h:22 msgid "Cesium" msgstr "Cesium" #: ../data/elements.xml.in.h:23 msgid "Chlorine" msgstr "Chloor" #: ../data/elements.xml.in.h:24 msgid "Chromium" msgstr "Chroom" #: ../data/elements.xml.in.h:25 msgid "Cobalt" msgstr "Kobalt" #: ../data/elements.xml.in.h:26 msgid "Copper" msgstr "Koper" #: ../data/elements.xml.in.h:27 msgid "Curium" msgstr "Curium" #: ../data/elements.xml.in.h:28 msgid "Darmstadtium" msgstr "Darmstadtium" #: ../data/elements.xml.in.h:29 msgid "Dubnium" msgstr "Dubnium" #: ../data/elements.xml.in.h:30 msgid "Dysprosium" msgstr "Dysprosium" #: ../data/elements.xml.in.h:31 msgid "Einsteinium" msgstr "Einsteinium" #: ../data/elements.xml.in.h:32 msgid "Erbium" msgstr "Erbium" #: ../data/elements.xml.in.h:33 msgid "Europium" msgstr "Europium" #: ../data/elements.xml.in.h:34 msgid "Fermium" msgstr "Fermium" #: ../data/elements.xml.in.h:35 msgid "Fluorine" msgstr "Fluor" #: ../data/elements.xml.in.h:36 msgid "Francium" msgstr "Francium" #: ../data/elements.xml.in.h:37 msgid "Gadolinium" msgstr "Gadolinium" #: ../data/elements.xml.in.h:38 msgid "Gallium" msgstr "Gallium" #: ../data/elements.xml.in.h:39 msgid "Germanium" msgstr "Germanium" #: ../data/elements.xml.in.h:40 msgid "Gold" msgstr "Goud" #: ../data/elements.xml.in.h:41 msgid "Hafnium" msgstr "Hafnium" #: ../data/elements.xml.in.h:42 msgid "Hassium" msgstr "Hassium" #: ../data/elements.xml.in.h:43 msgid "Helium" msgstr "Helium" #: ../data/elements.xml.in.h:44 msgid "Holmium" msgstr "Holmium" #: ../data/elements.xml.in.h:45 msgid "Hydrogen" msgstr "Waterstof" #: ../data/elements.xml.in.h:46 msgid "Indium" msgstr "Indium" #: ../data/elements.xml.in.h:47 msgid "Iodine" msgstr "Jood" #: ../data/elements.xml.in.h:48 msgid "Iridium" msgstr "Iridium" #: ../data/elements.xml.in.h:49 msgid "Iron" msgstr "IJzer" #: ../data/elements.xml.in.h:50 msgid "Krypton" msgstr "Krypton" #: ../data/elements.xml.in.h:51 msgid "Lanthanum" msgstr "Lanthaan" #: ../data/elements.xml.in.h:52 msgid "Lawrencium" msgstr "Lawrencium" #: ../data/elements.xml.in.h:53 msgid "Lead" msgstr "Lood" #: ../data/elements.xml.in.h:54 msgid "Lithium" msgstr "Lithium" #: ../data/elements.xml.in.h:55 msgid "Lutetium" msgstr "Lutetium" #: ../data/elements.xml.in.h:56 msgid "Magnesium" msgstr "Magnesium" #: ../data/elements.xml.in.h:57 msgid "Manganese" msgstr "Mangaan" #: ../data/elements.xml.in.h:58 msgid "Meitnerium" msgstr "Meitnerium" #: ../data/elements.xml.in.h:59 msgid "Mendelevium" msgstr "Mendelevium" #: ../data/elements.xml.in.h:60 msgid "Molybdenum" msgstr "Molybdeen" #: ../data/elements.xml.in.h:61 msgid "Neodymium" msgstr "Neodymium" #: ../data/elements.xml.in.h:62 msgid "Neon" msgstr "Neon" #: ../data/elements.xml.in.h:63 msgid "Neptunium" msgstr "Neptunium" #: ../data/elements.xml.in.h:64 msgid "Nickel" msgstr "Nikkel" #: ../data/elements.xml.in.h:65 msgid "Niobium" msgstr "Niobium" #: ../data/elements.xml.in.h:66 msgid "Nitrogen" msgstr "Stikstof" #: ../data/elements.xml.in.h:67 msgid "Nobelium" msgstr "Nobelium" #: ../data/elements.xml.in.h:68 msgid "Osmium" msgstr "Osmium" #: ../data/elements.xml.in.h:69 msgid "Oxygen" msgstr "Zuurstof" #: ../data/elements.xml.in.h:70 msgid "Palladium" msgstr "Palladium" #: ../data/elements.xml.in.h:71 msgid "Phosphorus" msgstr "Fosfor" #: ../data/elements.xml.in.h:72 msgid "Platinum" msgstr "Platina" #: ../data/elements.xml.in.h:73 msgid "Plutonium" msgstr "Plutonium" #: ../data/elements.xml.in.h:74 msgid "Polonium" msgstr "Polonium" #: ../data/elements.xml.in.h:75 msgid "Potassium" msgstr "Kalium" #: ../data/elements.xml.in.h:76 msgid "Praseodymium" msgstr "Praseodymium" #: ../data/elements.xml.in.h:77 msgid "Promethium" msgstr "Promethium" #: ../data/elements.xml.in.h:78 msgid "Protactinium" msgstr "Protactinium" #: ../data/elements.xml.in.h:79 msgid "Radium" msgstr "Radium" #: ../data/elements.xml.in.h:80 msgid "Radon" msgstr "Radon" #: ../data/elements.xml.in.h:81 msgid "Rhenium" msgstr "Rhenium" #: ../data/elements.xml.in.h:82 msgid "Rhodium" msgstr "Rhodium" #: ../data/elements.xml.in.h:83 msgid "Roentgenium" msgstr "Roentgenium" #: ../data/elements.xml.in.h:84 msgid "Rubidium" msgstr "Rubidium" #: ../data/elements.xml.in.h:85 msgid "Ruthenium" msgstr "Ruthenium" #: ../data/elements.xml.in.h:86 msgid "Rutherfordium" msgstr "Rutherfordium" #: ../data/elements.xml.in.h:87 msgid "Samarium" msgstr "Samarium" #: ../data/elements.xml.in.h:88 msgid "Scandium" msgstr "Scandium" #: ../data/elements.xml.in.h:89 msgid "Seaborgium" msgstr "Seaborgium" #: ../data/elements.xml.in.h:90 msgid "Selenium" msgstr "Selenium" #: ../data/elements.xml.in.h:91 msgid "Silicon" msgstr "Silicium" #: ../data/elements.xml.in.h:92 msgid "Silver" msgstr "Zilver" #: ../data/elements.xml.in.h:93 msgid "Sodium" msgstr "Natrium" #: ../data/elements.xml.in.h:94 msgid "Strontium" msgstr "Strontium" #: ../data/elements.xml.in.h:95 msgid "Sulfur" msgstr "Zwavel" #: ../data/elements.xml.in.h:96 msgid "Tantalum" msgstr "Tantaal" #: ../data/elements.xml.in.h:97 msgid "Technetium" msgstr "Technetium" #: ../data/elements.xml.in.h:98 msgid "Tellurium" msgstr "Telluur" #: ../data/elements.xml.in.h:99 msgid "Terbium" msgstr "Terbium" #: ../data/elements.xml.in.h:100 msgid "Thallium" msgstr "Thallium" #: ../data/elements.xml.in.h:101 msgid "Thorium" msgstr "Thorium" #: ../data/elements.xml.in.h:102 msgid "Thulium" msgstr "Thulium" #: ../data/elements.xml.in.h:103 msgid "Tin" msgstr "Tin" #: ../data/elements.xml.in.h:104 msgid "Titanium" msgstr "Titaan" #: ../data/elements.xml.in.h:105 msgid "Tungsten" msgstr "Tungsten" #: ../data/elements.xml.in.h:106 msgid "Ununbium" msgstr "Ununbium" #: ../data/elements.xml.in.h:107 msgid "Ununhexium" msgstr "Ununhexium" #: ../data/elements.xml.in.h:108 msgid "Ununoctium" msgstr "Ununoctium" #: ../data/elements.xml.in.h:109 msgid "Ununpentium" msgstr "Ununpentium" #: ../data/elements.xml.in.h:110 msgid "Ununquadium" msgstr "Ununquadium" #: ../data/elements.xml.in.h:111 msgid "Ununseptium" msgstr "Ununseptium" #: ../data/elements.xml.in.h:112 msgid "Ununtrium" msgstr "Ununtrium" #: ../data/elements.xml.in.h:113 msgid "Uranium" msgstr "Uraan" #: ../data/elements.xml.in.h:114 msgid "Vanadium" msgstr "Vanadium" #: ../data/elements.xml.in.h:115 msgid "Xenon" msgstr "Xenon" #: ../data/elements.xml.in.h:116 msgid "Ytterbium" msgstr "Ytterbium" #: ../data/elements.xml.in.h:117 msgid "Yttrium" msgstr "Yttrium" #: ../data/elements.xml.in.h:118 msgid "Zinc" msgstr "Zink" #: ../data/elements.xml.in.h:119 msgid "Zirconium" msgstr "Zirconium" #: ../data/functions.xml.in.h:1 msgid "-r:bmi" msgstr "" #: ../data/functions.xml.in.h:2 msgid "10 raised the to power X" msgstr "10 tot de macht X" #: ../data/functions.xml.in.h:3 msgid "1st value" msgstr "1e waarde" #: ../data/functions.xml.in.h:4 msgid "2 raised the to power X" msgstr "2 tot de macht X" #: ../data/functions.xml.in.h:5 msgid "2nd value" msgstr "2de waarde" #: ../data/functions.xml.in.h:6 msgid "ASCII Char" msgstr "ASCII-kar" #: ../data/functions.xml.in.h:7 msgid "ASCII Value" msgstr "ASCII-waarde" #: ../data/functions.xml.in.h:8 msgid "Absolute Value" msgstr "Absolute waarde" #: ../data/functions.xml.in.h:9 msgid "Accrued interest of security paying at maturity" msgstr "Totale rente van waardepapier op vervaldatum" #: ../data/functions.xml.in.h:10 msgid "Accrued interest of security with periodic interest payments" msgstr "Totale rente van waardepapier met periodieke renteuitkeringen" #: ../data/functions.xml.in.h:11 msgid "Add" msgstr "Optellen" #: ../data/functions.xml.in.h:12 msgid "Add Days" msgstr "Dagen bijtellen" #: ../data/functions.xml.in.h:13 msgid "Add Months" msgstr "Maanden bijtellen" #: ../data/functions.xml.in.h:14 msgid "Add Time" msgstr "Tijd optellen" #: ../data/functions.xml.in.h:15 msgid "Add Years" msgstr "Jaren bijtellen" #: ../data/functions.xml.in.h:16 msgid "" "Adds a time value to a date. The value can be positive or negative, but must " "use a unit based on seconds (such as day and year). Fractions of days are " "truncated." msgstr "" "Telt een tijdswaarde op bij een datum. Deze waarde kan zowel positief zijn " "als negatief, maar moet in een eenheid zijn uitgedrukt die op seconden is " "gebaseerd (zoals dag of jaar). Fracties van dagen worden afgekapt tot hele " "dagen." #: ../data/functions.xml.in.h:17 msgid "Adjugate (Adjoint)" msgstr "Aangrenzend" #: ../data/functions.xml.in.h:18 msgid "Algebra" msgstr "Algebra" #: ../data/functions.xml.in.h:19 msgid "Amortizement period" msgstr "Amortisatieperiode" #: ../data/functions.xml.in.h:20 msgid "Amount received at maturity for a security bond" msgstr "Ontvangen bedrag voor een waardepapier op vervaldatum" #: ../data/functions.xml.in.h:21 msgid "Analysis" msgstr "Analyse" #: ../data/functions.xml.in.h:22 msgid "Angle" msgstr "Hoek" #: ../data/functions.xml.in.h:24 #, no-c-format msgid "Annual coupon rate (%)" msgstr "Jaarlijkse couponopbrengst (%)" #: ../data/functions.xml.in.h:25 msgid "Annual rate of security" msgstr "Jaarlijkse rente van waardepapier" #: ../data/functions.xml.in.h:26 msgid "Annual yield" msgstr "Opbrengst per jaar" #: ../data/functions.xml.in.h:28 #, no-c-format msgid "Annualized yield (%)" msgstr "Teruggerekende opbrengst per jaar (%)" #: ../data/functions.xml.in.h:29 msgid "Arguments" msgstr "Argumenten" #: ../data/functions.xml.in.h:30 msgid "Arithmetics" msgstr "Rekenen" #: ../data/functions.xml.in.h:31 msgid "Ascending" msgstr "Oplopend" #: ../data/functions.xml.in.h:32 msgid "Base" msgstr "Grondtal" #: ../data/functions.xml.in.h:33 msgid "Base-10 Logrithm" msgstr "Logaritme met grondtal 10" #: ../data/functions.xml.in.h:34 msgid "Base-2 Logrithm" msgstr "Logaritme met grondtal 2" #: ../data/functions.xml.in.h:35 msgid "Base-N Logarithm" msgstr "Logaritme met grondtal N" #: ../data/functions.xml.in.h:36 msgid "Beta Function" msgstr "Beta-functie" #: ../data/functions.xml.in.h:37 msgid "Binary" msgstr "Binair" #: ../data/functions.xml.in.h:38 msgid "Binary number" msgstr "Binair getal" #: ../data/functions.xml.in.h:39 msgid "Binomial Coefficient" msgstr "Binomiaalcoëfficiënt" #: ../data/functions.xml.in.h:40 msgid "Bits" msgstr "Bits" #: ../data/functions.xml.in.h:41 msgid "Bitwise Exclusive OR" msgstr "Bitsgewijs XOR" #: ../data/functions.xml.in.h:42 msgid "Bitwise Shift" msgstr "Bitsgewijs verschuiven (shift)" #: ../data/functions.xml.in.h:43 msgid "Body Mass Index (BMI)" msgstr "Body Mass Index (BMI) (Index voor lichaamsmassa)" #: ../data/functions.xml.in.h:44 msgid "Bottom" msgstr "Onder" #: ../data/functions.xml.in.h:45 msgid "" "Calculates and returns the price per $100 face value of a security bond. The " "security does not pay interest at maturity. Basis is the type of " "day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Berekent en retourneert de prijs per €100 nominaal van een " "waardepapier. Er wordt na de vervaldatum geen rente uitgekeerd. " "Basis is de manier waarop dagen worden geteld: 0: US 30/360 (standaard), 1: " "werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: " "Europees 30/360." #: ../data/functions.xml.in.h:46 msgid "" "Calculates and returns the price per $100 face value of a security. The " "security pays interest at maturity. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Berekent en retourneert de prijs per €100 nominale waarde van een " "waardepapier. De rente wordt uitgekeerd op de vervaldatum. Basis is " "de manier waarop dagen worden geteld: 0: US 30/360 (standaard), 1: " "werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: " "Europees 30/360." #: ../data/functions.xml.in.h:47 msgid "" "Calculates number of periods of an investment based on periodic constant " "payments and a constant interest rate. Type defines the due date. 1 " "for payment at the beginning of a period and 0 (default) for payment at the " "end of a period." msgstr "" "Berekent het aantal termijnen voor een investering op basis van periodiek " "gelijkblijvende betalingen en een gelijkblijvende rente. Type " "bepaalt de datum waarop moet worden betaald. 1 voor betalen aan het begin " "van een termijn en 0 (standaard) voor betalen aan het eind van een termijn." #: ../data/functions.xml.in.h:48 msgid "" "Calculates the Body Mass Index. The resulting BMI-value is sometimes " "interpreted as follows (although varies with age, sex, etc.): " "Underweight < 18.5 Normal weight 18.5-25 " "Overweight 25-30 Obesity > 30 Note that " "you must use units for weight (ex. 59kg) and length (ex. 174cm)." msgstr "" "Berekent de zg. Body Mass Index (index voor de lichaamsmassa). De berekende " "BMI wordt als volgt beoordeeld (hoewel dit varieert met leeftijd, geslacht, " "enz): Te laag gewicht < 18.5 Normaal gewicht " " 18.5-25 Te hoog gewicht 25-30 Zwaarlijvigheid " "> 30 Let er opdat u eenheden gebruikt voor gewicht (bv. 59kg) en " "lengte (bv. 174cm)." #: ../data/functions.xml.in.h:49 msgid "Calculates the adjugate or adjoint of a matrix." msgstr "Berekent de geadjungeerde matrix." #: ../data/functions.xml.in.h:50 msgid "" "Calculates the amount of a payment of an annuity going towards interest. " " Type defines the due date. 1 for payment at the beginning of a period " "and 0 (default) for payment at the end of a period." msgstr "" "Berekent het interestdeel van een periodieke betaling voor een annuïteit." " Type bepaalt de vervaldatum van de betaling. 1 voor betaling " "aanhet het begin van de termijn en 0 (standaard) voor betaling aan het einde " "van de termijn." #: ../data/functions.xml.in.h:51 msgid "" "Calculates the amount of a payment of an annuity going towards principal." " Type defines the due date. 1 for payment at the beginning of a " "period and 0 (default) for payment at the end of a period." msgstr "" "Berekent het aflossingsdeel van een periodieke betaling voor een annuïteit." " Type bepaalt de vervaldatum van de betaling. 1 voor betaling " "aanhet het begin van de termijn en 0 (standaard) voor betaling aan het einde " "van de termijn." #: ../data/functions.xml.in.h:52 msgid "Calculates the area of a circle using the radius" msgstr "Berekent met de straal het oppervlak van een cirkel" #: ../data/functions.xml.in.h:53 msgid "" "Calculates the area of a four-sided figure whose opposite sides are both " "parallel and equal in length." msgstr "" "Berekent de oppervlakte van een figuur met vier zijden waarvan de " "overstaande zijden zowel evenwijdig als even lang zijn." #: ../data/functions.xml.in.h:54 msgid "Calculates the area of a four-sided figure with two parallel sides." msgstr "" "Berekent de oppervlakte van een figuur met vier zijden waarvan twee zijden " "evenwijdig zijn." #: ../data/functions.xml.in.h:55 msgid "Calculates the cofactor of the element at specified position." msgstr "Berekent de cofactor van het element op de opgegeven positie." #: ../data/functions.xml.in.h:56 msgid "Calculates the cross product of two 3-dimensional vectors." msgstr "Berekent het uitproduct van twee 3-dimensionale vectoren." #: ../data/functions.xml.in.h:57 msgid "" "Calculates the demand elasticity. Also works for supply elasticity, income " "elasticity, cross-price elasticity, etc. Just replace demand, with supply, " "or price with income... Ex. elasticity(100-x^2, 3) calculates the " "demand elasticity when the price is 3 for the function \"Q = 100 - x^2\" " "where x is the default price variable." msgstr "" "Berekent de vraagelasticiteit. Is ook toepasbaar op aanbodelasticiteit, " "inkomenselasticiteit, prijselasticiteit, enzovoorts. Vervang vraag door " "aanbod of prijs met inkomen... %#10; De formule elasticity(100-x^2, 3) " "bijvoorbeeld berekent de vraagelasticiteit als de prijs 3 is voor de functie " "\"Q = 100 -x^2\". waar x de standaard prijsvariabele is." #: ../data/functions.xml.in.h:58 msgid "Calculates the determinant of a matrix." msgstr "Berekent de determinant van een matrix." #: ../data/functions.xml.in.h:59 msgid "Calculates the difference between the first and third quartile." msgstr "Berekent het verschil tussen het eerste en het derde kwartiel." #: ../data/functions.xml.in.h:60 msgid "Calculates the difference between the min and max value." msgstr "Berekent het verschil tussen de kleinste en de grootste waarde." #: ../data/functions.xml.in.h:61 msgid "" "Calculates the doublefactorial of an integer. Mulitplies the argument with " "every second lesser positive integer (n(n-2)(n-4)...). Can also be entered " "as a number followed by two exclamation marks. ex. factorial2(5) = " "5!! = 5 * 3 * 1 = 15" msgstr "" "Berekent de dubbelfaculteit van een positief geheel getal n: (n(n-2)(n-4)... " "Kan ook worden ingevoerd als een positief geheel getal, gevolgd door twee " "uitroeptekens. bv. factorial2(5) = 5!! = 5 * 3 * 1 = 15" #: ../data/functions.xml.in.h:62 msgid "Calculates the duration of a security." msgstr "Berekent de looptijd van een waardepapier." #: ../data/functions.xml.in.h:63 msgid "Calculates the effective interest for a given nominal rate." msgstr "Berekent de effectieve rente bij een gegeven nominale rente." #: ../data/functions.xml.in.h:64 msgid "" "Calculates the factorial of an integer. Mulitplies the argument with every " "lesser positive integer (n(n-1)(n-2)...2*1). Can also be entered as a number " "followed by one exclamation mark. ex. factorial(5) = 5! = 5 * 4 * 3 " "* 2 * 1 = 120" msgstr "" "Berekent de faculteit van een positief geheel getal n: (n(n-1)(n-2)... " "*2*1. Kan ook worden ingevoerd als een positief geheel getal, gevolgd door " "een uitroepteken. bv. factorial(5) = 5! = 5 * 4 * 3 * 2 * 1 = 120" #: ../data/functions.xml.in.h:65 msgid "" "Calculates the hyperfactorial of an integer. Mulitplies the argument raised " "by itself with every lesser positive integer raised by themselves (1^1 * " "2^2 ... n^n). ex. hyperfactorial(3) = (3^3) * (2^2) * (1^1) = 108" msgstr "" "Berekent de hyperfaculteit van een positief geheel getal n: (n^n*(n-1)^(n-" "1)...*2^2*1^1. bv. hyperfactorial(3) = (3^3) * (2^2) * (1^1) = " "27*4*1 = 108" #: ../data/functions.xml.in.h:66 msgid "Calculates the interest paid on a given period of an investment." msgstr "Berekent de betaalde rente over de opgegeven investeringstermijn." #: ../data/functions.xml.in.h:67 msgid "" "Calculates the inverse of a matrix. The inverse is the matrix that " "multiplied by the original matrix equals the identity matrix (AB = BA = I)." msgstr "" "Retourneert de inverse van een matrix. De inverse matrix is de matrix die, " "vermenigvuldigd met de originele matrix, de eenheidsmatrix geeft (AB = BA = " "E)." #: ../data/functions.xml.in.h:68 msgid "" "Calculates the multifactorial of an integer. Mulitplies the argument with " "every x lesser positive integer (n(n-x)(n-2x)...). Can also be entered as a " "number followed by three or more exclamation marks. ex. " "multifactorial(18, 4) = 18!!!! = 18 * 14 * 10 * 6 * 2 = 30 240" msgstr "" "Berekent de multifaculteit van een positief geheel getal n: (n(n-x)(n-" "2x)...). Kan ook worden ingevoerd als een positief geheel getal gevolgd door " "drie of meer uitroeptekens. bv. multifactorial(18, 4) = 18!!!! = 18 " "* 14 * 10 * 6 * 2 = 30 240" #: ../data/functions.xml.in.h:69 msgid "" "Calculates the nominal interest rate from a given effective interest rate " "compounded at given intervals." msgstr "" "Berekent de nominale rente uit de effectieve rente betaald over het " "opgegeven tijdsinterval." #: ../data/functions.xml.in.h:70 msgid "Calculates the norm/length of a vector." msgstr "Berekent de norm/lengte van een vector." #: ../data/functions.xml.in.h:71 msgid "" "Calculates the perimeter of a four-sided figure whose opposite sides are " "both parallel and equal in length." msgstr "" "Berekent de omtrek van een figuur met vier zijden waarvan de overstaande " "zijden zowel evenwijdig als even lang zijn." #: ../data/functions.xml.in.h:72 msgid "" "Calculates the permanent of a matrix. The permanent differs from a " "determinant in that all signs in the expansion by minors are taken as " "positive." msgstr "" "Berekent de permanent van een matrix. Het verschil met de determinant is dat " "alle subdeterminanten met +1 worden vermenigvuldigd, en bij de determinant " "om en om met +1 en met -1." #: ../data/functions.xml.in.h:73 msgid "" "Calculates the return on continuously compounded interest, given the " "principal, nominal rate and time in years." msgstr "" "Berekent de opbrengst bij een continu samengestelde rente, gegeven de " "hoofdsom, nominale rente en de tijd in jaren." #: ../data/functions.xml.in.h:74 msgid "" "Calculates the sum-of-years digits depreciation for an asset based on its " "cost, salvage value, anticipated life, and a particular period. This method " "accelerates the rate of the depreciation, so that more depreciation expense " "occurs in earlier periods than in later ones. The depreciable cost is the " "actual cost minus the salvage value. The useful life is the number of " "periods (typically years) over which the asset is depreciated." msgstr "" "Berekent de afschrijving naar leeftijd voor een actief gebaseerd op de " "aanschafkosten, de restwaarde, de verwachte economische levensduur en een " "bepaalde periode. Deze methode vermindert de afschrijvingskosten naarmate " "het actief ouder word. De afschrijvingskosten zijn dus aan het begin het " "hoogst. De af te schrijven waarde wordt berekend uit het verschil tussen " "aanschaf- en restwaarde. De economische levensduur is het aantal perioden " "(meestal jaren) waarin het actief word afgeschreven." #: ../data/functions.xml.in.h:75 msgid "" "Calculates the superfactorial of an integer. Mulitplies the factorial of the " "argument with the factorial of every lesser positive integer (1! * 2! ... " "n!). ex. superfactorial(5) = 5! * 4! * 3! * 2! * 1! = 34 560" msgstr "" "Berekent de superfaculteit van een positief geheel getal n: (n!*(n-1)!...*2!" "*1! bv. superfactorial(5) = 5! * 4! * 3! * 2! * 1! = 120 * 24 * 6 " "* 2 * 1 =34 560" #: ../data/functions.xml.in.h:76 msgid "Calculates the surface area of a prism with rectangular base." msgstr "Berekent de oppervlakte van een prisma met een rechthoekig basisvlak." #: ../data/functions.xml.in.h:77 msgid "Calculates the value of a level-coupon bond." msgstr "Berekent de waarde van een obligatie met gelijkblijvende coupons." #: ../data/functions.xml.in.h:78 msgid "Calculates the value of a zero-coupon (pure discount) bond." msgstr "Berekent de waarde van een obligatie zonder coupons." #: ../data/functions.xml.in.h:79 msgid "" "Calculates the volume of a 3-dimensional shape standing on a rectangular " "base and terminating in a point at the top." msgstr "" "Berekent de inhoud van een 3-dimensionaal lichaam met een rechthoekig " "basisvlak en een top in de vorm van een punt." #: ../data/functions.xml.in.h:80 msgid "Calculates the volume of a prism with rectangular base." msgstr "Berekent de inhoud van een prisma met een rechthoekig basisvlak." #: ../data/functions.xml.in.h:81 msgid "Calculates the volume of a prism with triangular base." msgstr "Berekent de inhoud van een prisma met een driehoekig basisvlak." #: ../data/functions.xml.in.h:82 msgid "Calculus" msgstr "Calculus" #: ../data/functions.xml.in.h:83 msgid "Category" msgstr "Categorie" #: ../data/functions.xml.in.h:84 msgid "Ceil" msgstr "Ceil" #: ../data/functions.xml.in.h:85 msgid "Character" msgstr "Karakter" #: ../data/functions.xml.in.h:86 msgid "Circle" msgstr "Cirkel" #: ../data/functions.xml.in.h:87 msgid "Circle Area" msgstr "Cirkeloppervlak" #: ../data/functions.xml.in.h:88 msgid "Circle Circumference" msgstr "Cirkelomtrek" #: ../data/functions.xml.in.h:89 msgid "Coefficient" msgstr "Coëfficiënt" #: ../data/functions.xml.in.h:90 msgid "Cofactor" msgstr "Cofactor" #: ../data/functions.xml.in.h:91 msgid "Column" msgstr "Kolom" #: ../data/functions.xml.in.h:92 msgid "Column variable" msgstr "Kolomvariabele" #: ../data/functions.xml.in.h:93 msgid "Columns" msgstr "Kolommen" #: ../data/functions.xml.in.h:94 msgid "Combinations" msgstr "Combinaties" #: ../data/functions.xml.in.h:95 msgid "Combinatorics" msgstr "Combinatoriek" #: ../data/functions.xml.in.h:96 msgid "Complex Exponential (Cis)" msgstr "Complex Exponentieel (Cis)" #: ../data/functions.xml.in.h:97 msgid "Complex number" msgstr "Complex getal" #: ../data/functions.xml.in.h:98 msgid "Compound" msgstr "Samengesteld" #: ../data/functions.xml.in.h:99 msgid "" "Computes the future value of an investment. This is based on periodic, " "constant payments and a constant interest rate. If type = 1 then " "the payment is made at the beginning of the period, If type = 0 (or omitted) " "it is made at the end of each period." msgstr "" "Berekent de waarde van een investering. Dit wordt gebaseerd op periodieke " "gelijkblijvende betalingen en een gelijkblijvende rente. Indien " "type = 1 wordt er betaald aanhet het begin van de termijn, als type = 0 (of " "weggelaten)wordt er betaald aan het einde van elke termijn." #: ../data/functions.xml.in.h:100 msgid "Concatenate Strings" msgstr "Karakterrijen samenvoegen" #: ../data/functions.xml.in.h:101 msgid "Condition" msgstr "Conditie" #: ../data/functions.xml.in.h:102 msgid "Cone" msgstr "Kegel" #: ../data/functions.xml.in.h:103 msgid "Cone Volume" msgstr "Volume van kegel" #: ../data/functions.xml.in.h:104 msgid "Construct Matrix" msgstr "Matrix construeren" #: ../data/functions.xml.in.h:105 msgid "Construct Vector" msgstr "Vector construeren" #: ../data/functions.xml.in.h:106 msgid "Consumer Surplus" msgstr "Consumentenoverschot" #: ../data/functions.xml.in.h:107 msgid "Content Part" msgstr "Inhoudgedeelte" #: ../data/functions.xml.in.h:108 msgid "Convert Matrix to Vector" msgstr "Matrix naar vector converteren" #: ../data/functions.xml.in.h:109 msgid "" "Converts a decimal dollar price into a dollar price expressed as a fraction." msgstr "" "Converteert een prijs in decimale dollars naar een prijs in dollars " "uitgedrukt als een breuk." #: ../data/functions.xml.in.h:110 msgid "" "Converts a dollar price expressed as a fraction into a dollar price " "expressed as a decimal number." msgstr "" "Converteert een prijs in dollars uitgedrukt als een breuk naar een prijs " "uitgedrukt in een decimaal getal." #: ../data/functions.xml.in.h:111 msgid "" "Corresponds to the product symbol. Multiplies factors for each x ranging " "from the lower to the upper limit." msgstr "" "Komt overeen met het symbool voor vermenigvuldiging. Vermenigvuldigt met " "factoren met een waarde tussen de kleinste en de grootste grenswaarde." #: ../data/functions.xml.in.h:112 msgid "" "Corresponds to the sum symbol. Adds terms for each x ranging from the lower " "to the upper limit." msgstr "" "Komt overeen met symbool voor optellen. Telt termen op met een waarde tussen " "de kleinste en de grootste grenswaarde." #: ../data/functions.xml.in.h:113 msgid "Cosecant" msgstr "Cosecant" #: ../data/functions.xml.in.h:114 msgid "Cosine" msgstr "Cosinus" #: ../data/functions.xml.in.h:115 msgid "Cost" msgstr "Kosten" #: ../data/functions.xml.in.h:116 msgid "Cotangent" msgstr "Cotangens" #: ../data/functions.xml.in.h:117 msgid "Counter update function" msgstr "Functie voor bijwerken van de teller" #: ../data/functions.xml.in.h:118 msgid "Counter variable" msgstr "Tellervariabele" #: ../data/functions.xml.in.h:119 msgid "Coupon rate" msgstr "Couponrente" #: ../data/functions.xml.in.h:120 msgid "Coupons per year" msgstr "Aantal coupons per jaar" #: ../data/functions.xml.in.h:121 msgid "Covariance" msgstr "Covariantie" #: ../data/functions.xml.in.h:122 msgid "Cross Product" msgstr "Uitproduct" #: ../data/functions.xml.in.h:123 msgid "Cube" msgstr "Derdemacht" #: ../data/functions.xml.in.h:124 msgid "Cube Root" msgstr "Derdemachtswortel" #: ../data/functions.xml.in.h:125 msgid "Cube Volume" msgstr "Volume kubus" #: ../data/functions.xml.in.h:126 msgid "Current Time" msgstr "Huidige tijd" #: ../data/functions.xml.in.h:127 msgid "Custom Sum of Elements" msgstr "Aangepaste som van elementen" #: ../data/functions.xml.in.h:128 msgid "Cylinder" msgstr "Cilinder" #: ../data/functions.xml.in.h:129 msgid "Cylinder Volume" msgstr "Volume van cilinder" #: ../data/functions.xml.in.h:130 msgid "Data" msgstr "Gegevens" #: ../data/functions.xml.in.h:131 msgid "Data 1" msgstr "Gegevens 1" #: ../data/functions.xml.in.h:132 msgid "Data 2" msgstr "Gegevens 2" #: ../data/functions.xml.in.h:133 msgid "Date" msgstr "Datum" #: ../data/functions.xml.in.h:134 msgid "Date & Time" msgstr "Datum & Tijd" #: ../data/functions.xml.in.h:135 msgid "Date to Unix Timestamp" msgstr "Datum naar Unix-timestamp" #: ../data/functions.xml.in.h:136 msgid "Day counting basis" msgstr "Basis dagtelling" #: ../data/functions.xml.in.h:137 msgid "Day of Month" msgstr "Dag van de maand" #: ../data/functions.xml.in.h:138 msgid "Day of Week" msgstr "Dag van de week" #: ../data/functions.xml.in.h:139 msgid "Day of Year" msgstr "Dag van het jaar" #: ../data/functions.xml.in.h:140 msgid "Days" msgstr "Dagen" #: ../data/functions.xml.in.h:141 msgid "Days between two dates" msgstr "Aantal dagen tussen twee data" #: ../data/functions.xml.in.h:142 msgid "Decile" msgstr "Deciel" #: ../data/functions.xml.in.h:143 msgid "Decimal dollar" msgstr "Decimale dollar" #: ../data/functions.xml.in.h:144 msgid "Demand function" msgstr "Vraagfunctie" #: ../data/functions.xml.in.h:145 msgid "Demand function or price" msgstr "Vraagfunctie of prijs" #: ../data/functions.xml.in.h:146 msgid "Denominator" msgstr "Noemer" #: ../data/functions.xml.in.h:147 msgid "Denominator of fraction" msgstr "Noemer van breuk" #: ../data/functions.xml.in.h:148 msgid "Derangements" msgstr "Derangementen" #: ../data/functions.xml.in.h:149 msgid "Derive" msgstr "Afleiden" #: ../data/functions.xml.in.h:150 msgid "Descriptive Statistics" msgstr "Beschrijvende statistiek" #: ../data/functions.xml.in.h:151 msgid "Desired future value" msgstr "Gewenste toekomstige waarde" #: ../data/functions.xml.in.h:152 msgid "Determinant" msgstr "Determinant" #: ../data/functions.xml.in.h:153 msgid "" "Determines the straight line depreciation of an asset for a single period." " Cost is the amount you paid for the asset. Salvage is the value of " "the asset at the end of the period. Life is the number of periods over which " "the asset is depreciated. SLN divides the cost evenly over the life of an " "asset." msgstr "" "Bepaalt de waardevermindering volgens een rechte lijn van een bezit " "gedurende een enkele termijn. Kosten is het voor het bezit " "betaalde bedrag. Restwaarde is de waarde van het bezit aan het einde van de " "termijn. Levensduur is het aantal termijnen waarover het bezit wordt " "afgeschreven. Door deze vorm van afschrijven worden de kosten gelijkelijk " "verdeeld over de gehele afschrijvingsduur." #: ../data/functions.xml.in.h:154 msgid "Dimension" msgstr "Dimensie" #: ../data/functions.xml.in.h:155 msgid "Dimension / Step size" msgstr "Dimensie / stapgrootte" #: ../data/functions.xml.in.h:156 msgid "" "Discontinuous function also known as \"unit step function\". Returns 0 if x " "< 0, 1 if x > 0, and 1/2 if x = 0." msgstr "" "Discontinue functie die ook bekend staat als de \"eenheids stapfunctie\". " "Retourneert 0 indien x < 0, 1 indien x ;gt; 0, en 1/2 indien x=0." #: ../data/functions.xml.in.h:157 msgid "Discount" msgstr "Korting" #: ../data/functions.xml.in.h:158 msgid "Discount rate" msgstr "Discontopercentage" #: ../data/functions.xml.in.h:159 msgid "Discount rate for a security" msgstr "Discontopercentage voor een waardepapier" #: ../data/functions.xml.in.h:160 msgid "Display Error" msgstr "Weergavefout" #: ../data/functions.xml.in.h:161 msgid "Display Message" msgstr "Bericht weergeven" #: ../data/functions.xml.in.h:162 msgid "Display Warning" msgstr "Waarschuwing weergeven" #: ../data/functions.xml.in.h:163 msgid "Distribution" msgstr "Distributie" #: ../data/functions.xml.in.h:164 msgid "Divide" msgstr "Delen" #: ../data/functions.xml.in.h:165 msgid "Do function" msgstr "Do-functie" #: ../data/functions.xml.in.h:166 msgid "Dollar Decimal" msgstr "Dollar decimaal" #: ../data/functions.xml.in.h:167 msgid "Dollar Fraction" msgstr "Dollar fractie" #: ../data/functions.xml.in.h:168 msgid "Double Factorial" msgstr "Dubbele faculteit" #: ../data/functions.xml.in.h:169 msgid "Duration" msgstr "Duur" #: ../data/functions.xml.in.h:170 msgid "Durbin-Watson" msgstr "Durbin-Watson" #: ../data/functions.xml.in.h:171 msgid "Economics" msgstr "Economie" #: ../data/functions.xml.in.h:172 msgid "Effective Interest Rate" msgstr "Effectief rentepercentage" #: ../data/functions.xml.in.h:173 msgid "Effective interest rate" msgstr "Effectief rentepercentage" #: ../data/functions.xml.in.h:174 msgid "Elasticity" msgstr "Elasticiteit" #. Vector/matrix element #: ../data/functions.xml.in.h:176 msgid "Element" msgstr "Element" #: ../data/functions.xml.in.h:177 msgid "Element variable" msgstr "Elementvariabele" #. Vector/matrix elements #: ../data/functions.xml.in.h:179 msgid "Elements" msgstr "Elementen" #: ../data/functions.xml.in.h:180 msgid "End column" msgstr "Einde kolom" #: ../data/functions.xml.in.h:181 msgid "End row" msgstr "Einde rij" #: ../data/functions.xml.in.h:182 msgid "Equation" msgstr "Vergelijking" #: ../data/functions.xml.in.h:183 msgid "Equation 1" msgstr "Vergelijking 1" #: ../data/functions.xml.in.h:184 msgid "Equation 2" msgstr "Vergelijking 2" #: ../data/functions.xml.in.h:185 msgid "Equation vector" msgstr "Vergelijkingsvector" #: ../data/functions.xml.in.h:186 msgid "Even" msgstr "Even" #: ../data/functions.xml.in.h:187 msgid "Exponent" msgstr "Exponent" #: ../data/functions.xml.in.h:188 msgid "Exponential (e^x)" msgstr "Exponent (e^x)" #: ../data/functions.xml.in.h:189 msgid "Exponents & Logarithms" msgstr "Exponenten & Logaritmen" #: ../data/functions.xml.in.h:190 msgid "Export To CSV File" msgstr "Exporteren naar CSV-bestand" #: ../data/functions.xml.in.h:191 msgid "Exports a matrix to a CSV data file." msgstr "Exporteert een matrix naar een CSV-gegevensbestand." #: ../data/functions.xml.in.h:192 msgid "Expression" msgstr "Expressie" #: ../data/functions.xml.in.h:193 msgid "Expression if condition is NOT met" msgstr "Expressie indien NIET aan conditie wordt voldaan" #: ../data/functions.xml.in.h:194 msgid "Expression if condition is met" msgstr "Expressie indien aan conditie wordt voldaan" #: ../data/functions.xml.in.h:195 msgid "Extract Column as Vector" msgstr "Kolom als vector uit (matrix) halen" #: ../data/functions.xml.in.h:196 msgid "Extract Fractional Part" msgstr "Fractionele deel uit (getal) halen" #: ../data/functions.xml.in.h:197 msgid "Extract Integer Part" msgstr "Gehele deel uit (getal) halen" #: ../data/functions.xml.in.h:198 msgid "Extract row as vector" msgstr "Rij als vector uit (matrix) halen" #: ../data/functions.xml.in.h:199 msgid "Extreme Values" msgstr "Uiterste waarden" #: ../data/functions.xml.in.h:200 msgid "Face value" msgstr "Nominale waarde" #: ../data/functions.xml.in.h:201 msgid "Factor expression" msgstr "Expressie voor factor" #: ../data/functions.xml.in.h:202 msgid "Factorial" msgstr "Faculteit" #: ../data/functions.xml.in.h:203 msgid "Factors" msgstr "Factoren" #: ../data/functions.xml.in.h:204 msgid "Filename" msgstr "Bestandsnaam" #: ../data/functions.xml.in.h:205 msgid "Finance" msgstr "Financiën" #: ../data/functions.xml.in.h:206 msgid "Financial function mode" msgstr "Financiële functiemodus" #: ../data/functions.xml.in.h:207 msgid "Find Linear Function" msgstr "Lineaire functie bepalen" #: ../data/functions.xml.in.h:208 msgid "" "Finds the linear function for the straight line between two distinct points." msgstr "" "Bepaalt de lineaire functie voor de rechte lijn tussen twee verschillende " "punten." #: ../data/functions.xml.in.h:209 msgid "First data row" msgstr "Eerste gegevensrij" #: ../data/functions.xml.in.h:210 msgid "First date" msgstr "Eerste datum" #: ../data/functions.xml.in.h:211 msgid "First element" msgstr "Eerste element" #: ../data/functions.xml.in.h:212 msgid "First interest" msgstr "Eerste rente" #: ../data/functions.xml.in.h:213 msgid "For condition" msgstr "For-voorwaarde" #: ../data/functions.xml.in.h:214 msgid "For...Do" msgstr "For...Do" #: ../data/functions.xml.in.h:215 msgid "Fractional dollar" msgstr "Dollar als breuk" #. Reccurance #: ../data/functions.xml.in.h:217 msgid "Frequency" msgstr "Frequentie" #: ../data/functions.xml.in.h:218 msgid "Function" msgstr "Functie" #: ../data/functions.xml.in.h:219 msgid "Future Value" msgstr "Toekomstige waarde" #: ../data/functions.xml.in.h:220 msgid "Future value" msgstr "Toekomstige waarde" #: ../data/functions.xml.in.h:221 msgid "Gamma Function" msgstr "Gamma-functie" #: ../data/functions.xml.in.h:222 msgid "Generate Vector" msgstr "Vector aanmaken" #: ../data/functions.xml.in.h:223 msgid "" "Generates a pseudo-random number. Returns a real number between 0 and 1, if " "ceil is zero (default), or an integer between 1 and (including) ceil." msgstr "" "Levert een pseudowillekeurig getal. Retourneert een reëel getal tussen 0 en " "1 als ceil nul is (standaard), of een getal tussen 1 en ceil (inclusief)." #: ../data/functions.xml.in.h:224 msgid "Geometric Mean" msgstr "Meetkundig gemiddelde" #: ../data/functions.xml.in.h:225 msgid "Geometry" msgstr "Meetkunde" #: ../data/functions.xml.in.h:226 msgid "Greatest Common Divisor" msgstr "Grootste gemene deler" #: ../data/functions.xml.in.h:227 msgid "Harmonic Mean" msgstr "Harmonisch gemiddelde" #: ../data/functions.xml.in.h:228 msgid "Heaviside Step Function" msgstr "Heavyside stapfunctie" #: ../data/functions.xml.in.h:229 msgid "Height" msgstr "Hoogte" #: ../data/functions.xml.in.h:230 msgid "Height of Regular Tetrahedron" msgstr " Hoogte van een regelmatig viervlak (tetraëder)" #: ../data/functions.xml.in.h:231 msgid "Height of Square Pyramid" msgstr "Hoogte van een vierkante piramide" #: ../data/functions.xml.in.h:232 msgid "Hexadecimal" msgstr "Hexadecimaal" #: ../data/functions.xml.in.h:233 msgid "Hexadecimal number" msgstr "Hexadecimaal getal" #: ../data/functions.xml.in.h:234 msgid "Hyperbolic Cosecant" msgstr "Hyperbolische cosecans" #: ../data/functions.xml.in.h:235 msgid "Hyperbolic Cosine" msgstr "Hyperbolische cosinus" #: ../data/functions.xml.in.h:236 msgid "Hyperbolic Cotangent" msgstr "Hyperbolische cotangens" #: ../data/functions.xml.in.h:237 msgid "Hyperbolic Secant" msgstr "Hyperbolische secans" #: ../data/functions.xml.in.h:238 msgid "Hyperbolic Sine" msgstr "Hyperbolische sinus" #: ../data/functions.xml.in.h:239 msgid "Hyperbolic Tangent" msgstr "Hyperbolische tangens" #: ../data/functions.xml.in.h:240 msgid "Hyperfactorial" msgstr "Hyperfaculteit" #: ../data/functions.xml.in.h:241 msgid "Hypotenuse" msgstr "Hypotenusa" #: ../data/functions.xml.in.h:242 msgid "Identity" msgstr "Identiteit" #: ../data/functions.xml.in.h:243 msgid "If...Then...Else" msgstr "If...Then...Else" #: ../data/functions.xml.in.h:244 msgid "Imaginary Part" msgstr "Imaginaire deel" #: ../data/functions.xml.in.h:245 msgid "Index" msgstr "Index" #: ../data/functions.xml.in.h:246 msgid "Index variable" msgstr "Indexvariabele" #: ../data/functions.xml.in.h:247 msgid "Initial value" msgstr "Beginwaarde" #: ../data/functions.xml.in.h:248 msgid "Initial value of counter" msgstr "Beginwaarde van teller" #: ../data/functions.xml.in.h:249 msgid "Integers" msgstr "Gehele getallen" #: ../data/functions.xml.in.h:250 msgid "Integral point" msgstr "Gehele waarde" #: ../data/functions.xml.in.h:251 msgid "Integrate" msgstr "Integreren" #: ../data/functions.xml.in.h:252 msgid "Interest paid on a given period of an investment (ISPMT)" msgstr "Rente betaald over een gegeven investeringstermijn (ISPMT)" #: ../data/functions.xml.in.h:253 msgid "Interest rate" msgstr "Rentepercentage" #: ../data/functions.xml.in.h:254 msgid "Interest rate for a fully invested security" msgstr "" "Interestpercentage voor een waardepapier waarvan de hoofdsom aan het einde " "vrijvalt" #: ../data/functions.xml.in.h:255 msgid "Interquartile Range" msgstr "Interkwartiel bereik" #: ../data/functions.xml.in.h:256 msgid "Inverse Cosecant" msgstr "Inverse cosecans" #: ../data/functions.xml.in.h:257 msgid "Inverse Cosine" msgstr "Inverse cosinus" #: ../data/functions.xml.in.h:258 msgid "Inverse Cotangent" msgstr "Inverse cotangens" #: ../data/functions.xml.in.h:259 msgid "Inverse Hyperbolic Cosecant" msgstr "Inverse hyperbolische cosecans" #: ../data/functions.xml.in.h:260 msgid "Inverse Hyperbolic Cosine" msgstr "Inverse hyperbolische cosinus" #: ../data/functions.xml.in.h:261 msgid "Inverse Hyperbolic Cotangent" msgstr "Inverse hyperbolische cotangens" #: ../data/functions.xml.in.h:262 msgid "Inverse Hyperbolic Secant" msgstr "Inverse hyperbolische secans" #: ../data/functions.xml.in.h:263 msgid "Inverse Hyperbolic Sine" msgstr "Inverse hyperbolische sinus" #: ../data/functions.xml.in.h:264 msgid "Inverse Hyperbolic Tangent" msgstr "Inverse hyperbolische tangens" #: ../data/functions.xml.in.h:265 msgid "Inverse Secant" msgstr "Inverse secans" #: ../data/functions.xml.in.h:266 msgid "Inverse Sine" msgstr "Inverse sinus" #: ../data/functions.xml.in.h:267 msgid "Inverse Tangent" msgstr "Inverse tangens" #: ../data/functions.xml.in.h:268 msgid "Investment" msgstr "Investering" #: ../data/functions.xml.in.h:269 msgid "Is Integer" msgstr "Is een geheel getal" #: ../data/functions.xml.in.h:270 msgid "Is Number" msgstr "Is een getal" #: ../data/functions.xml.in.h:271 msgid "Is Rational" msgstr "Is een rationaal getal" #: ../data/functions.xml.in.h:272 msgid "Is Real" msgstr "Is een reëel getal" #: ../data/functions.xml.in.h:273 msgid "Issue date" msgstr "Uitgiftedatum" #: ../data/functions.xml.in.h:274 msgid "Kronecker Delta" msgstr "Kronecker Delta" #: ../data/functions.xml.in.h:275 msgid "Lambert W Function (Omega Function, Product Log)" msgstr "Lambert W Functie (Omega Functie, Product Log)" #: ../data/functions.xml.in.h:276 msgid "Last element" msgstr "Laatste element" #: ../data/functions.xml.in.h:277 msgid "Leading Coefficient" msgstr "Eerste coëfficiënt" #: ../data/functions.xml.in.h:278 msgid "Least Common Multiplier" msgstr "Kleinste gemene veelvoud" #: ../data/functions.xml.in.h:279 msgid "Length" msgstr "Lengte" #: ../data/functions.xml.in.h:280 msgid "Length of base" msgstr "Lengte van basis" #: ../data/functions.xml.in.h:281 msgid "Length of side" msgstr "Lengte van zijde" #: ../data/functions.xml.in.h:282 msgid "Length of string" msgstr "Lengte van karakterrij" #: ../data/functions.xml.in.h:283 msgid "Level-Coupon Bond" msgstr "Obligatie met gelijkblijvende coupons" #: ../data/functions.xml.in.h:284 msgid "Life" msgstr "Levensduur" #: ../data/functions.xml.in.h:285 msgid "Load CSV File" msgstr "Inlezen CSV-bestand" #: ../data/functions.xml.in.h:286 msgid "Local Date Format" msgstr "Lokale datumnotatie" #: ../data/functions.xml.in.h:287 msgid "Logical" msgstr "Logisch" #: ../data/functions.xml.in.h:288 msgid "Logical Exclusive OR" msgstr "Booleaanse XOR" #: ../data/functions.xml.in.h:289 msgid "Logistic Distribution" msgstr "Logistische verdeling" #: ../data/functions.xml.in.h:290 msgid "Logit Transformation" msgstr "Logit transformatie" #: ../data/functions.xml.in.h:291 msgid "Lower limit" msgstr "Ondergrens" #: ../data/functions.xml.in.h:292 msgid "Lower limit (i)" msgstr "Ondergrens (i)" #: ../data/functions.xml.in.h:293 msgid "Lowest Degree (Valuation)" msgstr "Laagste graad (waardebepaling)" #: ../data/functions.xml.in.h:294 msgid "Market interest rate" msgstr "Marktrente" #: ../data/functions.xml.in.h:295 msgid "Matrices & Vectors" msgstr "Matrices & vectoren" #: ../data/functions.xml.in.h:296 msgid "Matrix" msgstr "Matrix" #: ../data/functions.xml.in.h:297 msgid "Matrix Area" msgstr "Matrixbereik" #: ../data/functions.xml.in.h:298 msgid "Matrix Inverse" msgstr "Inverse matrix" #: ../data/functions.xml.in.h:299 msgid "Matrix or rows/columns" msgstr "Matrix of rijen/kolommen" #: ../data/functions.xml.in.h:300 msgid "Matrix or vector" msgstr "Matrix of vector" #: ../data/functions.xml.in.h:301 msgid "Matrix variable" msgstr "Matrixvariabele" #: ../data/functions.xml.in.h:302 msgid "Matrix/vector" msgstr "Matrix/vector" #: ../data/functions.xml.in.h:303 msgid "Maturity date" msgstr "Vervaldatum" #: ../data/functions.xml.in.h:304 msgid "Max" msgstr "Max" #: ../data/functions.xml.in.h:305 msgid "Mean" msgstr "Gemiddelde" #: ../data/functions.xml.in.h:306 msgid "Mean Deviation" msgstr "Gemiddelde afwijking" #: ../data/functions.xml.in.h:307 msgid "Means" msgstr "Gemiddelden" #: ../data/functions.xml.in.h:308 msgid "Median" msgstr "Mediaan" #: ../data/functions.xml.in.h:309 msgid "Merge Vectors" msgstr "Vectoren samenvoegen" #: ../data/functions.xml.in.h:310 msgid "Message" msgstr "Bericht" #: ../data/functions.xml.in.h:311 msgid "Microeconomics" msgstr "Microëconomie" #: ../data/functions.xml.in.h:312 msgid "Min" msgstr "Min" #: ../data/functions.xml.in.h:313 msgid "Miscellaneous" msgstr "Diversen" #: ../data/functions.xml.in.h:314 msgid "Mode" msgstr "Modus" #: ../data/functions.xml.in.h:315 msgid "Modulus" msgstr "Modulus" #: ../data/functions.xml.in.h:316 msgid "Moments" msgstr "Momenten" #: ../data/functions.xml.in.h:317 msgid "Month" msgstr "Maand" #: ../data/functions.xml.in.h:318 msgid "Months" msgstr "Maanden" #: ../data/functions.xml.in.h:319 msgid "Multifactorial" msgstr "Multifaculteit" #: ../data/functions.xml.in.h:320 msgid "Multiply" msgstr "Vermenigvuldigen" #: ../data/functions.xml.in.h:322 msgid "Natural Logarithm" msgstr "Natuurlijke logaritme" #: ../data/functions.xml.in.h:323 msgid "Negate" msgstr "Ander teken" #: ../data/functions.xml.in.h:324 msgid "New value" msgstr "Nieuwe waarde" #: ../data/functions.xml.in.h:325 msgid "Nominal Interest Rate" msgstr "Nominaal rentepercentage" #: ../data/functions.xml.in.h:326 msgid "Nominal interest rate" msgstr "Nominaal rentepercentage" #: ../data/functions.xml.in.h:327 msgid "Non-negative value" msgstr "Niet-negatieve waarde" #: ../data/functions.xml.in.h:328 msgid "Norm (length)" msgstr "Norm (lengte)" #: ../data/functions.xml.in.h:329 msgid "Nth root" msgstr "N-de wortel" #. A numerical value #: ../data/functions.xml.in.h:331 msgid "Number" msgstr "Nummer" #: ../data/functions.xml.in.h:332 msgid "Number Base" msgstr "Grondtal talstelsel" #: ../data/functions.xml.in.h:333 msgid "Number Bases" msgstr "Grondtallen voor talstelsels" #: ../data/functions.xml.in.h:334 msgid "Number Theory" msgstr "Getallentheorie" #: ../data/functions.xml.in.h:335 msgid "Number of Samples" msgstr "Aantal monsters" #: ../data/functions.xml.in.h:336 msgid "Number of coupons to be paid" msgstr "Aantal te betalen coupons" #: ../data/functions.xml.in.h:337 msgid "Number of elements" msgstr "Aantal elementen" #: ../data/functions.xml.in.h:338 msgid "Number of periods" msgstr "Aantal termijnen" #: ../data/functions.xml.in.h:339 msgid "Numerator" msgstr "Teller" #: ../data/functions.xml.in.h:340 msgid "Objects" msgstr "Objecten" #: ../data/functions.xml.in.h:341 msgid "Octal" msgstr "Octaal" #: ../data/functions.xml.in.h:342 msgid "Octal number" msgstr "Octaal getal" #: ../data/functions.xml.in.h:343 msgid "Odd" msgstr "Oneven" #: ../data/functions.xml.in.h:344 msgid "Order" msgstr "Orde" #: ../data/functions.xml.in.h:345 msgid "Original value" msgstr "Originele waarde" #: ../data/functions.xml.in.h:346 msgid "Paired T-Test" msgstr "Gepaarde t-proef" #: ../data/functions.xml.in.h:347 msgid "Par value" msgstr "Nominale waarde" #: ../data/functions.xml.in.h:348 msgid "Parallelogram" msgstr "Parallellogram" #: ../data/functions.xml.in.h:349 msgid "Parallelogram Area" msgstr "Oppervlak van parallellogram" #: ../data/functions.xml.in.h:350 msgid "Parallelogram Perimeter" msgstr "Omtrek van parallellogram" #: ../data/functions.xml.in.h:351 msgid "Pareto Distribution" msgstr "Paretoverdeling" #: ../data/functions.xml.in.h:352 msgid "Payment for a loan" msgstr "Betaling voor een lening" #: ../data/functions.xml.in.h:353 msgid "Payment made each period" msgstr "Termijnbetaling" #: ../data/functions.xml.in.h:354 msgid "Payment of an annuity going towards interest (IPMT)" msgstr "Interestdeel van een termijn van een annuïteit (IPMT)" #: ../data/functions.xml.in.h:355 msgid "Payment of an annuity going towards principal (PPMT)" msgstr "Aflossingsdeel van een termijn van een annuïteit (PPMT)" #: ../data/functions.xml.in.h:356 msgid "Pearson's Correlation Coefficient" msgstr "Pearson's correlatiecoëfficiënt" #: ../data/functions.xml.in.h:357 msgid "Percentile" msgstr "Percentiel" #: ../data/functions.xml.in.h:359 #, no-c-format msgid "Percentile (%)" msgstr "Percentiel (%)" #: ../data/functions.xml.in.h:360 msgid "Period" msgstr "Termijn" #: ../data/functions.xml.in.h:361 msgid "Periodic interest rate" msgstr "Periodiek rentepercentage" #: ../data/functions.xml.in.h:362 msgid "Periods" msgstr "Termijnen" #: ../data/functions.xml.in.h:363 msgid "Periods for investment to attain desired value" msgstr "Termijnen waarin een investering de gewenste waarde bereikt" #: ../data/functions.xml.in.h:364 msgid "Periods of an investment" msgstr "Termijnen van een investering" #: ../data/functions.xml.in.h:365 msgid "Periods per year" msgstr "Termijnen per jaar" #: ../data/functions.xml.in.h:366 msgid "Permanent" msgstr "Permanent" #: ../data/functions.xml.in.h:367 msgid "Permutations (Variations)" msgstr "Permutaties (Variaties)" #: ../data/functions.xml.in.h:368 msgid "Polynomial" msgstr "Polynoom (veelterm)" #: ../data/functions.xml.in.h:369 msgid "Polynomial Degree" msgstr "Graad van polynoom (veelterm)" #: ../data/functions.xml.in.h:370 msgid "Polynomials" msgstr "Polynomen (veeltermen)" #: ../data/functions.xml.in.h:371 msgid "Pooled Variance" msgstr "Pooled variantie" #: ../data/functions.xml.in.h:372 msgid "Precalculate expression" msgstr "Voorbereken expressie" #: ../data/functions.xml.in.h:373 msgid "Present Value" msgstr "Huidige waarde" #: ../data/functions.xml.in.h:374 msgid "Present value" msgstr "Huidige waarde" #: ../data/functions.xml.in.h:375 msgid "Price" msgstr "Prijs" #: ../data/functions.xml.in.h:376 msgid "Price per $100 face value" msgstr "Prijs per €100 nominale waarde" #: ../data/functions.xml.in.h:377 msgid "Price per $100 face value of a security" msgstr "Prijs per €100 nominale waarde van een waardepapier" #: ../data/functions.xml.in.h:378 msgid "Price per $100 face value of a security bond" msgstr "Prijs per €100 nominale waarde van een obligatie" #: ../data/functions.xml.in.h:379 msgid "Price variable" msgstr "Prijsvariabele" #: ../data/functions.xml.in.h:380 msgid "Primitive Part" msgstr "Primitieve deel" #: ../data/functions.xml.in.h:381 msgid "Principal" msgstr "Hoofdsom" #: ../data/functions.xml.in.h:382 msgid "Prism" msgstr "Prisma" #: ../data/functions.xml.in.h:383 msgid "Process Matrix Elements" msgstr "Matrix-elementen verwerken" #: ../data/functions.xml.in.h:384 msgid "Process Vector Elements" msgstr "Vector-elementen verwerken" #: ../data/functions.xml.in.h:385 msgid "Producer Surplus" msgstr "Producentenoverschot" #: ../data/functions.xml.in.h:386 msgid "Product" msgstr "Product" #: ../data/functions.xml.in.h:387 msgid "Puts each element of a matrix in vertical order in a vector." msgstr "" "Ieder element van een matrix wordt in verticale volgorde in een vector " "geplaatst." #: ../data/functions.xml.in.h:388 msgid "Pyramid" msgstr "Piramide" #: ../data/functions.xml.in.h:389 msgid "Pyramid Volume" msgstr "Volume van piramide" #: ../data/functions.xml.in.h:390 msgid "Quadratic Mean (RMS)" msgstr "Kwadratisch gemiddelde (RMS)" #: ../data/functions.xml.in.h:391 msgid "Quantity variabel" msgstr "Hoeveelheidvariabele" #: ../data/functions.xml.in.h:392 msgid "Quartile" msgstr "Kwartiel" #: ../data/functions.xml.in.h:393 msgid "RPN Stack Register" msgstr "RPN-register in stapelgeheugen" #: ../data/functions.xml.in.h:394 msgid "RPN Stack Vector" msgstr "RPN-vector in stapelgeheugen" #: ../data/functions.xml.in.h:395 msgid "Radians" msgstr "Radialen" #: ../data/functions.xml.in.h:396 msgid "Radians to Default Angle Unit" msgstr "Radialen naar standaard hoekeenheid" #: ../data/functions.xml.in.h:397 msgid "Radius" msgstr "Straal" #: ../data/functions.xml.in.h:398 msgid "Raise" msgstr "Machtverheffen" #: ../data/functions.xml.in.h:399 msgid "Ramp Function" msgstr "Rampfunctie" #: ../data/functions.xml.in.h:400 msgid "Random Number" msgstr "Willekeurig getal" #: ../data/functions.xml.in.h:401 msgid "Random Number Between Limits" msgstr "Willekeurig getal tussen twee grenswaarden" #: ../data/functions.xml.in.h:402 msgid "Range" msgstr "Bereik" #: ../data/functions.xml.in.h:403 msgid "Rank" msgstr "Rangorde" #: ../data/functions.xml.in.h:404 msgid "Rate" msgstr "Rate" #: ../data/functions.xml.in.h:405 msgid "Rayleigh Distribution" msgstr "Rayleigh-verdeling" #: ../data/functions.xml.in.h:406 msgid "Rayleigh Tail Distribution" msgstr "Rayleigh-staartverdeling" #: ../data/functions.xml.in.h:407 msgid "Real Part" msgstr "Reële deel" #: ../data/functions.xml.in.h:408 msgid "Reciprocal" msgstr "Omgekeerde waarde (x naar 1/x)" #: ../data/functions.xml.in.h:409 msgid "Rectangle" msgstr "Rechthoek" #: ../data/functions.xml.in.h:410 msgid "Rectangle Area" msgstr "Oppervlak rechthoek" #: ../data/functions.xml.in.h:411 msgid "Rectangle Perimeter" msgstr "Omtrek rechthoek" #: ../data/functions.xml.in.h:412 msgid "Rectangular Function" msgstr "Rechthoekige functie" #: ../data/functions.xml.in.h:413 msgid "Redemption" msgstr "Aflossing" #: ../data/functions.xml.in.h:414 msgid "Regression" msgstr "Regressie" #: ../data/functions.xml.in.h:415 msgid "Remainder" msgstr "Rest" #: ../data/functions.xml.in.h:416 msgid "" "Removes all units from an expression. The expression is calculated before " "the removal." msgstr "" "Verwijdert alle eenheden uit een expressie. De expressie wordt hierbij eerst " "berekend." #: ../data/functions.xml.in.h:417 msgid "Replace" msgstr "Vervangen" #: ../data/functions.xml.in.h:418 msgid "" "Replaces a certain value in an expression with a new value. The expression " "is calculated before the replacement if the fourth argument is true." msgstr "" "Vervangt een waarde in een expressie door een nieuwe waarde. Eerst wordt de " "expressie berekend indien het vierde argument waar (true) is." #: ../data/functions.xml.in.h:419 msgid "Represents Integer" msgstr "Geeft een geheel getal weer" #: ../data/functions.xml.in.h:420 msgid "Represents Number" msgstr "Geeft een getal weer" #: ../data/functions.xml.in.h:421 msgid "Represents Rational" msgstr "Geeft een rationaal getal weer" #: ../data/functions.xml.in.h:422 msgid "Represents Real" msgstr "Geeft een reëel getal weer" #: ../data/functions.xml.in.h:423 msgid "Return on continuously compounded interest" msgstr "Opbrengst van continu samengestelde rente" #: ../data/functions.xml.in.h:424 msgid "Returns 0 if i != j and 1 if i = j." msgstr "Retourneert 0 indien i != j en 1 if i = j." #: ../data/functions.xml.in.h:425 msgid "Returns a column in a matrix as a vector." msgstr "Retourneert een kolom van een matrix als een vector." #: ../data/functions.xml.in.h:426 msgid "Returns a matrix imported from a CSV data file." msgstr "Retourneert een matrix, geïmporteerd uit een CSV-gegevensbestand." #: ../data/functions.xml.in.h:427 msgid "" "Returns a matrix with specified dimensions and listed elements. Omitted " "elements are set to zero." msgstr "" "Retourneert een matrix met opgegeven dimensies en gegeven elementen. " "Weggelaten elementen worden op nul gesteld." #: ../data/functions.xml.in.h:428 msgid "Returns a part of a matrix." msgstr "Retourneert een deel van een matrix." #: ../data/functions.xml.in.h:429 msgid "Returns a part of a vector between two positions." msgstr "Retourneert een deel van een vector tussen twee posities." #: ../data/functions.xml.in.h:430 msgid "Returns a row in a matrix as a vector." msgstr "Retourneert een rij in een matrix als een vector." #: ../data/functions.xml.in.h:431 msgid "Returns a sorted vector. ex. sort([6, 1, 4])=[1, 4, 6]" msgstr "" "Retourneert een gesorteerde vector. bv. sort([6, 1, 4])=[1, 4, 6]" #: ../data/functions.xml.in.h:432 msgid "Returns a value from a hexadecimal number" msgstr "Converteert een hexadecimaal getal naar een getal" #: ../data/functions.xml.in.h:433 msgid "" "Returns a vector generated from a function with a variable (default x) " "running from min to max. The fourth argument is either the requested number " "of elements if the sixth argument is false (default) or the step between " "each value of the variable." msgstr "" "Berekent een vector met behulp van een functie waarvan de variabele " "(standaard x) waarden krijgt tussen min en max. Het vierde argument is of " "het vereiste aantal elementen indien het zesde argument onwaar is " "(standaard) of de stapgrootte tussen elke waarde van de variabele." #: ../data/functions.xml.in.h:434 msgid "Returns a vector with listed elements." msgstr "Retourneert een vector met de opgegeven elementen." #: ../data/functions.xml.in.h:435 msgid "Returns a vector with the elements from two vectors." msgstr "Retourneert een vector met de elementen van twee vectoren." #: ../data/functions.xml.in.h:436 msgid "" "Returns a vector with values of elements replaced with their mutual ranks." " ex. rank([6, 1, 4]) = [3, 1, 2]" msgstr "" "Retourneert een vector waarin de elementen zijn vervangen door hun " "onderlinge rangorde. bv. rank([6, 1, 4]) = [3, 1, 2] (6 staat op de " "3de plaats in de gesorteerde vector, 1 op de 1ste en 4 op de 2de plaats)" #: ../data/functions.xml.in.h:437 msgid "" "Returns accrued interest for a security which pays periodic interest. " " Allowed frequencies are 1 - annual, 2 - semi-annual or 4 - quarterly. " "Basis is the type of day counting you want to use: 0: US 30/360 (default), " "1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Berekent de aangegroeide rente voor een waardepapier met een periodieke " "rente-uitkering. Mogelijke frequenties zijn 1 - jaarlijks, 2 - " "halfjaarlijks of 4 - per kwartaal. Basis is de dagtelling die u wilt " "gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke " "dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360." #: ../data/functions.xml.in.h:438 msgid "Returns an integer between (including) bottom and top." msgstr "Retourneert een geheel getal tussen onder- en bovengrens (inclusief)." #: ../data/functions.xml.in.h:439 msgid "Returns an integer from a binary number" msgstr "Converteert een binair getal naar een geheel getal" #: ../data/functions.xml.in.h:440 msgid "Returns an integer from a number of specified base between 2 and 36" msgstr "" "Converteert een getal in een opgegeven basis tussen 2 en 36 naar een geheel " "getal" #: ../data/functions.xml.in.h:441 msgid "Returns an integer from an octal number" msgstr "Converteert een octaal getal naar een geheel getal" #: ../data/functions.xml.in.h:442 msgid "Returns the RPN stack as a vector." msgstr "Retourneert de inhoud van het RPN-stapelgeheugen als een vector." #: ../data/functions.xml.in.h:443 msgid "" "Returns the accrued interest for a security which pays interest at maturity " "date. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" "Berekent de aangegroeide rente voor een waardepapier waarvan de rente wordt " "uitgekeerd na de afloopdatum. Basis is de dagtelling die u wilt " "gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke " "dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360." #: ../data/functions.xml.in.h:444 msgid "" "Returns the amount of payment for a loan based on a constant interest rate " "and constant payments (each payment is equal amount). If type = 1 " "then the payment is made at the beginning of the period, If type = 0 (or " "omitted) it is made at the end of each period." msgstr "" "Berekent het te betalen bedrag voor een lening gebaseerd op een vast " "rentepercentage en gelijkblijvende betalingen (elke keer moet hetzelfde " "bedrag worden betaald). Indien type = 1 moet er aan het begin van " "de termijn worden betaald, Indien type = 0 (ofweggelaten) aan het einde van " "elke termijn." #: ../data/functions.xml.in.h:445 msgid "" "Returns the amount received at the maturity date for an invested security." " Basis is the type of day counting you want to use: 0: US 30/360 " "(default), 1: real days, 2: real days/360, 3: real days/365 or 4: European " "30/360. The settlement date must be before maturity date." msgstr "" "Berekent het te ontvangen bedrag na de afloopdatum van een " "investeringswaardepapier. Basis is de dagtelling die u wilt " "gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke " "dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. De afwikkeling " "moet plaats vinden voor de afloopdatum." #: ../data/functions.xml.in.h:446 msgid "Returns the base n logarithm." msgstr "Retourneert de logaritme met grondtal n." #: ../data/functions.xml.in.h:447 msgid "Returns the bond equivalent for a treasury bill." msgstr "" "Berekent het obligatie-equivalent voor een kortlopende overheidsobligatie " "zonder coupons." #: ../data/functions.xml.in.h:448 msgid "" "Returns the discount rate for a security. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Berekent het rentepercentage voor een waardepapier. Basis is de " "dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke " "dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees " "30/360." #: ../data/functions.xml.in.h:449 msgid "" "Returns the element at specified position in a matrix (row and column) or " "vector (index)." msgstr "" "Retourneert het element op de opgegeven positie in een matrix (rij en kolom) " "of vector (index)." #: ../data/functions.xml.in.h:450 msgid "Returns the highest value." msgstr "Retourneert de grootste waarde." #: ../data/functions.xml.in.h:451 msgid "" "Returns the identity matrix of a matrix or with specified number of rows/" "columns." msgstr "" "Retourneert de eenheidsmatrix bij een matrix of met een opgegeven aantal " "rijen/kolommen." #: ../data/functions.xml.in.h:452 msgid "" "Returns the interest rate for a fully invested security. Basis is " "the type of day counting you want to use: 0: US 30/360 (default), 1: real " "days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Berekent het rentepercentage voor een volledig geïnvesteerd waardepapier. " " Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 " "(standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke " "dagen/365 of 4: Europees 30/360." #: ../data/functions.xml.in.h:453 msgid "Returns the inverse function for mx*e^x as ln() does for e^x." msgstr "" "Retourneert de inverse functie van mx*e^x (zoals ln(x) de inverse functie is " "van e^x)." #: ../data/functions.xml.in.h:454 msgid "Returns the lowest value." msgstr "Retourneert de kleinste waarde." #: ../data/functions.xml.in.h:455 msgid "Returns the most frequently occuring value." msgstr "Retourneert de meest voorkomende waarde." #: ../data/functions.xml.in.h:456 msgid "Returns the non-negative square root of x * pi" msgstr "Retourneert de niet-negatieve vierkantswortel van x * pi" #: ../data/functions.xml.in.h:457 msgid "Returns the number of columns in a matrix." msgstr "Retourneert het aantal kolommen in een matrix." #: ../data/functions.xml.in.h:458 msgid "" "Returns the number of coupons to be paid between the settlement and the " "maturity. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" "berekent het aantal te betalen coupons tussen afwikkeling en de afloopdatum. " " Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 " "(standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke " "dagen/365 of 4: Europees 30/360." #: ../data/functions.xml.in.h:459 msgid "" "Returns the number of days between two dates. Basis is the type of " "day counting you want to use: 0: US 30/360, 1: real days (default), 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Retourneert het aantal dagen tussen twee data. Basis is de " "dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke " "dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees " "30/360." #: ../data/functions.xml.in.h:460 msgid "Returns the number of elements in a matrix or vector." msgstr "Retourneert het aantal elementen in een matrix of vector." #: ../data/functions.xml.in.h:461 msgid "Returns the number of elements in a vector." msgstr "Retourneert het aantal elementen in een vector." #: ../data/functions.xml.in.h:462 msgid "" "Returns the number of periods needed for an investment to attain a desired " "value." msgstr "" "Retourneert het aantal benodigde termijnen waarna een investering een " "gewenste waarde bereikt." #: ../data/functions.xml.in.h:463 msgid "" "Returns the number of possible arrangements of an ordered list with a number " "of objects to choose from and a list size. If there are three objects (1, 2 " "and 3) that is put in a list with two positions, the alternatives are [1, " "2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2], and thus the number of " "permutations is 6." msgstr "" "Retourneert op hoeveel manieren een bepaald aantal objecten op een geordende " "manier kunnen worden gekozen uit een verzameling van (verschillende) " "objecten. Stel er zijn drie objecten (1, 2, en 3) waarvan er twee moeten " "worden gekozen in een geordende lijst, dan zijn de mogelijkheden [1, 2], [2, " "1], [1, 3], [3, 1], [2, 3] en [3, 2], en is het aantal permutaties dus 6." #: ../data/functions.xml.in.h:464 msgid "" "Returns the number of possible arrangements of an unordered list with a " "number of objects to choose from and a list size. If there are three objects " "(1, 2 and 3) that is put in a list with place for two, the alternatives are " "[1, 2], [1, 3], and [2, 3], and thus the number of combinations is 3." msgstr "" "Retourneert op hoeveel manieren een bepaald aantal objecten op een niet " "geordende manier kunnen worden gekozen uit een verzameling van " "(verschillende) objecten. Stel er zijn drie objecten (1, 2, en 3) waarvan er " "twee moeten worden gekozen in een niet geordende lijst, dan zijn de " "mogelijkheden [1, 2], [1, 3] en [2, 3], en is het aantal combinaties dus 6." #: ../data/functions.xml.in.h:465 msgid "" "Returns the number of possible rearrangements of an ordered list, of a " "certain size, where none of the objects are on their original position. If " "the original list is [1, 2, 3], the possible derangements is [2, 3, 1] and " "[3, 1, 2], and thus the number of derangements is 2." msgstr "" "Retourneert op hoeveel manieren een geordende lijst van objecten zo kan " "worden herschikt dat geen der objecten op zijn oorspronkelijke posite " "terecht komt. Indien de oorspronkelijke lijst [1, 2, 3] is, zijn de " "mogelijke herschikkingen [2, 3, 1] en [3, 1, 2], en is het aantal mogelijke " "herschikkingen dus 2." #: ../data/functions.xml.in.h:466 msgid "Returns the number of rows in a matrix." msgstr "Retourneert het aantal rijen in een matrix." #: ../data/functions.xml.in.h:467 msgid "Returns the number of samples." msgstr "Retourneert het aantal monsters." #: ../data/functions.xml.in.h:468 msgid "" "Returns the number of years (fractional) between two dates. Basis " "is the type of day counting you want to use: 0: US 30/360, 1: real days " "(default), 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Retourneert het aantal jaren (niet noodzakelijk geheel) tussen twee data. " " Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 " "(standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke " "dagen/365 of 4: Europees 30/360." #: ../data/functions.xml.in.h:469 msgid "" "Returns the present value of an investment. If type = 1 then the " "payment is made at the beginning of the period, If type = 0 (or omitted) it " "is made at the end of each period." msgstr "" "Berekent de huidige waarde van een investering. Indien type = 1 is " "de uitbetaling aan het begin van de termijn, indien type = 0 (of weggelaten) " "aan het einde van elke termijn." #: ../data/functions.xml.in.h:470 msgid "Returns the price per $100 value for a treasury bill." msgstr "" "Berekent de prijs per € 100 voor een kortlopende overheidsobligatie zonder " "coupons." #: ../data/functions.xml.in.h:471 msgid "" "Returns the probability density p(x) at x for a Pareto distribution with " "exponent and scale. (from Gnumeric)" msgstr "" "Retourneert de kansdichtheid p(x) in x voor een Pareto-verdeling met " "exponent en schaal. (van Gnumeric)" #: ../data/functions.xml.in.h:472 msgid "" "Returns the probability density p(x) at x for a Rayleigh distribution with " "scale parameter sigma. (from Gnumeric)" msgstr "" "Retourneert de kansdichtheid p(x) in x voor een Rayleigh-verdeling met " "schaalparameter sigma. (van Gnumeric)" #: ../data/functions.xml.in.h:473 msgid "" "Returns the probability density p(x) at x for a Rayleigh tail distribution " "with scale parameter sigma and a lower limit. (from Gnumeric)" msgstr "" "Retourneert de kansdichtheid p(x) in x voor een Rayleigh-staartverdeling met " "schaalparameter sigma en een ondergrens. (van Gnumeric)" #: ../data/functions.xml.in.h:474 msgid "" "Returns the probability density p(x) at x for a logistic distribution with " "scale parameter. (from Gnumeric)" msgstr "" "Retourneert de kansdichtheid p(x) in x voor een logistische verdeling met " "schaalparameter. (van Gnumeric)" #: ../data/functions.xml.in.h:475 msgid "Returns the transpose of a matrix." msgstr "Retourneert de getransponeerde van een matrix." #: ../data/functions.xml.in.h:476 msgid "Returns the value of a RPN stack register." msgstr "Retourneert de waarde in een register van het RPN-stapelgeheugen." #: ../data/functions.xml.in.h:477 msgid "Returns the value of a roman number." msgstr "Retourneert de waarde van een Romeins getal." #: ../data/functions.xml.in.h:478 msgid "" "Returns the value of an investment, given the principal, nominal interest " "rate, compounding frequency and time." msgstr "" "Berekent de waarde van een investering, gegeven de hoofdsom, nominale rente, " "samenstellingsfrequentie en tijdsduur." #: ../data/functions.xml.in.h:479 msgid "Returns the yield for a treasury bill." msgstr "" "Berekent de opbrengst van een kortlopende overheidsobligatie zonder coupons." #: ../data/functions.xml.in.h:480 msgid "Riemann Zeta" msgstr "Riemann Zeta" #: ../data/functions.xml.in.h:481 msgid "Roman Number" msgstr "Romeins getal" #: ../data/functions.xml.in.h:482 msgid "Roman number" msgstr "Romeins getal" #: ../data/functions.xml.in.h:483 msgid "Round" msgstr "Afronden" #: ../data/functions.xml.in.h:484 msgid "Round Downwards" msgstr "Naar beneden afronden" #: ../data/functions.xml.in.h:485 msgid "Round Towards Zero" msgstr "Afronden in de richting van nul" #: ../data/functions.xml.in.h:486 msgid "Round Upwards" msgstr "Naar boven afronden" #: ../data/functions.xml.in.h:487 msgid "Rounding" msgstr "Afronding" #: ../data/functions.xml.in.h:488 msgid "Row" msgstr "Rij" #: ../data/functions.xml.in.h:489 msgid "Row variable" msgstr "Rijvariabele" #: ../data/functions.xml.in.h:490 msgid "Row/index" msgstr "Rij/Index" #: ../data/functions.xml.in.h:491 msgid "Rows" msgstr "Rijen" #: ../data/functions.xml.in.h:492 msgid "Salvage value" msgstr "Restwaarde" #: ../data/functions.xml.in.h:493 msgid "Save as Variable" msgstr "Opslaan als variabele" #: ../data/functions.xml.in.h:494 msgid "Scale" msgstr "Schaal" #: ../data/functions.xml.in.h:495 msgid "Secant" msgstr "Secans" #: ../data/functions.xml.in.h:496 msgid "Second date" msgstr "Tweede datum" #: ../data/functions.xml.in.h:497 msgid "Select Vector Elements" msgstr "Vectorelementen selecteren" #: ../data/functions.xml.in.h:498 msgid "Select first match" msgstr "Eerste overeenkomst secteren" #: ../data/functions.xml.in.h:499 msgid "Separator" msgstr "Scheidingsteken" #: ../data/functions.xml.in.h:500 msgid "Settlement date" msgstr "Afwikkeldatum" #: ../data/functions.xml.in.h:501 msgid "Side A" msgstr "Zijde A" #: ../data/functions.xml.in.h:502 msgid "Side B" msgstr "Zijde B" #: ../data/functions.xml.in.h:503 msgid "Sigma" msgstr "Sigma" #: ../data/functions.xml.in.h:504 msgid "Sigmoid Function" msgstr "Sigmoïde functie" #: ../data/functions.xml.in.h:505 msgid "Signum" msgstr "Signum" #: ../data/functions.xml.in.h:506 msgid "Sine" msgstr "Sinus" #: ../data/functions.xml.in.h:507 msgid "Size" msgstr "Grootte" #: ../data/functions.xml.in.h:508 msgid "Solve equation" msgstr "Vergelijking oplossen" #: ../data/functions.xml.in.h:509 msgid "Solve for multiple variables" msgstr "Oplossen voor meerdere variabelen" #: ../data/functions.xml.in.h:510 msgid "Solve for two variables" msgstr "Oplossen voor twee variabelen" #: ../data/functions.xml.in.h:511 msgid "" "Solves two equations with two unknown variables. Returns the value of the " "first variable." msgstr "" "Lost twee vergelijkingen op in twee variabelen. Retourneert de waarde van de " "eerste variabele." #: ../data/functions.xml.in.h:512 msgid "Sort" msgstr "Sorteren" #: ../data/functions.xml.in.h:513 msgid "Spearman's Rho" msgstr "Spearman's Rho" #: ../data/functions.xml.in.h:514 msgid "Sphere" msgstr "Bol" #: ../data/functions.xml.in.h:515 msgid "Sphere Volume" msgstr "Volume van bol" #: ../data/functions.xml.in.h:516 msgid "Square" msgstr "Vierkant" #: ../data/functions.xml.in.h:517 msgid "Square Area" msgstr "Oppervlakte van vierkant" #: ../data/functions.xml.in.h:518 msgid "Square Perimeter" msgstr "Omtrek van vierkant" #: ../data/functions.xml.in.h:519 msgid "Square Root" msgstr "Vierkantswortel" #: ../data/functions.xml.in.h:520 msgid "Square root (x * pi)" msgstr "Vierkantswortel (x * pi)" #: ../data/functions.xml.in.h:521 msgid "Standard Date Format" msgstr "Standaardnotatie voor datum" #: ../data/functions.xml.in.h:522 msgid "Standard Deviation (entire population)" msgstr "Standaarddeviatie (gehele populatie)" #: ../data/functions.xml.in.h:523 msgid "Standard Deviation (random sampling)" msgstr "Standaarddeviatie (willekeurige steekproef)" #: ../data/functions.xml.in.h:524 msgid "Standard Error" msgstr "Standaardfout" #: ../data/functions.xml.in.h:525 msgid "Start column" msgstr "Startkolom" #: ../data/functions.xml.in.h:526 msgid "Start row" msgstr "Startrij" #: ../data/functions.xml.in.h:527 msgid "Statistical Correlation" msgstr "Statistische correlatie" #: ../data/functions.xml.in.h:528 msgid "Statistical Tests" msgstr "Statistische testen" #: ../data/functions.xml.in.h:529 msgid "Statistics" msgstr "Statistiek" #: ../data/functions.xml.in.h:530 msgid "Step Functions" msgstr "Stapfuncties" #: ../data/functions.xml.in.h:531 msgid "Straight Line Depreciation" msgstr "Gelijkblijvende afschrijving" #: ../data/functions.xml.in.h:532 msgid "Strip Units" msgstr "Eenheden verwijderen" #: ../data/functions.xml.in.h:533 msgid "Subtract" msgstr "Aftrekken" #: ../data/functions.xml.in.h:534 msgid "Sum" msgstr "Som" #: ../data/functions.xml.in.h:535 msgid "Sum (total)" msgstr "Som (totaal)" #: ../data/functions.xml.in.h:536 msgid "Sum-of-Years Digits Depreciation" msgstr "Afschrijving volgens som der jaren" #: ../data/functions.xml.in.h:537 msgid "Superfactorial" msgstr "Superfaculteit" #: ../data/functions.xml.in.h:538 msgid "Supply function" msgstr "Aanbodfunctie" #: ../data/functions.xml.in.h:539 msgid "Supply function or price" msgstr "Aanbodfunctie of prijs" #: ../data/functions.xml.in.h:540 msgid "Surface Area of Cone" msgstr "Oppervlaktegrootte van kegel" #: ../data/functions.xml.in.h:541 msgid "Surface Area of Cube" msgstr "Oppervlaktegrootte van kubus" #: ../data/functions.xml.in.h:542 msgid "Surface Area of Cylinder" msgstr "Oppervlaktegrootte van cilinder" #: ../data/functions.xml.in.h:543 msgid "Surface Area of Rectangular Prism" msgstr "Oppervlaktegrootte van rechthoekig prisma" #: ../data/functions.xml.in.h:544 msgid "Surface Area of Regular Tetrahedron" msgstr "Oppervlaktegrootte van regelmatig viervlak (tetraëder)" #: ../data/functions.xml.in.h:545 msgid "Surface Area of Sphere" msgstr "Oppervlaktegrootte van bol" #: ../data/functions.xml.in.h:546 msgid "Surface Area of Square Pyramid" msgstr "Oppervlaktegrootte van vierkante piramide" #: ../data/functions.xml.in.h:547 msgid "Tangent" msgstr "Tangens" #: ../data/functions.xml.in.h:548 msgid "Term expression" msgstr "Expressie voor term" #: ../data/functions.xml.in.h:549 msgid "Terms" msgstr "Termen" #: ../data/functions.xml.in.h:550 msgid "Tests a condition and returns a value depending on the result." msgstr "" "Test een conditie en retourneert een waarde afhankelijk van het resultaat." #: ../data/functions.xml.in.h:551 msgid "Text" msgstr "Tekst" #: ../data/functions.xml.in.h:552 msgid "Text string 1" msgstr "Tekstrij 1" #: ../data/functions.xml.in.h:553 msgid "Text string 2" msgstr "Tekstrij 2" #: ../data/functions.xml.in.h:554 ../data/units.xml.in.h:311 msgid "Time" msgstr "Tijd" #: ../data/functions.xml.in.h:555 msgid "Timestamp" msgstr "Timestamp" #: ../data/functions.xml.in.h:556 msgid "Title" msgstr "Titel" #: ../data/functions.xml.in.h:557 msgid "Top" msgstr "Boven" #: ../data/functions.xml.in.h:558 msgid "Trailing Coefficient" msgstr "Laatste coëfficiënt" #: ../data/functions.xml.in.h:559 msgid "Transpose" msgstr "Transponeren" #: ../data/functions.xml.in.h:560 msgid "Trapezoid" msgstr "Trapezium" #: ../data/functions.xml.in.h:561 msgid "Trapezoid Area" msgstr "Oppervlakte van trapezium" #: ../data/functions.xml.in.h:562 msgid "Treasury Bill Equivalent" msgstr "Equivalent van kortlopende overheidsobligatie zonder coupons" #: ../data/functions.xml.in.h:563 msgid "Treasury Bill Price" msgstr "Prijs kortlopende overheidsobligatie zonder coupons" #: ../data/functions.xml.in.h:564 msgid "Treasury Bill Yield" msgstr "Opbrengst kortlopende overheidsobligatie zonder coupons" #: ../data/functions.xml.in.h:565 msgid "Triangle" msgstr "Driehoek" #: ../data/functions.xml.in.h:566 msgid "Triangle Area" msgstr "Oppervlakte van driehoek" #: ../data/functions.xml.in.h:567 msgid "Triangle Perimeter" msgstr "Omtrek van driehoek" #: ../data/functions.xml.in.h:568 msgid "Triangular Function" msgstr "Driehoekige functie" #: ../data/functions.xml.in.h:569 msgid "Trigonometry" msgstr "Goniometrie" #: ../data/functions.xml.in.h:570 msgid "Trimmed Mean" msgstr "Getrimd gemiddelde" #: ../data/functions.xml.in.h:571 msgid "Trimmed percentage (at each end)" msgstr "Getrimd percentage (aan beide kanten)" #: ../data/functions.xml.in.h:572 msgid "Type" msgstr "Type" #: ../data/functions.xml.in.h:573 msgid "Unit Part" msgstr "Eenheidsgedeelte" #: ../data/functions.xml.in.h:574 msgid "Unix Timestamp to Date" msgstr "Unix Timestamp naar datum" #: ../data/functions.xml.in.h:575 msgid "Unpaired T-Test" msgstr "Ongepaarde T-proef" #: ../data/functions.xml.in.h:576 msgid "Upper limit" msgstr "Bovengrens" #: ../data/functions.xml.in.h:577 msgid "Upper limit (n)" msgstr "Bovengrens (n)" #: ../data/functions.xml.in.h:578 msgid "Use step size" msgstr "Stapgrootte gebruiken" #: ../data/functions.xml.in.h:579 msgid "Utilities" msgstr "Hulpmiddelen" #: ../data/functions.xml.in.h:580 msgid "Value" msgstr "Waarde" #: ../data/functions.xml.in.h:581 msgid "Value 1" msgstr "Waarde 1" #: ../data/functions.xml.in.h:582 msgid "Value 1 (i)" msgstr "Waarde 1 (i)" #: ../data/functions.xml.in.h:583 msgid "Value 2" msgstr "Waarde 2" #: ../data/functions.xml.in.h:584 msgid "Value 2 (j)" msgstr "Waarde 2 (j)" #: ../data/functions.xml.in.h:585 msgid "Value variable" msgstr "Waarde variabele" #: ../data/functions.xml.in.h:586 msgid "Variable" msgstr "Variabele" #: ../data/functions.xml.in.h:587 msgid "Variable 1" msgstr "Variabele 1" #: ../data/functions.xml.in.h:588 msgid "Variable 2" msgstr "Variabele 2" #: ../data/functions.xml.in.h:589 msgid "Variable of integration" msgstr "Integratievariabele" #: ../data/functions.xml.in.h:590 msgid "Variable vector" msgstr "Variabele vector" #: ../data/functions.xml.in.h:591 msgid "Variance (entire population)" msgstr "Variantie (gehele populatie)" #: ../data/functions.xml.in.h:592 msgid "Variance (random sampling)" msgstr "Variantie (willekeurige steekproef)" #: ../data/functions.xml.in.h:593 msgid "Vector" msgstr "Vector" #: ../data/functions.xml.in.h:594 msgid "Vector 1" msgstr "Vector 1" #: ../data/functions.xml.in.h:595 msgid "Vector 2" msgstr "Vector 2" #: ../data/functions.xml.in.h:596 msgid "Vector Limits" msgstr "Vectorgrenzen" #: ../data/functions.xml.in.h:597 msgid "Vector variable" msgstr "Vectorvariabele" #: ../data/functions.xml.in.h:598 msgid "Volume of Rectangular Prism" msgstr "Inhoud van rechthoekig prisma" #: ../data/functions.xml.in.h:599 msgid "Volume of Regular Tetrahedron" msgstr "Inhoud van regelmatig viervlak (tetraëder)" #: ../data/functions.xml.in.h:600 msgid "Volume of Square Pyramid" msgstr "Inhoud van vierkant prisma" #: ../data/functions.xml.in.h:601 msgid "Volume of Triangular Prism" msgstr "Inhoud van driehoekig prisma" #: ../data/functions.xml.in.h:602 msgid "Week begins on Sunday" msgstr "Week begint op zondag" #: ../data/functions.xml.in.h:603 msgid "Week of Year" msgstr "Week van het jaar" #: ../data/functions.xml.in.h:605 msgid "Weighted Mean" msgstr "Gewogen gemiddelde" #: ../data/functions.xml.in.h:606 msgid "Weights" msgstr "Gewichten" #: ../data/functions.xml.in.h:607 msgid "Width" msgstr "Breedte" #: ../data/functions.xml.in.h:608 msgid "Width of base" msgstr "Basislengte" #: ../data/functions.xml.in.h:609 msgid "Winsorized Mean" msgstr "Gewinsoriseerd gemiddelde" #: ../data/functions.xml.in.h:610 msgid "Winsorized percentage (at each end)" msgstr "Gewinsoriseerd percentage (aan beide kanten)" #: ../data/functions.xml.in.h:611 msgid "With respect to" msgstr "Met betrekking tot" #: ../data/functions.xml.in.h:612 msgid "X" msgstr "X" #: ../data/functions.xml.in.h:613 msgid "X raised to the power Y" msgstr "X tot de macht Y" #: ../data/functions.xml.in.h:614 msgid "Year" msgstr "Jaar" #: ../data/functions.xml.in.h:615 msgid "Years" msgstr "Jaren" #: ../data/functions.xml.in.h:616 msgid "Years between two dates" msgstr "Jaren tussen twee data" #: ../data/functions.xml.in.h:617 msgid "Zero Coupon" msgstr "Zonder coupons" #: ../data/functions.xml.in.h:618 msgid "au:√,r:sqrt" msgstr "" #: ../data/functions.xml.in.h:619 msgid "au:Π,r:product" msgstr "" #: ../data/functions.xml.in.h:620 msgid "au:Σ,r:sum" msgstr "Σ,som" #: ../data/functions.xml.in.h:621 msgid "r:abs" msgstr "" #: ../data/functions.xml.in.h:622 msgid "r:accrint" msgstr "" #: ../data/functions.xml.in.h:623 msgid "r:accrintm" msgstr "" #: ../data/functions.xml.in.h:624 msgid "r:acos" msgstr "" #: ../data/functions.xml.in.h:625 msgid "r:acosh" msgstr "" #: ../data/functions.xml.in.h:626 msgid "r:acot" msgstr "" #: ../data/functions.xml.in.h:627 msgid "r:acoth" msgstr "" #: ../data/functions.xml.in.h:628 msgid "r:acsc" msgstr "" #: ../data/functions.xml.in.h:629 msgid "r:acsch" msgstr "" #: ../data/functions.xml.in.h:630 msgid "r:add" msgstr "optellen" #: ../data/functions.xml.in.h:631 msgid "r:addDays" msgstr "dagen bijtellen" #: ../data/functions.xml.in.h:632 msgid "r:addMonths" msgstr "maanden bijtellen" #: ../data/functions.xml.in.h:633 msgid "r:addTime" msgstr "tijd bijtellen" #: ../data/functions.xml.in.h:634 msgid "r:addYears" msgstr "jaren bijtellen" #: ../data/functions.xml.in.h:635 msgid "r:adj" msgstr "" #. Matrix area #: ../data/functions.xml.in.h:637 msgid "r:area" msgstr "oppervlak" #: ../data/functions.xml.in.h:638 msgid "r:asec" msgstr "" #: ../data/functions.xml.in.h:639 msgid "r:asech" msgstr "" #: ../data/functions.xml.in.h:640 msgid "r:asin" msgstr "" #: ../data/functions.xml.in.h:641 msgid "r:asinh" msgstr "" #: ../data/functions.xml.in.h:642 msgid "r:atan" msgstr "" #: ../data/functions.xml.in.h:643 msgid "r:atanh" msgstr "" #: ../data/functions.xml.in.h:644 msgid "r:base" msgstr "grondtal" #: ../data/functions.xml.in.h:645 msgid "r:beta" msgstr "" #: ../data/functions.xml.in.h:646 msgid "r:bin" msgstr "" #: ../data/functions.xml.in.h:647 msgid "r:binomial" msgstr "binomiaal" #: ../data/functions.xml.in.h:648 msgid "r:bitxor" msgstr "" #: ../data/functions.xml.in.h:649 msgid "r:cbrt" msgstr "" #: ../data/functions.xml.in.h:650 msgid "r:ceil" msgstr "" #: ../data/functions.xml.in.h:651 msgid "r:char" msgstr "" #: ../data/functions.xml.in.h:652 msgid "r:circle" msgstr "cirkel" #: ../data/functions.xml.in.h:653 msgid "r:circumference" msgstr "cirkelomtrek" #: ../data/functions.xml.in.h:654 msgid "r:cis" msgstr "" #: ../data/functions.xml.in.h:655 msgid "r:code" msgstr "" #: ../data/functions.xml.in.h:656 msgid "r:coeff" msgstr "" #: ../data/functions.xml.in.h:657 msgid "r:cofactor" msgstr "" #: ../data/functions.xml.in.h:658 msgid "r:column" msgstr "kolom" #: ../data/functions.xml.in.h:659 msgid "r:columns" msgstr "kolommen" #: ../data/functions.xml.in.h:660 msgid "r:comb" msgstr "kam" #: ../data/functions.xml.in.h:661 msgid "r:compound" msgstr "samenstellen" #: ../data/functions.xml.in.h:662 msgid "r:concatenate" msgstr "samenvoegen" #: ../data/functions.xml.in.h:663 msgid "r:cone" msgstr "kegel" #: ../data/functions.xml.in.h:664 msgid "r:cone_sa" msgstr "kegel_opp" #: ../data/functions.xml.in.h:665 msgid "r:continuous" msgstr "continu" #: ../data/functions.xml.in.h:666 msgid "r:cor" msgstr "" #: ../data/functions.xml.in.h:667 msgid "r:cos" msgstr "" #: ../data/functions.xml.in.h:668 msgid "r:cosh" msgstr "" #: ../data/functions.xml.in.h:669 msgid "r:cot" msgstr "" #: ../data/functions.xml.in.h:670 msgid "r:coth" msgstr "" #: ../data/functions.xml.in.h:671 msgid "r:coupnum" msgstr "" #: ../data/functions.xml.in.h:672 msgid "r:cov,r:covar" msgstr "" #: ../data/functions.xml.in.h:673 msgid "r:cross" msgstr "uitproduct" #: ../data/functions.xml.in.h:674 msgid "r:csc" msgstr "" #: ../data/functions.xml.in.h:675 msgid "r:csch" msgstr "" #: ../data/functions.xml.in.h:676 msgid "r:csum" msgstr "csom" #: ../data/functions.xml.in.h:677 msgid "r:csurplus" msgstr "" #: ../data/functions.xml.in.h:678 msgid "r:cube" msgstr "kubus" #: ../data/functions.xml.in.h:679 msgid "r:cube_sa" msgstr "kubus_opp" #: ../data/functions.xml.in.h:680 msgid "r:cylinder" msgstr "cilinder" #: ../data/functions.xml.in.h:681 msgid "r:cylinder_sa" msgstr "cilinder_opp" #: ../data/functions.xml.in.h:682 msgid "r:day" msgstr "dag" #: ../data/functions.xml.in.h:683 msgid "r:days" msgstr "dagen" #: ../data/functions.xml.in.h:684 msgid "r:decile" msgstr "deciel" #: ../data/functions.xml.in.h:685 msgid "r:degree" msgstr "graad" #: ../data/functions.xml.in.h:686 msgid "r:denominator" msgstr "noemer" #: ../data/functions.xml.in.h:687 msgid "r:derangements" msgstr "derangementen" #: ../data/functions.xml.in.h:688 msgid "r:det" msgstr "" #: ../data/functions.xml.in.h:689 msgid "r:diff" msgstr "" #: ../data/functions.xml.in.h:690 msgid "r:dimension" msgstr "dimensie" #: ../data/functions.xml.in.h:691 msgid "r:disc" msgstr "kort" #: ../data/functions.xml.in.h:692 msgid "r:divide" msgstr "delen" #: ../data/functions.xml.in.h:693 msgid "r:dollarde" msgstr "" #: ../data/functions.xml.in.h:694 msgid "r:dollarfr" msgstr "" #: ../data/functions.xml.in.h:695 msgid "r:duration" msgstr "tijdsduur" #: ../data/functions.xml.in.h:696 msgid "r:durbinwatson" msgstr "" #: ../data/functions.xml.in.h:697 msgid "r:effect" msgstr "" #: ../data/functions.xml.in.h:698 msgid "r:elasticity" msgstr "elasticiteit" #: ../data/functions.xml.in.h:699 msgid "r:element" msgstr "" #: ../data/functions.xml.in.h:700 msgid "r:elements" msgstr "elementen" #: ../data/functions.xml.in.h:701 msgid "r:error" msgstr "fout" #: ../data/functions.xml.in.h:702 msgid "r:even" msgstr "" #: ../data/functions.xml.in.h:703 msgid "r:exp" msgstr "" #: ../data/functions.xml.in.h:704 msgid "r:export" msgstr "exporteren" #: ../data/functions.xml.in.h:705 msgid "r:extremum" msgstr "uiterste" #: ../data/functions.xml.in.h:706 msgid "r:factorial" msgstr "faculteit" #: ../data/functions.xml.in.h:707 msgid "r:factorial2" msgstr "faculteit2" #: ../data/functions.xml.in.h:708 msgid "r:floor" msgstr "" #: ../data/functions.xml.in.h:709 msgid "r:for" msgstr "" #: ../data/functions.xml.in.h:710 msgid "r:frac" msgstr "" #: ../data/functions.xml.in.h:711 msgid "r:function" msgstr "functie" #: ../data/functions.xml.in.h:712 msgid "r:fv" msgstr "" #: ../data/functions.xml.in.h:713 msgid "r:g_duration" msgstr "g_duur" #: ../data/functions.xml.in.h:714 msgid "r:gamma" msgstr "" #: ../data/functions.xml.in.h:715 msgid "r:gcd" msgstr "ggd" #: ../data/functions.xml.in.h:716 msgid "r:genvector" msgstr "" #: ../data/functions.xml.in.h:717 msgid "r:geomean" msgstr "meetkgem" #: ../data/functions.xml.in.h:718 msgid "r:harmmean" msgstr "harmgem" #: ../data/functions.xml.in.h:719 msgid "r:heaviside" msgstr "heavyside" #: ../data/functions.xml.in.h:720 msgid "r:hex" msgstr "" #: ../data/functions.xml.in.h:721 msgid "r:hyperfactorial" msgstr "hyperfaculteit" #: ../data/functions.xml.in.h:722 msgid "r:hypot" msgstr "" #: ../data/functions.xml.in.h:723 msgid "r:identity" msgstr "identiteit" #: ../data/functions.xml.in.h:724 msgid "r:if" msgstr "" #: ../data/functions.xml.in.h:725 msgid "r:im" msgstr "" #: ../data/functions.xml.in.h:726 msgid "r:int" msgstr "" #: ../data/functions.xml.in.h:727 msgid "r:integrate" msgstr "integreren" #: ../data/functions.xml.in.h:728 msgid "r:intrate" msgstr "renteperc" #: ../data/functions.xml.in.h:729 msgid "r:inv" msgstr "" #: ../data/functions.xml.in.h:730 msgid "r:inverse" msgstr "" #: ../data/functions.xml.in.h:731 msgid "r:ipmt" msgstr "" #: ../data/functions.xml.in.h:732 msgid "r:iqr" msgstr "" #: ../data/functions.xml.in.h:733 msgid "r:isInteger" msgstr "isGeheel" #: ../data/functions.xml.in.h:734 msgid "r:isNumber" msgstr "isGetal" #: ../data/functions.xml.in.h:735 msgid "r:isRational" msgstr "isRationaal" #: ../data/functions.xml.in.h:736 msgid "r:isReal" msgstr "isReëel" #: ../data/functions.xml.in.h:737 msgid "r:isodate" msgstr "" #: ../data/functions.xml.in.h:738 msgid "r:ispmt" msgstr "" #: ../data/functions.xml.in.h:739 msgid "r:kronecker" msgstr "" #: ../data/functions.xml.in.h:740 msgid "r:lambertw,productlog" msgstr "" #: ../data/functions.xml.in.h:741 msgid "r:lcm" msgstr "kgv" #: ../data/functions.xml.in.h:742 msgid "r:lcoeff" msgstr "" #: ../data/functions.xml.in.h:743 msgid "r:ldegree" msgstr "lgraad" #: ../data/functions.xml.in.h:744 msgid "r:len" msgstr "" #: ../data/functions.xml.in.h:745 msgid "r:level_coupon" msgstr "gelijke_coupon" #: ../data/functions.xml.in.h:746 msgid "r:limits" msgstr "grenzen" #: ../data/functions.xml.in.h:747 msgid "r:linearfunction" msgstr "lineairefunctie" #: ../data/functions.xml.in.h:748 msgid "r:ln" msgstr "" #: ../data/functions.xml.in.h:749 msgid "r:load" msgstr "lees" #: ../data/functions.xml.in.h:750 msgid "r:localdate" msgstr "lokaledatum" #: ../data/functions.xml.in.h:751 msgid "r:log" msgstr "" #: ../data/functions.xml.in.h:752 msgid "r:logistic" msgstr "logistisch" #: ../data/functions.xml.in.h:753 msgid "r:logit" msgstr "" #: ../data/functions.xml.in.h:754 msgid "r:matrix" msgstr "" #: ../data/functions.xml.in.h:755 msgid "r:matrix2vector" msgstr "" #: ../data/functions.xml.in.h:756 msgid "r:max" msgstr "" #: ../data/functions.xml.in.h:757 msgid "r:mean,average" msgstr "gemiddelde" #: ../data/functions.xml.in.h:758 msgid "r:meandev" msgstr "gemiddev" #: ../data/functions.xml.in.h:759 msgid "r:median" msgstr "mediaan" #: ../data/functions.xml.in.h:760 msgid "r:mergevectors" msgstr "vectorensamenvoegen" #: ../data/functions.xml.in.h:761 msgid "r:message" msgstr "bericht" #: ../data/functions.xml.in.h:762 msgid "r:min" msgstr "" #: ../data/functions.xml.in.h:763 msgid "r:mod" msgstr "." #: ../data/functions.xml.in.h:764 msgid "r:mode" msgstr "modus" #: ../data/functions.xml.in.h:765 msgid "r:month" msgstr "maand" #: ../data/functions.xml.in.h:766 msgid "r:multifactorial" msgstr "multifaculteit" #: ../data/functions.xml.in.h:767 msgid "r:multiply" msgstr "vermenigvuldigen" #: ../data/functions.xml.in.h:768 msgid "r:multisolve" msgstr "meerdereoplossen" #: ../data/functions.xml.in.h:769 msgid "r:neg" msgstr "anderteken" #: ../data/functions.xml.in.h:770 msgid "r:nominal" msgstr "nominaal" #: ../data/functions.xml.in.h:771 msgid "r:norm" msgstr "" #: ../data/functions.xml.in.h:772 msgid "r:nounit,strip_units" msgstr "geeneenheid,eenheden_weg" #: ../data/functions.xml.in.h:773 msgid "r:nper" msgstr "nterm" #. Number of samples #: ../data/functions.xml.in.h:775 msgid "r:number" msgstr "getal" #: ../data/functions.xml.in.h:776 msgid "r:numerator" msgstr "noemer" #: ../data/functions.xml.in.h:777 msgid "r:oct" msgstr "" #: ../data/functions.xml.in.h:778 msgid "r:odd" msgstr "oneven" #: ../data/functions.xml.in.h:779 msgid "r:parallelogram" msgstr "parallellogram" #: ../data/functions.xml.in.h:780 msgid "r:parallelogram_perimeter" msgstr "parallellogram_omtrek" #: ../data/functions.xml.in.h:781 msgid "r:pareto" msgstr "" #: ../data/functions.xml.in.h:782 msgid "r:pcontent" msgstr "pinhoud" #: ../data/functions.xml.in.h:783 msgid "r:pearson,r:correl" msgstr "" #: ../data/functions.xml.in.h:784 msgid "r:percentile" msgstr "percentiel" #: ../data/functions.xml.in.h:785 msgid "r:perm,variations" msgstr "perm,variaties" #: ../data/functions.xml.in.h:786 msgid "r:permanent" msgstr "" #: ../data/functions.xml.in.h:787 msgid "r:pmt" msgstr "" #: ../data/functions.xml.in.h:788 msgid "r:poolvar" msgstr "" #: ../data/functions.xml.in.h:789 msgid "r:pow" msgstr "macht" #: ../data/functions.xml.in.h:790 msgid "r:ppmt" msgstr "" #: ../data/functions.xml.in.h:791 msgid "r:pricedisc" msgstr "prijskorting" #: ../data/functions.xml.in.h:792 msgid "r:pricemat" msgstr "prijsmat" #: ../data/functions.xml.in.h:793 msgid "r:primpart" msgstr "" #: ../data/functions.xml.in.h:794 msgid "r:process" msgstr "verwerken" #: ../data/functions.xml.in.h:795 msgid "r:processm" msgstr "" #: ../data/functions.xml.in.h:796 msgid "r:psurplus" msgstr "" #: ../data/functions.xml.in.h:797 msgid "r:pttest" msgstr "" #: ../data/functions.xml.in.h:798 msgid "r:punit" msgstr "peenheid" #: ../data/functions.xml.in.h:799 msgid "r:pv" msgstr "" #: ../data/functions.xml.in.h:800 msgid "r:pyramid" msgstr "piramide" #: ../data/functions.xml.in.h:801 msgid "r:quartile" msgstr "kwartiel" #: ../data/functions.xml.in.h:802 msgid "r:radtodef" msgstr "radnaardef" #: ../data/functions.xml.in.h:803 msgid "r:raise" msgstr "machtverheffen" #: ../data/functions.xml.in.h:804 msgid "r:ramp" msgstr "" #: ../data/functions.xml.in.h:805 msgid "r:rand" msgstr "wilk" #: ../data/functions.xml.in.h:806 msgid "r:randbetween" msgstr "wilktussen" #: ../data/functions.xml.in.h:807 msgid "r:range" msgstr "bereik" #: ../data/functions.xml.in.h:808 msgid "r:rank" msgstr "rangorde" #: ../data/functions.xml.in.h:809 msgid "r:rayleigh" msgstr "" #: ../data/functions.xml.in.h:810 msgid "r:rayleightail" msgstr "rayleighstaart" #: ../data/functions.xml.in.h:811 msgid "r:re" msgstr "" #: ../data/functions.xml.in.h:812 msgid "r:received" msgstr "ontvangen" #: ../data/functions.xml.in.h:813 msgid "r:rect" msgstr "" #: ../data/functions.xml.in.h:814 msgid "r:rect_perimeter" msgstr "rect_omtrek" #: ../data/functions.xml.in.h:815 msgid "r:rectangular" msgstr "rechthoekig" #: ../data/functions.xml.in.h:816 msgid "r:rectprism" msgstr "rectprisma" #: ../data/functions.xml.in.h:817 msgid "r:rectprism_sa" msgstr "rectprisma_opp" #: ../data/functions.xml.in.h:818 msgid "r:register" msgstr "" #: ../data/functions.xml.in.h:819 msgid "r:rem" msgstr "" #: ../data/functions.xml.in.h:820 msgid "r:replace" msgstr "vervangen" #: ../data/functions.xml.in.h:821 msgid "r:representsInteger" msgstr "isGeheelgetal" #: ../data/functions.xml.in.h:822 msgid "r:representsNumber" msgstr "isGetal" #: ../data/functions.xml.in.h:823 msgid "r:representsRational" msgstr "isRationaalgetal" #: ../data/functions.xml.in.h:824 msgid "r:representsReal" msgstr "isReëel" #: ../data/functions.xml.in.h:825 msgid "r:rms" msgstr "" #: ../data/functions.xml.in.h:826 msgid "r:roman" msgstr "romeins" #: ../data/functions.xml.in.h:827 msgid "r:root" msgstr "wortel" #: ../data/functions.xml.in.h:828 msgid "r:round" msgstr "afronden" #: ../data/functions.xml.in.h:829 msgid "r:row" msgstr "rij" #: ../data/functions.xml.in.h:830 msgid "r:rows" msgstr "rijen" #: ../data/functions.xml.in.h:831 msgid "r:save" msgstr "opslaan" #: ../data/functions.xml.in.h:832 msgid "r:sec" msgstr "" #: ../data/functions.xml.in.h:833 msgid "r:sech" msgstr "" #: ../data/functions.xml.in.h:834 msgid "r:select" msgstr "selecteer" #: ../data/functions.xml.in.h:835 msgid "r:sgn" msgstr "" #: ../data/functions.xml.in.h:836 msgid "r:shift" msgstr "" #: ../data/functions.xml.in.h:837 msgid "r:sigmoid" msgstr "sigmoïde" #: ../data/functions.xml.in.h:838 msgid "r:sin" msgstr "" #: ../data/functions.xml.in.h:839 msgid "r:sinh" msgstr "" #: ../data/functions.xml.in.h:840 msgid "r:sln" msgstr "" #: ../data/functions.xml.in.h:841 msgid "r:solve" msgstr "oplossen" #: ../data/functions.xml.in.h:842 msgid "r:solve2" msgstr "oplossen2" #: ../data/functions.xml.in.h:843 msgid "r:sort" msgstr "sorteren" #: ../data/functions.xml.in.h:844 msgid "r:spearman" msgstr "" #: ../data/functions.xml.in.h:845 msgid "r:sphere" msgstr "bol" #: ../data/functions.xml.in.h:846 msgid "r:sphere_sa" msgstr "bol_oppervlak" #: ../data/functions.xml.in.h:847 msgid "r:sq" msgstr "" #: ../data/functions.xml.in.h:848 msgid "r:sqpyramid" msgstr "vierkpiramide" #: ../data/functions.xml.in.h:849 msgid "r:sqpyramid_height" msgstr "midhoogte_vierkpiramide" #: ../data/functions.xml.in.h:850 msgid "r:sqpyramid_sa" msgstr "vierkpiramide_opp" #: ../data/functions.xml.in.h:851 msgid "r:sqrtpi" msgstr "" #: ../data/functions.xml.in.h:852 msgid "r:square" msgstr "vierkant" #: ../data/functions.xml.in.h:853 msgid "r:square_perimeter" msgstr "vierkant_omtrek" #: ../data/functions.xml.in.h:854 msgid "r:stack" msgstr "stapelgeheugen" #: ../data/functions.xml.in.h:855 msgid "r:stamptodate" msgstr "stampnaardatum" #: ../data/functions.xml.in.h:856 msgid "r:stderr" msgstr "" #: ../data/functions.xml.in.h:857 msgid "r:stdev" msgstr "" #: ../data/functions.xml.in.h:858 msgid "r:stdevp" msgstr "" #: ../data/functions.xml.in.h:859 msgid "r:subtract" msgstr "aftrekken" #: ../data/functions.xml.in.h:860 msgid "r:superfactorial" msgstr "superfaculteit" #: ../data/functions.xml.in.h:861 msgid "r:syd" msgstr "" #: ../data/functions.xml.in.h:862 msgid "r:tan" msgstr "" #: ../data/functions.xml.in.h:863 msgid "r:tanh" msgstr "" #: ../data/functions.xml.in.h:864 msgid "r:tbilleq" msgstr "" #: ../data/functions.xml.in.h:865 msgid "r:tbillprice" msgstr "" #: ../data/functions.xml.in.h:866 msgid "r:tbillyield" msgstr "" #: ../data/functions.xml.in.h:867 msgid "r:tcoeff" msgstr "" #: ../data/functions.xml.in.h:868 msgid "r:tetrahedron" msgstr "tetraëder" #: ../data/functions.xml.in.h:869 msgid "r:tetrahedron_height" msgstr "tetraëder_hoogte" #: ../data/functions.xml.in.h:870 msgid "r:tetrahedron_sa" msgstr "tetraëder_opp" #: ../data/functions.xml.in.h:871 msgid "r:time" msgstr "tijd" #: ../data/functions.xml.in.h:872 msgid "r:timestamp" msgstr "" #: ../data/functions.xml.in.h:873 msgid "r:title" msgstr "titel" #: ../data/functions.xml.in.h:874 msgid "r:total" msgstr "totaal" #: ../data/functions.xml.in.h:875 msgid "r:transpose" msgstr "transponeren" #: ../data/functions.xml.in.h:876 msgid "r:trapezoid" msgstr "trapezium" #: ../data/functions.xml.in.h:877 msgid "r:triangle" msgstr "driehoek" #: ../data/functions.xml.in.h:878 msgid "r:triangle_perimeter" msgstr "driehoek_omtrek" #: ../data/functions.xml.in.h:879 msgid "r:triangleprism" msgstr "driehoekprisma" #: ../data/functions.xml.in.h:880 msgid "r:triangular" msgstr "driehoekig" #: ../data/functions.xml.in.h:881 msgid "r:trimmean" msgstr "trimgemidd" #: ../data/functions.xml.in.h:882 msgid "r:trunc" msgstr "afkap" #: ../data/functions.xml.in.h:883 msgid "r:ttest" msgstr "" #: ../data/functions.xml.in.h:884 msgid "r:var" msgstr "" #: ../data/functions.xml.in.h:885 msgid "r:varp" msgstr "" #: ../data/functions.xml.in.h:886 msgid "r:vector" msgstr "" #: ../data/functions.xml.in.h:887 msgid "r:warning" msgstr "waarschuwing" #: ../data/functions.xml.in.h:888 msgid "r:week" msgstr "" #: ../data/functions.xml.in.h:889 msgid "r:weekday" msgstr "weekdag" #: ../data/functions.xml.in.h:890 msgid "r:weighmean" msgstr "gewogengemidd" #: ../data/functions.xml.in.h:891 msgid "r:winsormean" msgstr "winsorgemidd" #: ../data/functions.xml.in.h:892 msgid "r:xor" msgstr "" #: ../data/functions.xml.in.h:893 msgid "r:year" msgstr "jaar" #: ../data/functions.xml.in.h:894 msgid "r:yearday" msgstr "jaardag" #: ../data/functions.xml.in.h:895 msgid "r:yearfrac" msgstr "jaarfrac" #: ../data/functions.xml.in.h:896 msgid "r:zero_coupon" msgstr "geen_coupon" #: ../data/functions.xml.in.h:897 msgid "r:zeta" msgstr "" #: ../data/functions.xml.in.h:898 msgid "rs:exp10" msgstr "" #: ../data/functions.xml.in.h:899 msgid "rs:exp2" msgstr "" #: ../data/functions.xml.in.h:900 msgid "rs:log10" msgstr "" #: ../data/functions.xml.in.h:901 msgid "rs:log2" msgstr "" #: ../data/functions.xml.in.h:902 msgid "x1" msgstr "" #: ../data/functions.xml.in.h:903 msgid "x2" msgstr "" #: ../data/functions.xml.in.h:904 msgid "y1" msgstr "" #: ../data/functions.xml.in.h:905 msgid "y2" msgstr "" #. Planet #: ../data/planets.xml.in.h:2 msgid "!planets!Mercury" msgstr "Mercurius" #: ../data/planets.xml.in.h:3 msgid "Earth" msgstr "Aarde" #: ../data/planets.xml.in.h:4 msgid "Jupiter" msgstr "Jupiter" #: ../data/planets.xml.in.h:5 msgid "Mars" msgstr "Mars" #: ../data/planets.xml.in.h:6 msgid "Neptune" msgstr "Neptunus" #: ../data/planets.xml.in.h:7 msgid "Pluto" msgstr "Pluto" #: ../data/planets.xml.in.h:8 msgid "Saturn" msgstr "Saturnus" #: ../data/planets.xml.in.h:9 msgid "Uranus" msgstr "Uranus" #: ../data/planets.xml.in.h:10 msgid "Venus" msgstr "Venus" #. Unit category #: ../data/units.xml.in.h:2 msgid "!units!Angle" msgstr "Hoek" #. Unit category #: ../data/units.xml.in.h:4 msgid "!units!Frequency" msgstr "Frequentie" #. Unit category #: ../data/units.xml.in.h:6 msgid "!units!Length" msgstr "Lengte" #. Unit category #: ../data/units.xml.in.h:8 msgid "!units!Mass" msgstr "Massa" #: ../data/units.xml.in.h:9 msgid "Ångström" msgstr "Ångström" #: ../data/units.xml.in.h:10 msgid "ATA Pica" msgstr "ATA Pica" #: ../data/units.xml.in.h:11 msgid "ATA Point" msgstr "ATA Point" #: ../data/units.xml.in.h:12 msgid "Abampere" msgstr "Abampere" #: ../data/units.xml.in.h:13 msgid "Abcoulomb" msgstr "Abcoulomb" #: ../data/units.xml.in.h:14 msgid "Abohm" msgstr "Abohm" #: ../data/units.xml.in.h:15 msgid "Absorbed Dose" msgstr "Absorptiedosis" #: ../data/units.xml.in.h:16 msgid "Absorbed Dose Rate" msgstr "Absorptiesnelheid" #: ../data/units.xml.in.h:17 msgid "Abvolt" msgstr "Abvolt" #: ../data/units.xml.in.h:18 msgid "Acceleration" msgstr "Versnelling" #: ../data/units.xml.in.h:19 msgid "Acre" msgstr "Acre" #: ../data/units.xml.in.h:20 msgid "Ampere" msgstr "Ampere" #: ../data/units.xml.in.h:21 msgid "Ampere per Meter" msgstr "Ampere per meter" #: ../data/units.xml.in.h:22 msgid "Ampere per Meter Squared" msgstr "Ampere per meter kwadraat" #: ../data/units.xml.in.h:23 msgid "Ampere per Volt" msgstr "Ampere per volt" #: ../data/units.xml.in.h:24 msgid "Angular Acceleration" msgstr "Hoekversnelling" #: ../data/units.xml.in.h:25 msgid "Angular Velocity" msgstr "Hoeksnelheid" #: ../data/units.xml.in.h:26 msgid "Arcminute" msgstr "Boogminuut" #: ../data/units.xml.in.h:27 msgid "Arcsecond" msgstr "Boogseconde" #: ../data/units.xml.in.h:28 msgid "Are" msgstr "Are" #: ../data/units.xml.in.h:29 msgid "Area" msgstr "Oppervlak" #: ../data/units.xml.in.h:30 msgid "Astronomical Unit" msgstr "Astronomische eenheid" #: ../data/units.xml.in.h:31 msgid "Atmosphere" msgstr "Atmosfeer" #: ../data/units.xml.in.h:32 msgid "Atomic Mass Unit" msgstr "Atomaire massa-eenheid" #: ../data/units.xml.in.h:33 msgid "Bar" msgstr "Bar" #: ../data/units.xml.in.h:34 msgid "Barn" msgstr "Barn" #: ../data/units.xml.in.h:35 msgid "Becquerel" msgstr "Becquerel" #: ../data/units.xml.in.h:36 msgid "Bel" msgstr "Bel" #: ../data/units.xml.in.h:37 msgid "Bit" msgstr "Bit" #: ../data/units.xml.in.h:38 msgid "British Thermal Unit (IT)" msgstr "British Thermal Unit (IT)" #: ../data/units.xml.in.h:39 msgid "Byte (8-bit)" msgstr "Byte (8-bit)" #: ../data/units.xml.in.h:40 msgid "Calorie (15 degrees Celcius)" msgstr "Calorie (15 graden Celcius)" #: ../data/units.xml.in.h:41 msgid "Calorie (capital C)" msgstr "Calorie (hoofdletter C)" #: ../data/units.xml.in.h:42 msgid "Calorie (international table)" msgstr "Calorie (internationale tabel)" #: ../data/units.xml.in.h:43 msgid "Calorie (mean)" msgstr "Calorie (gemiddeld)" #: ../data/units.xml.in.h:44 msgid "Calorie (thermochemical)" msgstr "Calorie (thermochemisch)" #: ../data/units.xml.in.h:45 msgid "Candela" msgstr "Candela" #: ../data/units.xml.in.h:46 msgid "Candela Steradian" msgstr "Candela-steradiaal" #: ../data/units.xml.in.h:47 msgid "Candela per Meter Squared" msgstr "Candela per vierkante meter" #: ../data/units.xml.in.h:48 msgid "Capacitance" msgstr "Capaciteit" #: ../data/units.xml.in.h:49 msgid "Carat" msgstr "Karaat" #: ../data/units.xml.in.h:50 msgid "Catalytic Activity" msgstr "Katalitische activiteit" #: ../data/units.xml.in.h:51 msgid "Catalytic Concentration" msgstr "Catalitische concentratie" #: ../data/units.xml.in.h:52 msgid "Cental" msgstr "Cental" #: ../data/units.xml.in.h:53 msgid "Centiliter" msgstr "Centiliter" #: ../data/units.xml.in.h:54 msgid "Centimeter" msgstr "Centimeter" #: ../data/units.xml.in.h:55 msgid "Chain" msgstr "Chain" #: ../data/units.xml.in.h:56 msgid "Cicero" msgstr "Cicero" #: ../data/units.xml.in.h:57 msgid "Cooking" msgstr "Koken" #: ../data/units.xml.in.h:58 msgid "Coulomb" msgstr "Coulomb" #: ../data/units.xml.in.h:59 msgid "Coulomb per Cubic Meter" msgstr "Coulomb per kubieke meter" #: ../data/units.xml.in.h:60 msgid "Coulomb per Kilogram" msgstr "Coulomb per kilogram" #: ../data/units.xml.in.h:61 msgid "Coulomb per Meter Squared" msgstr "Coulomb per vierkante meter" #: ../data/units.xml.in.h:62 msgid "Coulomb per Volt" msgstr "Coulomb per volt" #: ../data/units.xml.in.h:63 msgid "Cubic Inch" msgstr "Kubieke inch" #: ../data/units.xml.in.h:64 msgid "Cubic Meter" msgstr "Kubieke meter" #: ../data/units.xml.in.h:65 msgid "Cubic Meter per Kilogram" msgstr "Kubieke meter per kilogram" #: ../data/units.xml.in.h:66 msgid "Cup" msgstr "Kop" #: ../data/units.xml.in.h:67 msgid "Curie" msgstr "Curie" #: ../data/units.xml.in.h:68 msgid "Current Density" msgstr "Stroomdichtheid" #: ../data/units.xml.in.h:69 msgid "Day" msgstr "Dag" #: ../data/units.xml.in.h:70 msgid "Decibel" msgstr "Decibel" #: ../data/units.xml.in.h:71 msgid "Deciliter" msgstr "Deciliter" #: ../data/units.xml.in.h:72 msgid "Decimeter" msgstr "Decimeter" #: ../data/units.xml.in.h:73 msgid "Degree" msgstr "Graad" #: ../data/units.xml.in.h:74 msgid "Degree Celcius" msgstr "Graden Celsius" #: ../data/units.xml.in.h:75 msgid "Degrees Fahrenheit" msgstr "Graden Fahrenheit" #: ../data/units.xml.in.h:76 msgid "Degrees Rankine" msgstr "Graden Rankine" #: ../data/units.xml.in.h:78 msgid "Dessertspoon" msgstr "Dessertlepel" #: ../data/units.xml.in.h:79 msgid "Didot Point" msgstr "Didot Point" #: ../data/units.xml.in.h:80 msgid "Dose Equivalent" msgstr "Dosisequivalent" #: ../data/units.xml.in.h:81 msgid "Dram" msgstr "Dram" #: ../data/units.xml.in.h:82 msgid "Dynamic Viscosity" msgstr "Dynamische viscositeit" #: ../data/units.xml.in.h:83 msgid "Dyne" msgstr "Dyne" #: ../data/units.xml.in.h:84 msgid "Einstein" msgstr "Einstein" #: ../data/units.xml.in.h:85 msgid "Einstein per Meter Squared per Second" msgstr "Einstein per vierkante meter per seconde" #: ../data/units.xml.in.h:86 msgid "Electric Charge" msgstr "Elektrische lading" #: ../data/units.xml.in.h:87 msgid "Electric Charge Density" msgstr "Elektrische ladingsdichtheid" #: ../data/units.xml.in.h:88 msgid "Electric Conductance" msgstr "Elektrisch geleidingsvermogen" #: ../data/units.xml.in.h:89 msgid "Electric Current" msgstr "Elektrische stroom" #: ../data/units.xml.in.h:90 msgid "Electric Field Strength" msgstr "Elektrische veldsterkte" #: ../data/units.xml.in.h:91 msgid "Electric Flux Density" msgstr "Elektrische fluxdichtheid" #: ../data/units.xml.in.h:92 msgid "Electric Potential" msgstr "Elektrische potentiaal" #: ../data/units.xml.in.h:93 msgid "Electric Resistance" msgstr "Elektrische weerstand" #: ../data/units.xml.in.h:94 msgid "Electricity" msgstr "Elektriciteit" #: ../data/units.xml.in.h:95 msgid "Electron Volt" msgstr "Elektronvolt" #: ../data/units.xml.in.h:96 msgid "Energy" msgstr "Energie" #: ../data/units.xml.in.h:97 msgid "Energy Density" msgstr "Energiedichtheid" #: ../data/units.xml.in.h:98 msgid "Entropy" msgstr "Entropie" #: ../data/units.xml.in.h:99 msgid "Erg" msgstr "Erg" #: ../data/units.xml.in.h:100 msgid "Exposure" msgstr "Belichting" #: ../data/units.xml.in.h:101 msgid "Farad" msgstr "Farad" #: ../data/units.xml.in.h:102 msgid "Farad per Meter" msgstr "Farad per meter" #: ../data/units.xml.in.h:103 msgid "Fathom" msgstr "Vadem" #: ../data/units.xml.in.h:104 msgid "Foe" msgstr "Foe" #: ../data/units.xml.in.h:105 msgid "Foot" msgstr "Voet" #: ../data/units.xml.in.h:106 msgid "Foot-Candle" msgstr "Foot-Candle" #: ../data/units.xml.in.h:107 msgid "Foot-Pound Force" msgstr "Foot-Pound Force" #: ../data/units.xml.in.h:108 msgid "Force" msgstr "Kracht" #: ../data/units.xml.in.h:109 msgid "Fortnight" msgstr "Fortnight" #: ../data/units.xml.in.h:110 msgid "Fuel Economy" msgstr "Brandstofgebruik" #: ../data/units.xml.in.h:111 msgid "Furlong" msgstr "Furlong" #: ../data/units.xml.in.h:112 msgid "Galileo" msgstr "Galileo" #: ../data/units.xml.in.h:113 msgid "Gauss" msgstr "Gauss" #: ../data/units.xml.in.h:114 msgid "Gee" msgstr "Gee" #: ../data/units.xml.in.h:115 msgid "Gibibit" msgstr "Gibibit" #: ../data/units.xml.in.h:116 msgid "Gibibyte" msgstr "Gibibyte" #: ../data/units.xml.in.h:117 msgid "Gigabit" msgstr "Gigabit" #: ../data/units.xml.in.h:118 msgid "Gigabyte" msgstr "Gigabyte" #: ../data/units.xml.in.h:119 msgid "Gradian (Gon)" msgstr "Grad (Gon)" #: ../data/units.xml.in.h:120 msgid "Grain" msgstr "Grain" #: ../data/units.xml.in.h:121 msgid "Gram" msgstr "Gram" #: ../data/units.xml.in.h:122 msgid "Gram of TNT" msgstr "Gram TNT" #: ../data/units.xml.in.h:123 msgid "Gram per Cubic Centimeter" msgstr "Gram per kubieke centimeter" #: ../data/units.xml.in.h:124 msgid "Gram per Cubic Decimeter" msgstr "Gram per kubieke decimeter" #: ../data/units.xml.in.h:125 msgid "Gram per Mole" msgstr "Gram per mol" #: ../data/units.xml.in.h:126 msgid "Gray" msgstr "Gray" #: ../data/units.xml.in.h:127 msgid "Gray per Second" msgstr "Gray per seconde" #: ../data/units.xml.in.h:128 msgid "Hand" msgstr "Hand" #: ../data/units.xml.in.h:129 msgid "Hectare" msgstr "Hectare" #: ../data/units.xml.in.h:130 msgid "Hektogram" msgstr "Hectogram" #: ../data/units.xml.in.h:131 msgid "Henry" msgstr "Henry" #: ../data/units.xml.in.h:132 msgid "Henry per Meter" msgstr "Henry per meter" #: ../data/units.xml.in.h:133 msgid "Hertz" msgstr "Hertz" #: ../data/units.xml.in.h:134 msgid "Horse Power" msgstr "Paardekracht (Engels)" #: ../data/units.xml.in.h:135 msgid "Hour" msgstr "Uur" #: ../data/units.xml.in.h:136 msgid "Illuminance" msgstr "Verlichtingssterkte" #: ../data/units.xml.in.h:137 msgid "Imperial Bushel" msgstr "Imperial Bushel" #: ../data/units.xml.in.h:138 msgid "Imperial Capacity" msgstr "Imperial Capacity" #: ../data/units.xml.in.h:139 msgid "Imperial Fluid Drachm" msgstr "Imperial Fluid Drachm" #: ../data/units.xml.in.h:140 msgid "Imperial Fluid Ounce" msgstr "Imperial Fluid Ounce" #: ../data/units.xml.in.h:141 msgid "Imperial Fluid Scuple" msgstr "Imperial Fluid Scuple" #: ../data/units.xml.in.h:142 msgid "Imperial Gallon" msgstr "Imperial Gallon" #: ../data/units.xml.in.h:143 msgid "Imperial Gill" msgstr "Imperial Gill" #: ../data/units.xml.in.h:144 msgid "Imperial Minim" msgstr "Imperial Minim" #: ../data/units.xml.in.h:145 msgid "Imperial Pint" msgstr "Imperial Pint" #: ../data/units.xml.in.h:146 msgid "Imperial Quart" msgstr "Imperial Quart" #: ../data/units.xml.in.h:147 msgid "Inch" msgstr "Inch" #: ../data/units.xml.in.h:148 msgid "Inch of Mercury" msgstr "Inches kwik" #: ../data/units.xml.in.h:149 msgid "Inductance" msgstr "Zelfinductie" #: ../data/units.xml.in.h:150 msgid "Information" msgstr "Informatie" #: ../data/units.xml.in.h:151 msgid "Irradiance" msgstr "Irradiantie" #: ../data/units.xml.in.h:152 msgid "Joule" msgstr "Joule" #: ../data/units.xml.in.h:153 msgid "Joule per Cubic Meter" msgstr "Joule per kubieke meter" #: ../data/units.xml.in.h:154 msgid "Joule per Kelvin" msgstr "Joule per Kelvin" #: ../data/units.xml.in.h:155 msgid "Joule per Kilogram" msgstr "Joule per kilogram" #: ../data/units.xml.in.h:156 msgid "Joule per Kilogram Kelvin" msgstr "Joule per kilogram Kelvin" #: ../data/units.xml.in.h:157 msgid "Joule per Mole" msgstr "Joule per mol" #: ../data/units.xml.in.h:158 msgid "Joule per Mole Kelvin" msgstr "Joule per mol Kelvin" #: ../data/units.xml.in.h:159 msgid "Joule per Second" msgstr "Joule per seconde" #: ../data/units.xml.in.h:160 msgid "Julian Year" msgstr "Juliaans jaar" #: ../data/units.xml.in.h:161 msgid "Katal" msgstr "Katal" #: ../data/units.xml.in.h:162 msgid "Katal per Cubic Meter" msgstr "Katal per kubieke meter" #: ../data/units.xml.in.h:163 msgid "Kelvin" msgstr "Kelvin" #: ../data/units.xml.in.h:164 msgid "Kibibit" msgstr "Kibibit" #: ../data/units.xml.in.h:165 msgid "Kibibyte" msgstr "Kibibyte" #: ../data/units.xml.in.h:166 msgid "Kilobit" msgstr "Kilobit" #: ../data/units.xml.in.h:167 msgid "Kilobyte" msgstr "Kilobyte" #: ../data/units.xml.in.h:168 msgid "Kilogram" msgstr "Kilogram" #: ../data/units.xml.in.h:169 msgid "Kilogram per Cubic Meter" msgstr "Kilogram per kubieke meter" #: ../data/units.xml.in.h:170 msgid "Kilogram per Kilogram" msgstr "Kilogram per kilogram" #: ../data/units.xml.in.h:171 msgid "Kilometer" msgstr "Kilometer" #: ../data/units.xml.in.h:172 msgid "Kilometer per Hour" msgstr "Kilometer per uur" #: ../data/units.xml.in.h:173 msgid "Kilometer per Liter" msgstr "Kilometer per liter" #: ../data/units.xml.in.h:174 msgid "Kilopond (Kilogram-Force)" msgstr "Kilopond (Kilogram-kracht)" #: ../data/units.xml.in.h:175 msgid "Kilowatt Hour" msgstr "Kilowattuur" #: ../data/units.xml.in.h:176 msgid "Kinematic Viscosity" msgstr "Kinematische viscositeit" #: ../data/units.xml.in.h:177 msgid "Knot" msgstr "Knoop" #: ../data/units.xml.in.h:178 msgid "Light" msgstr "Licht" #: ../data/units.xml.in.h:179 msgid "Light Year" msgstr "Lichtjaar" #: ../data/units.xml.in.h:180 msgid "Ligne" msgstr "Ligne (1/40 inch)" #: ../data/units.xml.in.h:181 msgid "Link" msgstr "Link" #: ../data/units.xml.in.h:182 msgid "Liter" msgstr "Liter" #: ../data/units.xml.in.h:183 msgid "Liter per Kilometer" msgstr "Liter per kilometer" #: ../data/units.xml.in.h:184 msgid "Long Hundredweight" msgstr "Long hundredweight" #: ../data/units.xml.in.h:185 msgid "Long Ton" msgstr "Long ton" #: ../data/units.xml.in.h:186 msgid "Lumen" msgstr "Lumen" #: ../data/units.xml.in.h:187 msgid "Lumen per Foot Squared" msgstr "Lumen per vierkante voet" #: ../data/units.xml.in.h:188 msgid "Lumen per Meter Squared" msgstr "Lumen per vierkante meter" #: ../data/units.xml.in.h:189 msgid "Luminance" msgstr "Luminantie" #: ../data/units.xml.in.h:190 msgid "Luminous Flux" msgstr "Lichtstroom" #: ../data/units.xml.in.h:191 msgid "Luminous Intensity" msgstr "Lichtsterkte" #: ../data/units.xml.in.h:192 msgid "Lux" msgstr "Lux" #: ../data/units.xml.in.h:193 msgid "Magnetic Field Strength" msgstr "Magnetische veldsterkte" #: ../data/units.xml.in.h:194 msgid "Magnetic Flux" msgstr "Magnetische flux" #: ../data/units.xml.in.h:195 msgid "Magnetic Flux Density" msgstr "Magnetische fluxdichtheid" #: ../data/units.xml.in.h:196 msgid "Magnetism" msgstr "Magnetisme" #: ../data/units.xml.in.h:197 msgid "Mass Fraction" msgstr "Massafractie" #: ../data/units.xml.in.h:198 msgid "Maxwell" msgstr "Maxwell" #: ../data/units.xml.in.h:199 msgid "Mebibit" msgstr "Mebibit" #: ../data/units.xml.in.h:200 msgid "Mebibyte" msgstr "Mebibyte" #: ../data/units.xml.in.h:201 msgid "Megabit" msgstr "Megabit" #: ../data/units.xml.in.h:202 msgid "Megabyte" msgstr "Megabyte" #: ../data/units.xml.in.h:203 msgid "Meter" msgstr "Meter" #: ../data/units.xml.in.h:204 msgid "Meter Kilogram per Second Squared" msgstr "Meter kilogram per seconde kwadraat" #: ../data/units.xml.in.h:205 msgid "Meter per Meter" msgstr "Meter per meter" #: ../data/units.xml.in.h:206 msgid "Meter per Second" msgstr "Meter per seconde" #: ../data/units.xml.in.h:207 msgid "Meter per Second Squared" msgstr "Meter per seconde kwadraat" #: ../data/units.xml.in.h:208 msgid "Metric Ton (Tonne)" msgstr "Metrische ton (Ton)" #: ../data/units.xml.in.h:209 msgid "Microeinstein per Meter Squared per Second" msgstr "Micro-einstein per vierkante meter per seconde" #: ../data/units.xml.in.h:210 msgid "Mil (1/1000 in)" msgstr "Mil (1/1000 in)" #: ../data/units.xml.in.h:211 msgid "Mile" msgstr "Mijl" #: ../data/units.xml.in.h:212 msgid "Miles per Gallon" msgstr "Miles per Gallon" #: ../data/units.xml.in.h:213 msgid "Miles per Hour" msgstr "Miles per Hour" #: ../data/units.xml.in.h:214 msgid "Milliliter" msgstr "Mililiter" #: ../data/units.xml.in.h:215 msgid "Millimeter" msgstr "Milimeter" #: ../data/units.xml.in.h:216 msgid "Millimeter of Mercury" msgstr "Milimeter kwik" #: ../data/units.xml.in.h:217 msgid "Minute" msgstr "Minuut" #: ../data/units.xml.in.h:218 msgid "Molar Energy" msgstr "Molaire energie" #: ../data/units.xml.in.h:219 msgid "Molar Entropy" msgstr "Molaire entropy" #: ../data/units.xml.in.h:220 msgid "Mole" msgstr "Mol" #: ../data/units.xml.in.h:221 msgid "Mole per Cubic Meter" msgstr "Mol per kubieke meter" #: ../data/units.xml.in.h:222 msgid "Moment of Force" msgstr "Krachtmoment" #: ../data/units.xml.in.h:223 msgid "Nautical Mile" msgstr "Nautische mijl" #: ../data/units.xml.in.h:224 msgid "Nautical Mile per Hour" msgstr "Nautische mijl per uur" #: ../data/units.xml.in.h:225 msgid "Neper" msgstr "Neper" #: ../data/units.xml.in.h:226 msgid "New Didot Point" msgstr "Nieuwe Didot Point" #: ../data/units.xml.in.h:227 msgid "Newton" msgstr "Newton" #: ../data/units.xml.in.h:228 msgid "Newton Meter" msgstr "Newtonmeter" #: ../data/units.xml.in.h:229 msgid "Newton per Meter" msgstr "Newton per meter" #: ../data/units.xml.in.h:230 msgid "Newton per Meter Squared" msgstr "Newton per vierkante meter" #: ../data/units.xml.in.h:231 msgid "Nibble" msgstr "Nibble" #: ../data/units.xml.in.h:232 msgid "Oersted" msgstr "Oersted" #: ../data/units.xml.in.h:233 msgid "Ohm" msgstr "Ohm" #: ../data/units.xml.in.h:234 msgid "Ounce" msgstr "Ounce" #: ../data/units.xml.in.h:235 msgid "Ounce (troy)" msgstr "Ounce (troy)" #: ../data/units.xml.in.h:236 msgid "Parsec" msgstr "Parsec" #: ../data/units.xml.in.h:237 msgid "Pascal" msgstr "Pascal" #: ../data/units.xml.in.h:238 msgid "Pascal Second" msgstr "Pascal seconde" #: ../data/units.xml.in.h:239 msgid "Pennyweight" msgstr "Pennyweight" #: ../data/units.xml.in.h:240 msgid "Permeability" msgstr "Permeabiliteit" #: ../data/units.xml.in.h:241 msgid "Permittivity" msgstr "Permittiviteit" #: ../data/units.xml.in.h:242 msgid "Pferdestärke" msgstr "Paardekracht (metrisch)" #: ../data/units.xml.in.h:243 msgid "Pfund" msgstr "Pond" #: ../data/units.xml.in.h:244 msgid "Phot" msgstr "Phot" #: ../data/units.xml.in.h:245 msgid "Pied du roi (French Royal Foot)" msgstr "Pied du roi (Franse koninklijke voet)" #: ../data/units.xml.in.h:246 msgid "Plane Angle" msgstr "Vlakke hoek" #: ../data/units.xml.in.h:247 msgid "Poise" msgstr "Poise" #: ../data/units.xml.in.h:248 msgid "Pond (Gram-Force)" msgstr "Pond (gram-kracht)" #: ../data/units.xml.in.h:249 msgid "PostScript Pica" msgstr "PostScript Pica" #: ../data/units.xml.in.h:250 msgid "PostScript Point" msgstr "PostScript Point" #: ../data/units.xml.in.h:251 msgid "Pouce (French Royal Inch)" msgstr "Pouce (Franse koninklijke duim)" #: ../data/units.xml.in.h:252 msgid "Pound" msgstr "Pound" #: ../data/units.xml.in.h:253 msgid "Pound (troy)" msgstr "Pound (troy)" #: ../data/units.xml.in.h:254 msgid "Pound Foot per Second Squared" msgstr "Pound Foot per seconde kwadraat" #: ../data/units.xml.in.h:255 msgid "Pound-force" msgstr "Pound-force" #: ../data/units.xml.in.h:256 msgid "Pound-force per Square Inch" msgstr "Pound-force per inch kwadraat" #: ../data/units.xml.in.h:257 msgid "Pound-force per Square Inch (psi)" msgstr "Pound-force per inch kwadraat (psi)" #: ../data/units.xml.in.h:258 msgid "Poundal" msgstr "Poundal" #: ../data/units.xml.in.h:259 msgid "Power" msgstr "Vermogen" #: ../data/units.xml.in.h:260 msgid "Pressure" msgstr "Druk" #: ../data/units.xml.in.h:261 msgid "Rad" msgstr "Rad" #: ../data/units.xml.in.h:262 msgid "Radian" msgstr "Radiaal" #: ../data/units.xml.in.h:263 msgid "Radiance" msgstr "Radiantie" #: ../data/units.xml.in.h:264 msgid "Radians per Second" msgstr "Radialen per seconde" #: ../data/units.xml.in.h:265 msgid "Radians per Second Squared" msgstr "Radialen per seconde kwadraat" #: ../data/units.xml.in.h:266 msgid "Radiant Intensity" msgstr "Stralingsintensiteit" #: ../data/units.xml.in.h:267 msgid "Radioactivity" msgstr "Radioactiviteit" #: ../data/units.xml.in.h:268 msgid "Ratio" msgstr "Verhouding" #: ../data/units.xml.in.h:269 msgid "Reciprocal Meter" msgstr "Omgekeerde meter" #: ../data/units.xml.in.h:270 msgid "Reciprocal Seconds Mole" msgstr "Omgekeerde seconden mol" #: ../data/units.xml.in.h:271 msgid "Rem" msgstr "Rem" #: ../data/units.xml.in.h:272 msgid "Rod (pole/perch)" msgstr "Rod (pole/perch)" #: ../data/units.xml.in.h:273 msgid "Roentgen" msgstr "Roentgen" #: ../data/units.xml.in.h:274 msgid "Rood" msgstr "Rood" #: ../data/units.xml.in.h:275 msgid "Second" msgstr "Seconde" #: ../data/units.xml.in.h:276 msgid "Second Ampere" msgstr "Seconde ampere" #: ../data/units.xml.in.h:277 msgid "Section" msgstr "Sectie" #: ../data/units.xml.in.h:278 msgid "Short Hundredweight" msgstr "Short hundredweight" #: ../data/units.xml.in.h:279 msgid "Short Ton" msgstr "Short ton" #: ../data/units.xml.in.h:280 msgid "Siemens" msgstr "Siemens" #: ../data/units.xml.in.h:281 msgid "Sievert" msgstr "Sievert" #: ../data/units.xml.in.h:282 msgid "Solid Angle" msgstr "Ruimtehoek" #: ../data/units.xml.in.h:283 msgid "Specific Energy" msgstr "Soortelijke energie" #: ../data/units.xml.in.h:284 msgid "Specific Entropy" msgstr "Soortelijke entropie" #: ../data/units.xml.in.h:285 msgid "Specific Volume" msgstr "Soortelijk volume" #: ../data/units.xml.in.h:286 msgid "Speed" msgstr "Snelheid" #: ../data/units.xml.in.h:287 msgid "Square Foot" msgstr "Vierkante voet" #: ../data/units.xml.in.h:288 msgid "Square Inch" msgstr "Vierkante inch" #: ../data/units.xml.in.h:289 msgid "Square Kilometer" msgstr "Vierkante kilometer" #: ../data/units.xml.in.h:290 msgid "Square Meter" msgstr "Vierkante meter" #: ../data/units.xml.in.h:291 msgid "Square Meter per Second" msgstr "Vierkante meter per seconde" #: ../data/units.xml.in.h:292 msgid "Square Meter per Square Meter" msgstr "Vierkante meter per vierkante meter" #: ../data/units.xml.in.h:293 msgid "Square Mile" msgstr "Vierkante mijl" #: ../data/units.xml.in.h:294 msgid "Statcoloumb (Franklin)" msgstr "Statcoloumb (Franklin)" #: ../data/units.xml.in.h:295 msgid "Statohm" msgstr "Statohm" #: ../data/units.xml.in.h:296 msgid "Statvolt" msgstr "Statvolt" #: ../data/units.xml.in.h:297 msgid "Steradian" msgstr "Steradiaal" #: ../data/units.xml.in.h:298 msgid "Stilb" msgstr "Stilb" #: ../data/units.xml.in.h:299 msgid "Stokes" msgstr "Stokes" #: ../data/units.xml.in.h:300 msgid "Stone" msgstr "Stone" #: ../data/units.xml.in.h:301 msgid "Substance" msgstr "Stofhoeveelheid" #: ../data/units.xml.in.h:302 msgid "Substance Concentration" msgstr "Concentratie van stof" #: ../data/units.xml.in.h:303 msgid "Surface Tension" msgstr "Oppervlaktespanning" #: ../data/units.xml.in.h:304 msgid "Tablespoon" msgstr "Eetlepel" #: ../data/units.xml.in.h:305 msgid "Teaspoon" msgstr "Theelepel" #: ../data/units.xml.in.h:306 msgid "Temperature" msgstr "Temperatuur" #: ../data/units.xml.in.h:307 msgid "Terabit" msgstr "Terabit" #: ../data/units.xml.in.h:308 msgid "Terabyte" msgstr "Terabyte" #: ../data/units.xml.in.h:309 msgid "Tesla" msgstr "Tesla" #: ../data/units.xml.in.h:310 msgid "Thermal Conductivity" msgstr "Thermisch geleidingsvermogen" #: ../data/units.xml.in.h:312 msgid "Toise" msgstr "Toise" #: ../data/units.xml.in.h:313 msgid "Ton of TNT" msgstr "Ton TNT" #: ../data/units.xml.in.h:314 msgid "Torr" msgstr "Torr" #: ../data/units.xml.in.h:315 msgid "Township" msgstr "Township" #: ../data/units.xml.in.h:316 msgid "Tribble" msgstr "Tribble" #: ../data/units.xml.in.h:317 msgid "Turn" msgstr "Slag" #: ../data/units.xml.in.h:318 msgid "Typography" msgstr "Typografie" #: ../data/units.xml.in.h:319 msgid "U.S. Barrell (oil)" msgstr "U.S. Barrell (olie)" #: ../data/units.xml.in.h:320 msgid "U.S. Bushel" msgstr "U.S. Bushel" #: ../data/units.xml.in.h:321 msgid "U.S. Capacity" msgstr "U.S. Capacity" #: ../data/units.xml.in.h:322 msgid "U.S. Dry Pint" msgstr "U.S. Dry Pint" #: ../data/units.xml.in.h:323 msgid "U.S. Dry Quart" msgstr "U.S. Dry Quart" #: ../data/units.xml.in.h:324 msgid "U.S. Fluid Drachm" msgstr "U.S. Fluid Drachm" #: ../data/units.xml.in.h:325 msgid "U.S. Fluid Ounce" msgstr "U.S. Fluid Ounce" #: ../data/units.xml.in.h:326 msgid "U.S. Gallon" msgstr "U.S. Gallon" #: ../data/units.xml.in.h:327 msgid "U.S. Gill" msgstr "U.S. Gill" #: ../data/units.xml.in.h:328 msgid "U.S. Liquid Pints" msgstr "U.S. Liquid Pints" #: ../data/units.xml.in.h:329 msgid "U.S. Liquid Quarts" msgstr "U.S. Liquid Quarts" #: ../data/units.xml.in.h:330 msgid "U.S. Minim" msgstr "U.S. Minim" #: ../data/units.xml.in.h:331 msgid "U.S. Peck" msgstr "U.S. Peck" #: ../data/units.xml.in.h:332 msgid "U.S. Survey Foot" msgstr "U.S. Survey Foot" #: ../data/units.xml.in.h:333 msgid "U.S. Survey Inch" msgstr "U.S. Survey Inch" #: ../data/units.xml.in.h:334 msgid "U.S. Survey Mile" msgstr "U.S. Survey Mile" #: ../data/units.xml.in.h:335 msgid "Volt" msgstr "Volt" #: ../data/units.xml.in.h:336 msgid "Volt Seconds" msgstr "Volt seconden" #: ../data/units.xml.in.h:337 msgid "Volt per Ampere" msgstr "Volt per ampere" #: ../data/units.xml.in.h:338 msgid "Volt per Meter" msgstr "Volt per meter" #: ../data/units.xml.in.h:339 msgid "Volume" msgstr "Volume" #: ../data/units.xml.in.h:340 msgid "Watt" msgstr "Watt" #: ../data/units.xml.in.h:341 msgid "Watt Hour" msgstr "Wattuur" #: ../data/units.xml.in.h:342 msgid "Watt per Ampere" msgstr "Watt per ampere" #: ../data/units.xml.in.h:343 msgid "Watt per Meter Kelvin" msgstr "Watt per meter Kelvin" #: ../data/units.xml.in.h:344 msgid "Watt per Meter Squared" msgstr "Watt per meter kwadraat" #: ../data/units.xml.in.h:345 msgid "Watt per Square Meter Steradian" msgstr "Watt per vierkante meter per steradiaal" #: ../data/units.xml.in.h:346 msgid "Watt per Steradian" msgstr "Watt per steradiaal" #: ../data/units.xml.in.h:347 msgid "Wave Number" msgstr "Golfgetal" #: ../data/units.xml.in.h:348 msgid "Weber" msgstr "Weber" #: ../data/units.xml.in.h:349 msgid "Weber per Ampere" msgstr "Weber per ampere" #: ../data/units.xml.in.h:350 msgid "Weber per Meter Squared" msgstr "Weber per meter kwadraat" #: ../data/units.xml.in.h:351 msgid "Week" msgstr "Week" #: ../data/units.xml.in.h:352 msgid "Word (16-bit)" msgstr "Word (16-bit)" #: ../data/units.xml.in.h:353 msgid "Yard" msgstr "Yard" #: ../data/units.xml.in.h:354 msgid "Zentner" msgstr "Zentner" #: ../data/units.xml.in.h:355 msgid "a-cr:gTNT,gramTNT" msgstr "" #: ../data/units.xml.in.h:356 msgid "a-cr:mpg" msgstr "" #: ../data/units.xml.in.h:357 msgid "a-cr:mph" msgstr "" #: ../data/units.xml.in.h:358 msgid "a-cr:psi" msgstr "" #: ../data/units.xml.in.h:359 msgid "a-cr:tTNT,tonTNT" msgstr "" #: ../data/units.xml.in.h:360 msgid "ais:cal_IT,ar:cal,c:calorie,cp:calories" msgstr "cal_IT,cal,calorie,calorieën" #: ../data/units.xml.in.h:361 msgid "ar:A,ampere,p:amperes" msgstr "" #: ../data/units.xml.in.h:362 msgid "ar:AU,astronomical_unit,p:astronomical_units" msgstr "AU,astronomische_eenheid,astronomische_eenheden" #: ../data/units.xml.in.h:363 msgid "ar:B,bel,p:bels" msgstr "" #: ../data/units.xml.in.h:364 msgid "ar:Bq,becquerel,p:becquerels" msgstr "" #: ../data/units.xml.in.h:365 msgid "ar:Btu" msgstr "" #: ../data/units.xml.in.h:366 msgid "ar:C,coulomb,p:coulombs" msgstr "" #: ../data/units.xml.in.h:367 msgid "ar:Ci,curie,p:curies" msgstr "" #: ../data/units.xml.in.h:368 msgid "ar:F,farad,p:farads" msgstr "" #: ../data/units.xml.in.h:369 msgid "ar:Gal,galileo,p:galileos" msgstr "" #: ../data/units.xml.in.h:370 msgid "ar:Gy,gray,p:grays" msgstr "" #: ../data/units.xml.in.h:371 msgid "ar:H,henry,p:henrys" msgstr "" #: ../data/units.xml.in.h:372 msgid "ar:Hz,hertz" msgstr "" #: ../data/units.xml.in.h:373 msgid "ar:J,joule,p:joules" msgstr "" #: ../data/units.xml.in.h:374 msgid "ar:K,kelvin,p:kelvins" msgstr "" #: ../data/units.xml.in.h:375 msgid "ar:L,a:l,liter,p:liters,litre,p:litres" msgstr "L,l,liter,liters,liter,liters" #: ../data/units.xml.in.h:376 msgid "ar:Mx,maxwell,p:maxwells" msgstr "" #: ../data/units.xml.in.h:377 msgid "ar:N,newton,p:newtons" msgstr "" #: ../data/units.xml.in.h:378 msgid "ar:Np,neper,p:nepers" msgstr "" #: ../data/units.xml.in.h:379 msgid "ar:Oe,oersted,p:oersteds" msgstr "Oe,oersted,oersteds" #: ../data/units.xml.in.h:380 msgid "ar:P,poise,p:poises" msgstr "" #: ../data/units.xml.in.h:381 msgid "ar:PS,u:pferdestärke" msgstr "pk,paardekracht,paardekrachten" #: ../data/units.xml.in.h:382 msgid "ar:Pa,pascal,p:pascals" msgstr "" #: ../data/units.xml.in.h:383 msgid "ar:R,roentgen,p:roentgens" msgstr "" #: ../data/units.xml.in.h:384 msgid "ar:S,siemens" msgstr "" #: ../data/units.xml.in.h:385 msgid "ar:St,stokes" msgstr "" #: ../data/units.xml.in.h:386 msgid "ar:Sv,sievert,p:sieverts" msgstr "" #: ../data/units.xml.in.h:387 msgid "ar:T,tesla,p:teslas" msgstr "" #: ../data/units.xml.in.h:388 msgid "ar:UK_bu,imperial_bushel,p:imperial_bushels" msgstr "" #: ../data/units.xml.in.h:389 msgid "ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms" msgstr "" #: ../data/units.xml.in.h:390 msgid "ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces" msgstr "" #: ../data/units.xml.in.h:391 msgid "ar:UK_gal,imperial_gallon,p:imperial_gallons" msgstr "" #: ../data/units.xml.in.h:392 msgid "ar:UK_gi,imperial_gill,p:imperial_gills" msgstr "" #: ../data/units.xml.in.h:393 msgid "ar:UK_pt,imperial_pint,p:imperial_pints" msgstr "" #: ../data/units.xml.in.h:394 msgid "ar:UK_qt,imperial_quart,p:imperial_quarts" msgstr "" #: ../data/units.xml.in.h:395 msgid "ar:US_ft,US_foot,p:US_feet" msgstr "" #: ../data/units.xml.in.h:396 msgid "ar:US_in,US_inch,p:US_inches" msgstr "" #: ../data/units.xml.in.h:397 msgid "ar:US_mi,US_mile,p:US_miles" msgstr "" #: ../data/units.xml.in.h:398 msgid "ar:V,volt,p:volts" msgstr "" #: ../data/units.xml.in.h:399 msgid "ar:W,watt,p:watts" msgstr "" #: ../data/units.xml.in.h:400 msgid "ar:Wb,weber,p:webers" msgstr "" #: ../data/units.xml.in.h:401 msgid "ar:a,are,p:ares" msgstr "" #: ../data/units.xml.in.h:402 msgid "ar:atm,atmosphere,p:atmospheres" msgstr "atm,atmosfeer,atmosfeer" #: ../data/units.xml.in.h:403 msgid "ar:b,barn,p:barns" msgstr "" #: ../data/units.xml.in.h:404 msgid "ar:bbl,barrell,p:barrells" msgstr "" #: ../data/units.xml.in.h:405 msgid "ar:bu,bushel,p:bushels" msgstr "" #: ../data/units.xml.in.h:406 msgid "ar:cd,candela,p:candelas" msgstr "" #: ../data/units.xml.in.h:407 msgid "ar:ch,chain,p:chains" msgstr "" #: ../data/units.xml.in.h:408 msgid "ar:cwt,hundredweight,p:hundredweights" msgstr "" #: ../data/units.xml.in.h:409 msgid "ar:d,day,p:days" msgstr "d,dag,dagen" #: ../data/units.xml.in.h:410 msgid "ar:deg,au:°,degree,p:degrees" msgstr "grd,°,graad,graden" #: ../data/units.xml.in.h:411 msgid "ar:dr,dram,p:drams" msgstr "" #: ../data/units.xml.in.h:412 msgid "ar:dry_pt,dry_pint,p:dry_pints" msgstr "" #: ../data/units.xml.in.h:413 msgid "ar:dry_qt,dry_quart,p:dry_quarts" msgstr "" #: ../data/units.xml.in.h:414 msgid "ar:dyn,dyne,p:dynes" msgstr "" #: ../data/units.xml.in.h:415 msgid "ar:eV,electron_volt,p:electron_volts" msgstr "" #: ../data/units.xml.in.h:416 msgid "ar:fc,footcandle,p:footcandles" msgstr "" #: ../data/units.xml.in.h:417 msgid "ar:fl_dr,fluid_drachm,p:fluid_drachms" msgstr "" #: ../data/units.xml.in.h:418 msgid "ar:fl_oz,fluid_ounce,p:fluid_ounces" msgstr "" #: ../data/units.xml.in.h:419 msgid "ar:ft,foot,p:feet" msgstr "" #: ../data/units.xml.in.h:420 msgid "ar:fur,furlong,p:furlongs" msgstr "" #: ../data/units.xml.in.h:421 msgid "ar:g,gram,p:grams" msgstr "g,gram,grammen" #: ../data/units.xml.in.h:422 msgid "ar:gal,gallon,p:gallons" msgstr "" #: ../data/units.xml.in.h:423 msgid "ar:gi,gill,p:gills" msgstr "" #: ../data/units.xml.in.h:424 msgid "ar:gr,grain,p:grains" msgstr "" #: ../data/units.xml.in.h:425 msgid "ar:gra,gradian,p:gradians,gon,p:gons" msgstr "gra,grad,grads,gon,gons" #: ../data/units.xml.in.h:426 msgid "ar:h,hour,p:hours" msgstr "u,uur,uren" #: ../data/units.xml.in.h:427 msgid "ar:hp,horsepower,p:horsepowers" msgstr "" #: ../data/units.xml.in.h:428 msgid "ar:in,inch,p:inches" msgstr "" #: ../data/units.xml.in.h:429 msgid "ar:inHg" msgstr "" #: ../data/units.xml.in.h:430 msgid "ar:kat,katal,p:katals" msgstr "" #: ../data/units.xml.in.h:431 msgid "ar:l_cwt,long_hundredweight,p:long_hundredweights" msgstr "" #: ../data/units.xml.in.h:432 msgid "ar:l_ton,long_ton,p:long_tons" msgstr "" #: ../data/units.xml.in.h:433 msgid "ar:lb,pound,p:pounds" msgstr "" #: ../data/units.xml.in.h:434 msgid "ar:lb_t,troy_pound,p:troy_pounds" msgstr "" #: ../data/units.xml.in.h:435 msgid "ar:lbf,pound_force" msgstr "" #: ../data/units.xml.in.h:436 msgid "ar:li,link,p:links" msgstr "" #: ../data/units.xml.in.h:437 msgid "ar:liq_pt,liquid_pint,p:liquid_pints" msgstr "" #: ../data/units.xml.in.h:438 msgid "ar:liq_qt,liquid_quart,p:liquid_quarts" msgstr "" #: ../data/units.xml.in.h:439 msgid "ar:lm,lumen,p:lumens" msgstr "lm,lumen" #: ../data/units.xml.in.h:440 msgid "ar:lx,lux" msgstr "" #: ../data/units.xml.in.h:441 msgid "ar:ly,lightyear,p:lightyears" msgstr "lj,lichtjaar,lichtjaren" #: ../data/units.xml.in.h:442 msgid "ar:m,meter,p:meters,metre,p:metres" msgstr "m,meter,meters" #: ../data/units.xml.in.h:443 msgid "ar:mi,mile,p:miles" msgstr "mi,mijl,mijlen" #: ../data/units.xml.in.h:444 msgid "ar:min,minute,p:minutes" msgstr "min,minuut,minuten" #: ../data/units.xml.in.h:445 msgid "ar:mmHg" msgstr "" #: ../data/units.xml.in.h:446 msgid "ar:mol,mole,p:moles" msgstr "mol,mol,molen" #: ../data/units.xml.in.h:447 msgid "ar:oC,au:°C,r:celcius" msgstr "" #: ../data/units.xml.in.h:448 msgid "ar:oF,au:°F,r:fahrenheit" msgstr "" #: ../data/units.xml.in.h:449 msgid "ar:oR,au:°R,r:rankine" msgstr "" #: ../data/units.xml.in.h:450 msgid "ar:oz,ounce,p:ounces" msgstr "" #: ../data/units.xml.in.h:451 msgid "ar:oz_t,troy_ounce,p:troy_ounces" msgstr "" #: ../data/units.xml.in.h:452 msgid "ar:pc,parsec,p:parsecs" msgstr "" #: ../data/units.xml.in.h:453 msgid "ar:ph,phot,p:phots" msgstr "" #: ../data/units.xml.in.h:454 msgid "ar:pk,peck,p:pecks" msgstr "" #: ../data/units.xml.in.h:455 msgid "ar:pt,a:pts,point,p:points" msgstr "" #: ../data/units.xml.in.h:456 msgid "ar:pwt,pennyweight,p:pennyweights" msgstr "" #: ../data/units.xml.in.h:457 msgid "ar:rad,radian,p:radians" msgstr "rad,radiaal,radialen" #: ../data/units.xml.in.h:458 msgid "ar:rd,rod,p:rods" msgstr "" #: ../data/units.xml.in.h:459 msgid "ar:s,second,p:seconds" msgstr "s,seconde,seconden" #: ../data/units.xml.in.h:460 msgid "ar:s_ton,short_ton,p:short_tons" msgstr "" #: ../data/units.xml.in.h:461 msgid "ar:sb,stilb,p:stilbs" msgstr "" #: ../data/units.xml.in.h:462 msgid "ar:sr,steradian,p:steradians" msgstr "sr,steradiaal,steradialen" #: ../data/units.xml.in.h:463 msgid "ar:t,tonne,p:tonnes,ton,p:tons" msgstr "t,ton,tonnen" #: ../data/units.xml.in.h:464 msgid "ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units" msgstr "AMU,atomaire_massa_eenheid,atomaire_massa_eenheden" #: ../data/units.xml.in.h:465 msgid "ar:yd,yard,p:yards" msgstr "" #: ../data/units.xml.in.h:466 msgid "ars:cal_fifteen" msgstr "cal_fifteen" #: ../data/units.xml.in.h:467 msgid "ars:cal_mean" msgstr "cal_gemiddeld" #: ../data/units.xml.in.h:468 msgid "ars:cal_th" msgstr "cal_th" #: ../data/units.xml.in.h:469 msgid "aru:Å,u:ångström,angstrom" msgstr "" #: ../data/units.xml.in.h:470 msgid "au:Ω,r:ohm,p:ohms" msgstr "Ω,ohm" #: ../data/units.xml.in.h:471 msgid "cr:Calorie,cp:Calories" msgstr "Calorie,Calorieën" #: ../data/units.xml.in.h:472 msgid "r:abampere,a:abA,a:aA,p:abamperes" msgstr "" #: ../data/units.xml.in.h:473 msgid "r:abcoulomb,p:abcoulombs,a:abC,a:aC" msgstr "" #: ../data/units.xml.in.h:474 msgid "r:abohm,p:abohms,au:abΩ" msgstr "abohm, abohms,abΩ" #: ../data/units.xml.in.h:475 msgid "r:abvolt,p:abvolts,a:abV" msgstr "" #: ../data/units.xml.in.h:476 msgid "r:acre,p:acres" msgstr "" #: ../data/units.xml.in.h:477 msgid "r:arcminute,p:arcminutes" msgstr "boogminuut,boogminuten" #: ../data/units.xml.in.h:478 msgid "r:arcsecond,p:arcseconds" msgstr "boogseconde,boogseconden" #: ../data/units.xml.in.h:479 msgid "r:ata_pica,p:ata_picas" msgstr "" #: ../data/units.xml.in.h:480 msgid "r:ata_point,a:ata_pt,p:ata_points" msgstr "" #: ../data/units.xml.in.h:481 msgid "r:bar,p:bars" msgstr "bar" #: ../data/units.xml.in.h:482 msgid "r:bit,p:bits" msgstr "" #: ../data/units.xml.in.h:483 msgid "r:byte,p:bytes,octet,p:octets" msgstr "" #: ../data/units.xml.in.h:484 msgid "r:carat,p:carats" msgstr "karaat" #: ../data/units.xml.in.h:485 msgid "r:cental,p:centals" msgstr "" #: ../data/units.xml.in.h:486 msgid "r:cicero" msgstr "" #: ../data/units.xml.in.h:487 msgid "r:cup,p:cups" msgstr "kop,p:koppen" #: ../data/units.xml.in.h:488 msgid "r:dessertspoon,p:dessertspoons" msgstr "dessertlepel,dessertlepels" #: ../data/units.xml.in.h:489 msgid "r:didot,a:dd" msgstr "" #: ../data/units.xml.in.h:490 msgid "r:einstein,p:einsteins" msgstr "" #: ../data/units.xml.in.h:491 msgid "r:erg,p:ergs" msgstr "" #: ../data/units.xml.in.h:492 msgid "r:fathom,p:fathoms" msgstr "vadem,vadems" #: ../data/units.xml.in.h:493 msgid "r:foe,p:foes" msgstr "" #: ../data/units.xml.in.h:494 msgid "r:fortnight,p:fortnights" msgstr "" #: ../data/units.xml.in.h:495 msgid "r:gauss" msgstr "" #: ../data/units.xml.in.h:496 msgid "r:gee,p:gees" msgstr "" #: ../data/units.xml.in.h:497 msgid "r:hand,p:hands" msgstr "" #: ../data/units.xml.in.h:498 msgid "r:imperial_fluid_scuple,p:imperial_fluid_scuples" msgstr "" #: ../data/units.xml.in.h:499 msgid "r:imperial_minim,p:imperial_minims" msgstr "" #: ../data/units.xml.in.h:500 msgid "r:knot,p:knots" msgstr "knoop,knopen" #: ../data/units.xml.in.h:501 msgid "r:ligne" msgstr "" #: ../data/units.xml.in.h:502 msgid "r:mil,p:mils" msgstr "" #: ../data/units.xml.in.h:503 msgid "r:minim,p:minims" msgstr "" #: ../data/units.xml.in.h:504 msgid "r:nautical_mile,p:nautical_miles" msgstr "nautische_mijl,nautische_mijlen" #: ../data/units.xml.in.h:505 msgid "r:new_didot" msgstr "nieuwe_didot" #: ../data/units.xml.in.h:506 msgid "r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets" msgstr "" #: ../data/units.xml.in.h:507 msgid "r:pfund" msgstr "" #: ../data/units.xml.in.h:508 msgid "r:pica,p:picas" msgstr "" #: ../data/units.xml.in.h:509 msgid "r:pied_du_roi" msgstr "" #: ../data/units.xml.in.h:510 msgid "r:pond,p:ponds,a:gf" msgstr "pond,ponden,gf" #: ../data/units.xml.in.h:511 msgid "r:pouce" msgstr "" #: ../data/units.xml.in.h:512 msgid "r:poundal,p:poundals,a:pdl" msgstr "" #: ../data/units.xml.in.h:513 msgid "r:rad_radioactivity" msgstr "" #: ../data/units.xml.in.h:514 msgid "r:rem_radioactivity" msgstr "" #: ../data/units.xml.in.h:515 msgid "r:rood,p:roods" msgstr "" #: ../data/units.xml.in.h:516 msgid "r:section,p:sections" msgstr "sectie,secties" #: ../data/units.xml.in.h:517 msgid "r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins" msgstr "" #: ../data/units.xml.in.h:518 msgid "r:statohm,p:statohms,au:statΩ" msgstr "" #: ../data/units.xml.in.h:519 msgid "r:statvolt,p:statvolts,a:statV" msgstr "" #: ../data/units.xml.in.h:520 msgid "r:stone,p:stones" msgstr "" #: ../data/units.xml.in.h:521 msgid "r:tablespoon,p:tablespoons" msgstr "eetlepel,eetlepels" #: ../data/units.xml.in.h:522 msgid "r:teaspoon,p:teaspoons" msgstr "theelepel,theelepels" #: ../data/units.xml.in.h:523 msgid "r:toise" msgstr "" #: ../data/units.xml.in.h:524 msgid "r:torr,p:torrs" msgstr "" #: ../data/units.xml.in.h:525 msgid "r:township,p:townships" msgstr "" #: ../data/units.xml.in.h:526 msgid "r:tribble,p:tribbles" msgstr "" #: ../data/units.xml.in.h:527 msgid "r:turn,p:turns" msgstr "slag,slagen" #: ../data/units.xml.in.h:528 msgid "r:week,p:weeks" msgstr "week,weken" #: ../data/units.xml.in.h:529 msgid "r:word,p:words" msgstr "woord,woorden" #: ../data/units.xml.in.h:530 msgid "r:year,p:years" msgstr "jaar,jaren" #: ../data/units.xml.in.h:531 msgid "r:zentner" msgstr "" #: ../data/variables.xml.in.h:1 msgid "-r:billion" msgstr "miljard" #: ../data/variables.xml.in.h:2 msgid "-r:centillion" msgstr "quinquagintiljard" #: ../data/variables.xml.in.h:3 msgid "-r:decillion" msgstr "quintiljard" #: ../data/variables.xml.in.h:4 msgid "-r:duodecillion" msgstr "sextiljard" #: ../data/variables.xml.in.h:5 msgid "-r:hundred" msgstr "honderd" #: ../data/variables.xml.in.h:6 msgid "-r:million" msgstr "miljoen" #: ../data/variables.xml.in.h:7 msgid "-r:nonillion" msgstr "quintiljoen" #: ../data/variables.xml.in.h:8 msgid "-r:novemdecillion" msgstr "deciljoen" #: ../data/variables.xml.in.h:9 msgid "-r:octillion" msgstr "quadriljard" #: ../data/variables.xml.in.h:10 msgid "-r:octodecillion" msgstr "noniljard" #: ../data/variables.xml.in.h:11 msgid "-r:quadrillion" msgstr "biljard" #: ../data/variables.xml.in.h:12 msgid "-r:quattuordecillion" msgstr "septiljard" #: ../data/variables.xml.in.h:13 msgid "-r:quindecillion" msgstr "octiljoen" #: ../data/variables.xml.in.h:14 msgid "-r:quintillion" msgstr "triljoen" #: ../data/variables.xml.in.h:15 msgid "-r:septendecillion" msgstr "noniljoen" #: ../data/variables.xml.in.h:16 msgid "-r:septillion" msgstr "quadriljoen" #: ../data/variables.xml.in.h:17 msgid "-r:sexdecillion" msgstr "octiljard" #: ../data/variables.xml.in.h:18 msgid "-r:sextillion" msgstr "triljard" #: ../data/variables.xml.in.h:19 msgid "-r:thousand" msgstr "duizend" #: ../data/variables.xml.in.h:20 msgid "-r:tredecillion" msgstr "septiljoen" #: ../data/variables.xml.in.h:21 msgid "-r:trillion" msgstr "biljoen" #: ../data/variables.xml.in.h:22 msgid "-r:undecillion" msgstr "sextiljoen" #: ../data/variables.xml.in.h:23 msgid "-r:vigintillion" msgstr "deciljard" #: ../data/variables.xml.in.h:24 msgid "Alpha Particle Mass" msgstr "Massa alfadeeltje" #: ../data/variables.xml.in.h:25 msgid "Apery's Constant" msgstr "Apery's constante" #: ../data/variables.xml.in.h:26 msgid "Archimede's Constant (pi)" msgstr "Archimede's constante (pi)" #: ../data/variables.xml.in.h:27 msgid "Atomic Mass Constant" msgstr "Atomaire massaconstante" #: ../data/variables.xml.in.h:28 msgid "Atomic and Nuclear Constants" msgstr "Atomaire- en nucleaire constanten" #: ../data/variables.xml.in.h:29 msgid "Avogadro Constant" msgstr "Avogadro's constante" #: ../data/variables.xml.in.h:30 msgid "Base of Natural Logarithms (e)" msgstr "Grondtal natuurlijke logaritmen (e)" #: ../data/variables.xml.in.h:31 msgid "Basic Constants" msgstr "Basisconstanten" #: ../data/variables.xml.in.h:32 msgid "Billion" msgstr "Miljard" #: ../data/variables.xml.in.h:33 msgid "Bohr Radius" msgstr "Bohr-straal" #: ../data/variables.xml.in.h:34 msgid "Boltzmann Constant" msgstr "Constante van Boltzmann" #: ../data/variables.xml.in.h:35 msgid "Borh Magneton" msgstr "Borh Magneton" #: ../data/variables.xml.in.h:36 msgid "Catalan's Constant" msgstr "Catalan's constante" #: ../data/variables.xml.in.h:37 msgid "Centillion" msgstr "Quinquagintiljard" #: ../data/variables.xml.in.h:38 msgid "Characteristic Impedance of Vacuum" msgstr "Karakteristieke impedantie vacuüm" #: ../data/variables.xml.in.h:39 msgid "Classical Electron Radius" msgstr "Klassieke straal elektron" #: ../data/variables.xml.in.h:40 msgid "Compton Wavelength" msgstr "Compton golflengte" #: ../data/variables.xml.in.h:41 msgid "Conductance Quantum" msgstr "Geleidingsvermogen kwantum" #: ../data/variables.xml.in.h:42 msgid "Decillion" msgstr "Quintiljard" #: ../data/variables.xml.in.h:43 msgid "Duodecillion" msgstr "Sextiljard" #: ../data/variables.xml.in.h:44 msgid "Electric Constant (Permittivity of Free Space)" msgstr "Elektrische constante (permittiviteit vrije ruimte)" #: ../data/variables.xml.in.h:45 msgid "Electromagnetic Constants" msgstr "Elektromagnetische constanten" #: ../data/variables.xml.in.h:46 msgid "Electron Mass" msgstr "Elektronmassa" #: ../data/variables.xml.in.h:47 msgid "Elementary Charge" msgstr "Elementaire lading" #: ../data/variables.xml.in.h:48 msgid "Euler's Constant" msgstr "Euler's constante" #: ../data/variables.xml.in.h:49 msgid "False" msgstr "Onwaar" #: ../data/variables.xml.in.h:50 msgid "Faraday Constant" msgstr "Faraday constante" #: ../data/variables.xml.in.h:51 msgid "First Radiation Constant" msgstr "Eerste stralingsconstante" #: ../data/variables.xml.in.h:52 msgid "Golden Ratio" msgstr "Gulden snede" #: ../data/variables.xml.in.h:53 msgid "Googol" msgstr "Googol" #: ../data/variables.xml.in.h:54 msgid "Googolplex" msgstr "Googolplex" #: ../data/variables.xml.in.h:55 msgid "Helion Mass" msgstr "Helionmassa" #: ../data/variables.xml.in.h:56 msgid "Hundred" msgstr "Honderd" #: ../data/variables.xml.in.h:57 msgid "Ideal Gas Constant" msgstr "Ideale gasconstante" #: ../data/variables.xml.in.h:58 msgid "Imaginary i (sqrt -1)" msgstr "Imaginaire i (sqrt -1)" #: ../data/variables.xml.in.h:59 msgid "Infinity" msgstr "Oneindig" #: ../data/variables.xml.in.h:60 msgid "Josephson Constant" msgstr "Josephson constante" #: ../data/variables.xml.in.h:61 msgid "Large Numbers" msgstr "Grote getallen" #: ../data/variables.xml.in.h:62 msgid "Magnetic Constant (Permeability of Free Space)" msgstr "Magnetische constante (permeabiliteit vrije ruimte)" #: ../data/variables.xml.in.h:63 msgid "Magnetic Flux Quantum" msgstr "Magnetische flux kwantum" #: ../data/variables.xml.in.h:64 msgid "Million" msgstr "Miljoen" #: ../data/variables.xml.in.h:65 msgid "Negative Infinity" msgstr "Negatief oneindig" #: ../data/variables.xml.in.h:66 msgid "Neutron Mass" msgstr "Neutronmassa" #: ../data/variables.xml.in.h:67 msgid "Newtonian Constant of Gravitation" msgstr "Newtons zwaartekrachtconstante" #: ../data/variables.xml.in.h:68 msgid "Nonillion" msgstr "Quintiljoen" #: ../data/variables.xml.in.h:69 msgid "Novemdecillion" msgstr "deciljoen" #: ../data/variables.xml.in.h:70 msgid "Nuclear Magneton" msgstr "Nucleaire magneton" #: ../data/variables.xml.in.h:71 msgid "Octillion" msgstr "Quadriljard" #: ../data/variables.xml.in.h:72 msgid "Octodecillion" msgstr "Noniljard" #: ../data/variables.xml.in.h:73 msgid "Omega Constant" msgstr "Omega constante" #: ../data/variables.xml.in.h:74 msgid "Per Mille" msgstr "Per mille" #: ../data/variables.xml.in.h:75 msgid "Per Myriad" msgstr "Per myriad" #: ../data/variables.xml.in.h:76 msgid "Physical Constants" msgstr "Natuurkundige constanten" #: ../data/variables.xml.in.h:77 msgid "Physico-Chemical Constants" msgstr "Fysisch-chemische constanten" #: ../data/variables.xml.in.h:78 msgid "Planck Constant" msgstr "Planck constante" #: ../data/variables.xml.in.h:79 msgid "Planck Constant over 2 pi" msgstr "Planck constante gedeeld door 2 pi" #: ../data/variables.xml.in.h:80 msgid "Planck Length" msgstr "Plancklengte" #: ../data/variables.xml.in.h:81 msgid "Planck Mass" msgstr "Planckmassa" #: ../data/variables.xml.in.h:82 msgid "Planck Temperature" msgstr "Plancktemperatuur" #: ../data/variables.xml.in.h:83 msgid "Planck Time" msgstr "Plancktijd" #: ../data/variables.xml.in.h:84 msgid "Positive Infinity" msgstr "Positief oneindig" #: ../data/variables.xml.in.h:85 msgid "Procent" msgstr "Procent" #: ../data/variables.xml.in.h:86 msgid "Proton Mass" msgstr "Protonmassa" #: ../data/variables.xml.in.h:87 msgid "Pythagora's Constant (sqrt 2)" msgstr "Pythagoras constante (sqrt 2)" #: ../data/variables.xml.in.h:88 msgid "Quadrillion" msgstr "Biljard" #: ../data/variables.xml.in.h:89 msgid "Quattuordecillion" msgstr "Septiljard" #: ../data/variables.xml.in.h:90 msgid "Quindecillion" msgstr "Octiljoen" #: ../data/variables.xml.in.h:91 msgid "Quintillion" msgstr "Triljoen" #: ../data/variables.xml.in.h:92 msgid "Rydberg Constant" msgstr "Rydberg constante" #: ../data/variables.xml.in.h:93 msgid "Second Radiation Constant" msgstr "Tweede stralingsconstante" #: ../data/variables.xml.in.h:94 msgid "Septendecillion" msgstr "Noniljoen" #: ../data/variables.xml.in.h:95 msgid "Septillion" msgstr "Quadriljoen" #: ../data/variables.xml.in.h:96 msgid "Sexdecillion" msgstr "Octiljard" #: ../data/variables.xml.in.h:97 msgid "Sextillion" msgstr "Triljard" #: ../data/variables.xml.in.h:98 msgid "Small Numbers" msgstr "Kleine getallen" #: ../data/variables.xml.in.h:99 msgid "Special Numbers" msgstr "Bijzondere getallen" #: ../data/variables.xml.in.h:100 msgid "Speed of Light in Vacuum" msgstr "Lichtsnelheid in vacuüm" #: ../data/variables.xml.in.h:101 msgid "Tau Mass" msgstr "Tau massa" #: ../data/variables.xml.in.h:102 msgid "Thousand" msgstr "Duizend" #: ../data/variables.xml.in.h:103 msgid "Tredecillion" msgstr "Septiljoen" #: ../data/variables.xml.in.h:104 msgid "Trillion" msgstr "Biljoen" #: ../data/variables.xml.in.h:105 msgid "True" msgstr "Waar" #: ../data/variables.xml.in.h:106 msgid "Undecillion" msgstr "Sextiljoen" #: ../data/variables.xml.in.h:107 msgid "Undefined" msgstr "Ongedefinieerd" #: ../data/variables.xml.in.h:108 msgid "Universal Constants" msgstr "Universele constanten" #: ../data/variables.xml.in.h:109 msgid "Unknowns" msgstr "Onbekenden" #: ../data/variables.xml.in.h:110 msgid "Vigintillion" msgstr "Deciljard" #: ../data/variables.xml.in.h:112 #, no-c-format msgid "a:%,r:procent" msgstr "" #: ../data/variables.xml.in.h:113 msgid "ar:c,speed_of_light" msgstr "c,licht_snelheid" #: ../data/variables.xml.in.h:114 msgid "au:γ,r:euler" msgstr "" #: ../data/variables.xml.in.h:115 msgid "au:π,r:pi" msgstr "" #: ../data/variables.xml.in.h:116 msgid "r:alpha_particle_mass,aisu:m_α" msgstr "alfa_deeltje_massa,m_α" #: ../data/variables.xml.in.h:117 msgid "r:apery" msgstr "" #: ../data/variables.xml.in.h:118 msgid "r:atomic_mass,ais:m_u" msgstr "atoommassa,m_u" #: ../data/variables.xml.in.h:119 msgid "r:avogadro,ais:N_A" msgstr "" #: ../data/variables.xml.in.h:120 msgid "r:bohr_magneton,aisu:μ_B" msgstr "" #: ../data/variables.xml.in.h:121 msgid "r:bohr_radius,ais:a_o" msgstr "" #: ../data/variables.xml.in.h:122 msgid "r:boltzmann" msgstr "" #: ../data/variables.xml.in.h:123 msgid "r:catalan" msgstr "" #: ../data/variables.xml.in.h:124 msgid "r:characteristic_impedance,ais:Z_0" msgstr "karakteristieke_impedantie,Z_0" #: ../data/variables.xml.in.h:125 msgid "r:classical_electron_radius,ais:r_e" msgstr "klassieke_electron_radius,r_e" #: ../data/variables.xml.in.h:126 msgid "r:compton_wavelength,aisu:λ_C" msgstr "compton_golflengte,λ_C" #: ../data/variables.xml.in.h:127 msgid "r:conductance_quantum,ais:G_0" msgstr "geleidings_kwantum,G_0" #: ../data/variables.xml.in.h:128 msgid "r:e" msgstr "" #: ../data/variables.xml.in.h:129 msgid "r:electric_constant,aisu:ε_0" msgstr "elektrische_constante,ε_0" #: ../data/variables.xml.in.h:130 msgid "r:electron_mass,ais:m_e" msgstr "elektron_massa,m_e" #: ../data/variables.xml.in.h:131 msgid "r:elementary_charge,ais:e_charge" msgstr "elementaire_lading,e_lading" #: ../data/variables.xml.in.h:132 msgid "r:false,r:no" msgstr "onwaar,nee" #: ../data/variables.xml.in.h:133 msgid "r:faraday" msgstr "" #: ../data/variables.xml.in.h:134 msgid "r:first_radiation,ais:c_1" msgstr "eerste_straling,c_1" #: ../data/variables.xml.in.h:135 msgid "r:golden,au:φ" msgstr "gouden,φ" #: ../data/variables.xml.in.h:136 msgid "r:googol" msgstr "" #: ../data/variables.xml.in.h:137 msgid "r:googolplex" msgstr "" #: ../data/variables.xml.in.h:138 msgid "r:helion_mass,ais:m_h" msgstr "helion_massa,m_h" #: ../data/variables.xml.in.h:139 msgid "r:i" msgstr "." #: ../data/variables.xml.in.h:140 msgid "r:ideal_gas" msgstr "ideale_gas" #: ../data/variables.xml.in.h:141 msgid "r:infinity" msgstr "oneindig" #: ../data/variables.xml.in.h:142 msgid "r:josephson,ais:K_J" msgstr "" #: ../data/variables.xml.in.h:143 msgid "r:klitzing,ais:R_K" msgstr "" #: ../data/variables.xml.in.h:144 msgid "r:magnetic_constant,aisu:μ_0" msgstr "magnetische_constante,μ_0" #: ../data/variables.xml.in.h:145 msgid "r:magnetic_flux_quantum,aisu:Φ_0" msgstr "magnetische_flux_kwantum,Φ_0" #: ../data/variables.xml.in.h:146 msgid "r:minus_infinity" msgstr "min_oneindig" #: ../data/variables.xml.in.h:147 msgid "r:neutron_mass,ais:m_n" msgstr "neutron_massa,m_n" #: ../data/variables.xml.in.h:148 msgid "r:newtonian_constant,a:G" msgstr "newton_constante,G" #: ../data/variables.xml.in.h:149 msgid "r:nuclear_magneton,aisu:μ_N" msgstr "nucleaire_magneton,μ_N" #: ../data/variables.xml.in.h:150 msgid "r:omega" msgstr "" #: ../data/variables.xml.in.h:151 msgid "r:permille,au:‰" msgstr "" #: ../data/variables.xml.in.h:152 msgid "r:permyriad,au:‱" msgstr "" #: ../data/variables.xml.in.h:153 msgid "r:planck" msgstr "" #: ../data/variables.xml.in.h:154 msgid "r:planck2pi" msgstr "" #: ../data/variables.xml.in.h:155 msgid "r:planck_length,ais:l_P" msgstr "planck_lengte,l_P" #: ../data/variables.xml.in.h:156 msgid "r:planck_mass,ais:m_P" msgstr "planck_massa,m_P" #: ../data/variables.xml.in.h:157 msgid "r:planck_temperature,ais:T_P" msgstr "planck_temperatuur,T_P" #: ../data/variables.xml.in.h:158 msgid "r:planck_time,ais:t_P" msgstr "planck_tijd,t_P" #: ../data/variables.xml.in.h:159 msgid "r:plus_infinity" msgstr "plus_oneindig" #: ../data/variables.xml.in.h:160 msgid "r:proton_mass,ais:m_p" msgstr "proton_massa,m_p" #: ../data/variables.xml.in.h:161 msgid "r:pythagoras" msgstr "" #: ../data/variables.xml.in.h:162 msgid "r:rydberg,aisu:R_∞" msgstr "" #: ../data/variables.xml.in.h:163 msgid "r:second_radiation,ais:c_2" msgstr "tweede_straling,c_2" #: ../data/variables.xml.in.h:164 msgid "r:tau_mass,aisu:m_τ" msgstr "tau_massa,m_τ" #: ../data/variables.xml.in.h:165 msgid "r:true,r:yes" msgstr "waar,ja" #: ../data/variables.xml.in.h:166 msgid "r:undefined" msgstr "ongedefinieerd" #: ../data/variables.xml.in.h:167 msgid "r:x" msgstr "" #: ../data/variables.xml.in.h:168 msgid "r:y" msgstr "" #: ../data/variables.xml.in.h:169 msgid "r:z" msgstr "" #: ../data/variables.xml.in.h:170 msgid "von Klitzing Constant" msgstr "von Klitzing constante" libqalculate-0.9.7/po-defs/ChangeLog0000644000175100017510000000000011305546373014220 00000000000000libqalculate-0.9.7/po-defs/zh_CN.po0000644000175100017510000050760011305546374014032 00000000000000# translation of zh_CN.po to Simplified Chinese # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Roy Qu , 2007. msgid "" msgstr "" "Project-Id-Version: zh_CN\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-08-03 13:19+0800\n" "PO-Revision-Date: 2007-08-04 23:40+0800\n" "Last-Translator: Roy Qu \n" "Language-Team: Simplified Chinese\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" #: ../data/currencies.xml.in.h:1 msgid "Australian Dollars" msgstr "澳大利亚元" #: ../data/currencies.xml.in.h:2 msgid "Austrian Schilling" msgstr "奥地利先令" #: ../data/currencies.xml.in.h:3 msgid "Belgian Franc" msgstr "比利时法郎" #: ../data/currencies.xml.in.h:4 msgid "British Pounds" msgstr "英镑" #: ../data/currencies.xml.in.h:5 msgid "Bulgarian Lev" msgstr "保加利亚列弗" #: ../data/currencies.xml.in.h:6 msgid "Canadian Dollars" msgstr "加拿大元" #: ../data/currencies.xml.in.h:7 msgid "Cent (USD)" msgstr "美分" #: ../data/currencies.xml.in.h:8 msgid "Croatian Kuna" msgstr "克罗地亚" #: ../data/currencies.xml.in.h:9 msgid "Currency" msgstr "货币" #: ../data/currencies.xml.in.h:10 msgid "Cypriot Pound" msgstr "塞浦路斯镑" #: ../data/currencies.xml.in.h:11 msgid "Czech Koruna" msgstr "捷克克朗" #: ../data/currencies.xml.in.h:12 msgid "Danish Kroner" msgstr "丹麦Kroner" #: ../data/currencies.xml.in.h:13 msgid "Deutche Mark" msgstr "" #: ../data/currencies.xml.in.h:14 msgid "Dutch Guilder" msgstr "荷兰盾" #: ../data/currencies.xml.in.h:15 msgid "Estonian Kroon" msgstr "爱沙尼亚克鲁恩" #: ../data/currencies.xml.in.h:16 msgid "Euro Cent" msgstr "欧元分" #: ../data/currencies.xml.in.h:17 msgid "European Euros" msgstr "欧元" #: ../data/currencies.xml.in.h:18 msgid "Finnish Markka" msgstr "芬兰马克" #: ../data/currencies.xml.in.h:19 msgid "French Franc" msgstr "法国法郎" #: ../data/currencies.xml.in.h:20 msgid "Greek Drachma" msgstr "希腊德拉马克" #: ../data/currencies.xml.in.h:21 msgid "Hong Kong Dollars" msgstr "港币" #: ../data/currencies.xml.in.h:22 msgid "Hungarian Forint" msgstr "匈牙利福林" #: ../data/currencies.xml.in.h:23 msgid "Icelandic Krona" msgstr "冰岛克朗" #: ../data/currencies.xml.in.h:24 msgid "Indonesian Rupiah" msgstr "印尼卢比" #: ../data/currencies.xml.in.h:25 msgid "Irish Pound" msgstr "爱尔兰镑" #: ../data/currencies.xml.in.h:26 msgid "Italian Lira" msgstr "意大利里拉" #: ../data/currencies.xml.in.h:27 msgid "Japanese Yen" msgstr "日元" #: ../data/currencies.xml.in.h:28 msgid "Latvian Lat" msgstr "拉脱维亚 Lat" #: ../data/currencies.xml.in.h:29 msgid "Lithuanian Lit" msgstr "立陶宛Lit" #: ../data/currencies.xml.in.h:30 msgid "Luxembourg Franc" msgstr "卢森堡法郎" #: ../data/currencies.xml.in.h:31 msgid "Malaysian Ringgit" msgstr "马来西亚林吉特" #: ../data/currencies.xml.in.h:32 msgid "Maltese Lira" msgstr "马耳他里拉" #: ../data/currencies.xml.in.h:33 msgid "New Zealand Dollars" msgstr "新西兰元" #: ../data/currencies.xml.in.h:34 msgid "Norwegian Kroner" msgstr "挪威Kroner" #: ../data/currencies.xml.in.h:35 msgid "Phillipine Peso" msgstr "菲律宾比索" #: ../data/currencies.xml.in.h:36 msgid "Polish Zloty" msgstr "波兰兹罗提" #: ../data/currencies.xml.in.h:37 msgid "Portuguese Escudo" msgstr "葡萄牙埃斯库多" #: ../data/currencies.xml.in.h:38 msgid "Romanian New Leu" msgstr "罗马尼亚新Leu" #: ../data/currencies.xml.in.h:39 msgid "Russian Ruble" msgstr "俄罗斯卢布" #: ../data/currencies.xml.in.h:40 msgid "Singapore Dollars" msgstr "新加坡元" #: ../data/currencies.xml.in.h:41 msgid "Slovakian Koruna" msgstr "斯洛伐克Koruna" #: ../data/currencies.xml.in.h:42 msgid "Slovenian Tolar" msgstr "斯洛文尼亚Tolar" #: ../data/currencies.xml.in.h:43 msgid "South African Rand" msgstr "南非兰特" #: ../data/currencies.xml.in.h:44 msgid "South Korean Won" msgstr "韩元" #: ../data/currencies.xml.in.h:45 msgid "Spanish Peseta" msgstr "西班牙比塞塔" #: ../data/currencies.xml.in.h:46 msgid "Swedish Krona" msgstr "瑞典克郎" #: ../data/currencies.xml.in.h:47 msgid "Swiss Francs" msgstr "瑞士法郎" #: ../data/currencies.xml.in.h:48 msgid "Thai Bat" msgstr "泰国Bat" #: ../data/currencies.xml.in.h:49 msgid "Turkish New Lira" msgstr "土耳其新里拉" #: ../data/currencies.xml.in.h:50 msgid "U.S. Dollars" msgstr "美元" #: ../data/currencies.xml.in.h:51 msgid "Yuan Renmimbi (PR China)" msgstr "人民币元" #: ../data/currencies.xml.in.h:52 msgid "a:$,ar:USD,dollar,p:dollars" msgstr "a:$,ar:USD,美元" #: ../data/currencies.xml.in.h:53 msgid "ar:ATS,schilling" msgstr "ar:ATS,先令" #: ../data/currencies.xml.in.h:54 msgid "ar:AUD" msgstr "ar:AUD" #: ../data/currencies.xml.in.h:55 msgid "ar:BEF" msgstr "ar:BEF" #: ../data/currencies.xml.in.h:56 msgid "ar:CAD" msgstr "ar:CAD" #: ../data/currencies.xml.in.h:57 msgid "ar:CHF" msgstr "ar:CHF" #: ../data/currencies.xml.in.h:58 msgid "ar:CNY" msgstr "ar:CNY" #: ../data/currencies.xml.in.h:59 msgid "ar:CYP" msgstr "ar:CYP" #: ../data/currencies.xml.in.h:60 msgid "ar:CZK" msgstr "ar:CZK" #: ../data/currencies.xml.in.h:61 msgid "ar:DEM,mark" msgstr "ar:DEM,马克" #: ../data/currencies.xml.in.h:62 msgid "ar:DKK" msgstr "ar:DKK" #: ../data/currencies.xml.in.h:63 msgid "ar:EEK" msgstr "ar:EEK" #: ../data/currencies.xml.in.h:64 msgid "ar:ESP,peseta,p:pesetas" msgstr "ar:ESP,peseta,p:pesetas" #: ../data/currencies.xml.in.h:65 msgid "ar:EUR,au:€,euro,p:euros" msgstr "ar:EUR,au:€,欧元" #: ../data/currencies.xml.in.h:66 msgid "ar:FIM,markka" msgstr "ar:FIM,markka" #: ../data/currencies.xml.in.h:67 msgid "ar:FRF,franc" msgstr "ar:FRF,法郎" #: ../data/currencies.xml.in.h:68 msgid "ar:GBP,au:£" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:69 msgid "ar:GRD" msgstr "ar:GRD" #: ../data/currencies.xml.in.h:70 msgid "ar:HKD" msgstr "ar:HKD" #: ../data/currencies.xml.in.h:71 msgid "ar:HRK" msgstr "ar:HRK" #: ../data/currencies.xml.in.h:72 msgid "ar:IDR" msgstr "ar:IDR" #: ../data/currencies.xml.in.h:73 msgid "ar:IEP" msgstr "ar:IEP" #: ../data/currencies.xml.in.h:74 msgid "ar:ISK" msgstr "ar:ISK" #: ../data/currencies.xml.in.h:75 msgid "ar:ITL,lira" msgstr "ar:ITL,里拉" #: ../data/currencies.xml.in.h:76 msgid "ar:JPY,au:¥,yen" msgstr "ar:JPY,au:¥,日元" #: ../data/currencies.xml.in.h:77 msgid "ar:KRW" msgstr "ar:KRW" #: ../data/currencies.xml.in.h:78 msgid "ar:LUF" msgstr "ar:LUF" #: ../data/currencies.xml.in.h:79 msgid "ar:MTL" msgstr "ar:MTL" #: ../data/currencies.xml.in.h:80 msgid "ar:MYR" msgstr "ar:MYR" #: ../data/currencies.xml.in.h:81 msgid "ar:NLG,guilder" msgstr "ar:NLG,guilder" #: ../data/currencies.xml.in.h:82 msgid "ar:NOK" msgstr "ar:NOK" #: ../data/currencies.xml.in.h:83 msgid "ar:NZD" msgstr "ar:NZD" #: ../data/currencies.xml.in.h:84 msgid "ar:PHP" msgstr "ar:PHP" #: ../data/currencies.xml.in.h:85 msgid "ar:PTE,escudo" msgstr "ar:PTE,escudo" #: ../data/currencies.xml.in.h:86 msgid "ar:RUB,ruble" msgstr "ar:RUB,卢布" #: ../data/currencies.xml.in.h:87 msgid "ar:SEK" msgstr "ar:SEK" #: ../data/currencies.xml.in.h:88 msgid "ar:SGD" msgstr "ar:SGD" #: ../data/currencies.xml.in.h:89 msgid "ar:SKK" msgstr "ar:SKK" #: ../data/currencies.xml.in.h:90 msgid "ar:THB" msgstr "ar:THB" #: ../data/currencies.xml.in.h:91 msgid "ar:TRY" msgstr "ar:TRY" #: ../data/currencies.xml.in.h:92 msgid "ar:ZAR" msgstr "ar:ZAR" #: ../data/currencies.xml.in.h:93 msgid "au:¢,r:cent,p:cents" msgstr "au:¢,r:美分" #: ../data/currencies.xml.in.h:94 msgid "forint,ar:HUF" msgstr "forint,ar:HUF" #: ../data/currencies.xml.in.h:95 msgid "lat,ar:LVL" msgstr "lat,ar:LVL" #: ../data/currencies.xml.in.h:96 msgid "leu,ar:RON" msgstr "leu,ar:RON" #: ../data/currencies.xml.in.h:97 msgid "lev,ar:BGN" msgstr "lev,ar:BGN" #: ../data/currencies.xml.in.h:98 msgid "lit,ar:LTL" msgstr "lit,ar:LTL" #: ../data/currencies.xml.in.h:99 msgid "r:eurocent,p:eurocents" msgstr "r:欧元分" #: ../data/currencies.xml.in.h:100 msgid "tolar,ar:SIT" msgstr "tolar,ar:SIT" #: ../data/currencies.xml.in.h:101 msgid "zloty,ar:PLN" msgstr "zloty,ar:PLN" #. Object argument for chemical elements data set #: ../data/datasets.xml.in.h:2 msgid "!datasets!Element" msgstr "元素" #. Data set for chemical elements #: ../data/datasets.xml.in.h:4 msgid "!datasets!Elements" msgstr "元素" #. Planet mass #: ../data/datasets.xml.in.h:6 msgid "!datasets!Mass" msgstr "质量" #. Chemical elements number #: ../data/datasets.xml.in.h:8 msgid "!datasets!Number" msgstr "编号" #. Surface area of planet #: ../data/datasets.xml.in.h:10 msgid "!datasets!r:area" msgstr "面积" #. Chemical elements number #: ../data/datasets.xml.in.h:12 msgid "!datasets!r:number" msgstr "编号" #. Orbital period for planet #: ../data/datasets.xml.in.h:14 msgid "!datasets!r:year" msgstr "年" #: ../data/datasets.xml.in.h:15 msgid "" "A number representing an element group: 1 Alkali Metal 2 Alkaline-" "Earth Metal 3 Lanthanide 4 Actinide 5 Transition Metal 6 " "Metal 7 Metalloid 8 Non-Metal 9 Halogen 10 Noble Gas 11 " "Transactinide" msgstr "" "一个代表元素族的数字: 1 碱金属 2 硷土金属 3 镧系元素 4 锕系" "元素 5 过渡金属元素 6 金属 7 半金属元素 8 非金属 9 卤" "素 10 惰性气体 11 锕系后元素" #: ../data/datasets.xml.in.h:16 msgid "Average Orbital Speed" msgstr "平均归到速度" #: ../data/datasets.xml.in.h:17 msgid "Boiling Point" msgstr "沸点" #: ../data/datasets.xml.in.h:18 msgid "Classification" msgstr "分类" #: ../data/datasets.xml.in.h:19 msgid "Covalent Radius" msgstr "共价半径" #: ../data/datasets.xml.in.h:20 msgid "Data Sets" msgstr "数据集" #: ../data/datasets.xml.in.h:21 ../data/units.xml.in.h:77 msgid "Density" msgstr "密度" #: ../data/datasets.xml.in.h:22 msgid "Density at 295K" msgstr "295K时的密度" #: ../data/datasets.xml.in.h:23 msgid "Eccentricity" msgstr "偏心率" #: ../data/datasets.xml.in.h:24 msgid "Equatorial Gravity" msgstr "赤道重力" #: ../data/datasets.xml.in.h:25 msgid "Inclination" msgstr "倾角" #: ../data/datasets.xml.in.h:26 msgid "Ionization Potential" msgstr "电离电位" #: ../data/datasets.xml.in.h:27 msgid "Mean Density" msgstr "平均密度" #: ../data/datasets.xml.in.h:28 msgid "Mean Surface Temperature" msgstr "平均表面温度" #: ../data/datasets.xml.in.h:29 msgid "Melting Point" msgstr "熔点" #: ../data/datasets.xml.in.h:30 ../data/functions.xml.in.h:321 msgid "Name" msgstr "名称" #: ../data/datasets.xml.in.h:31 msgid "Number of Satellites" msgstr "卫星个数" #: ../data/datasets.xml.in.h:32 msgid "Orbital Period (Year)" msgstr "轨道周期(年)" #: ../data/datasets.xml.in.h:33 msgid "Planet" msgstr "行星" #: ../data/datasets.xml.in.h:34 msgid "Planets" msgstr "行星" #: ../data/datasets.xml.in.h:35 msgid "Surface Area" msgstr "表面积" #: ../data/datasets.xml.in.h:36 msgid "Symbol" msgstr "符号" #: ../data/datasets.xml.in.h:37 ../data/functions.xml.in.h:604 msgid "Weight" msgstr "重量" #: ../data/datasets.xml.in.h:38 msgid "X Position" msgstr "X坐标" #: ../data/datasets.xml.in.h:39 msgid "Y Position" msgstr "Y坐标" #: ../data/datasets.xml.in.h:40 msgid "r:atom" msgstr "r:atom" #: ../data/datasets.xml.in.h:41 msgid "r:boiling" msgstr "r:boiling" #: ../data/datasets.xml.in.h:42 msgid "r:class" msgstr "r:class" #: ../data/datasets.xml.in.h:43 msgid "r:covalent" msgstr "r:covalent" #: ../data/datasets.xml.in.h:44 msgid "r:density" msgstr "r:density" #: ../data/datasets.xml.in.h:45 msgid "r:eccentricity" msgstr "r:eccentricity" #: ../data/datasets.xml.in.h:46 msgid "r:gravity" msgstr "r:gravity" #: ../data/datasets.xml.in.h:47 msgid "r:inclination" msgstr "r:inclination" #: ../data/datasets.xml.in.h:48 msgid "r:ionization" msgstr "r:ionization" #: ../data/datasets.xml.in.h:49 msgid "r:mass" msgstr "r:mass" #: ../data/datasets.xml.in.h:50 msgid "r:melting" msgstr "r:melting" #: ../data/datasets.xml.in.h:51 msgid "r:name" msgstr "r:name" #: ../data/datasets.xml.in.h:52 msgid "r:planet" msgstr "r:planet" #: ../data/datasets.xml.in.h:53 msgid "r:satellites" msgstr "r:satellites" #: ../data/datasets.xml.in.h:54 msgid "r:speed" msgstr "r:speed" #: ../data/datasets.xml.in.h:55 msgid "r:symbol" msgstr "r:symbol" #: ../data/datasets.xml.in.h:56 msgid "r:temperature" msgstr "r:temperature" #: ../data/datasets.xml.in.h:57 msgid "r:weight,mass" msgstr "r:weight,mass" #: ../data/datasets.xml.in.h:58 msgid "r:x_pos" msgstr "r:x_pos" #: ../data/datasets.xml.in.h:59 msgid "r:y_pos" msgstr "r:y_pos" #. Chemical element #: ../data/elements.xml.in.h:2 msgid "!elements!Mercury" msgstr "汞" #: ../data/elements.xml.in.h:3 msgid "Actinium" msgstr "锕" #: ../data/elements.xml.in.h:4 msgid "Aluminum" msgstr "铝" #: ../data/elements.xml.in.h:5 msgid "Americium" msgstr "镅" #: ../data/elements.xml.in.h:6 msgid "Antimony" msgstr "锑" #: ../data/elements.xml.in.h:7 msgid "Argon" msgstr "氩" #: ../data/elements.xml.in.h:8 msgid "Arsenic" msgstr "砷" #: ../data/elements.xml.in.h:9 msgid "Astatine" msgstr "砹" #: ../data/elements.xml.in.h:10 msgid "Barium" msgstr "钡" #: ../data/elements.xml.in.h:11 msgid "Berkelium" msgstr "锫" #: ../data/elements.xml.in.h:12 msgid "Beryllium" msgstr "铍" #: ../data/elements.xml.in.h:13 msgid "Bismuth" msgstr "铋" #: ../data/elements.xml.in.h:14 msgid "Bohrium" msgstr "" #: ../data/elements.xml.in.h:15 msgid "Boron" msgstr "硼" #: ../data/elements.xml.in.h:16 msgid "Bromine" msgstr "溴" #: ../data/elements.xml.in.h:17 msgid "Cadmium" msgstr "镉" #: ../data/elements.xml.in.h:18 msgid "Calcium" msgstr "钙" #: ../data/elements.xml.in.h:19 msgid "Californium" msgstr "锎" #: ../data/elements.xml.in.h:20 msgid "Carbon" msgstr "碳" #: ../data/elements.xml.in.h:21 msgid "Cerium" msgstr "铈" #: ../data/elements.xml.in.h:22 msgid "Cesium" msgstr "铯" #: ../data/elements.xml.in.h:23 msgid "Chlorine" msgstr "氯" #: ../data/elements.xml.in.h:24 msgid "Chromium" msgstr "铬" #: ../data/elements.xml.in.h:25 msgid "Cobalt" msgstr "钴" #: ../data/elements.xml.in.h:26 msgid "Copper" msgstr "铜" #: ../data/elements.xml.in.h:27 msgid "Curium" msgstr "锔" #: ../data/elements.xml.in.h:28 msgid "Darmstadtium" msgstr "" #: ../data/elements.xml.in.h:29 msgid "Dubnium" msgstr "" #: ../data/elements.xml.in.h:30 msgid "Dysprosium" msgstr "镝" #: ../data/elements.xml.in.h:31 msgid "Einsteinium" msgstr "锿" #: ../data/elements.xml.in.h:32 msgid "Erbium" msgstr "铒" #: ../data/elements.xml.in.h:33 msgid "Europium" msgstr "铕" #: ../data/elements.xml.in.h:34 msgid "Fermium" msgstr "镄" #: ../data/elements.xml.in.h:35 msgid "Fluorine" msgstr "氟" #: ../data/elements.xml.in.h:36 msgid "Francium" msgstr "钫" #: ../data/elements.xml.in.h:37 msgid "Gadolinium" msgstr "钆" #: ../data/elements.xml.in.h:38 msgid "Gallium" msgstr "镓" #: ../data/elements.xml.in.h:39 msgid "Germanium" msgstr "锗" #: ../data/elements.xml.in.h:40 msgid "Gold" msgstr "金" #: ../data/elements.xml.in.h:41 msgid "Hafnium" msgstr "铪" #: ../data/elements.xml.in.h:42 msgid "Hassium" msgstr "" #: ../data/elements.xml.in.h:43 msgid "Helium" msgstr "氦" #: ../data/elements.xml.in.h:44 msgid "Holmium" msgstr "钬" #: ../data/elements.xml.in.h:45 msgid "Hydrogen" msgstr "氢" #: ../data/elements.xml.in.h:46 msgid "Indium" msgstr "铟" #: ../data/elements.xml.in.h:47 msgid "Iodine" msgstr "碘" #: ../data/elements.xml.in.h:48 msgid "Iridium" msgstr "铱" #: ../data/elements.xml.in.h:49 msgid "Iron" msgstr "铁" #: ../data/elements.xml.in.h:50 msgid "Krypton" msgstr "氪" #: ../data/elements.xml.in.h:51 msgid "Lanthanum" msgstr "镧" #: ../data/elements.xml.in.h:52 msgid "Lawrencium" msgstr "铹" #: ../data/elements.xml.in.h:53 msgid "Lead" msgstr "铅" #: ../data/elements.xml.in.h:54 msgid "Lithium" msgstr "锂" #: ../data/elements.xml.in.h:55 msgid "Lutetium" msgstr "镥" #: ../data/elements.xml.in.h:56 msgid "Magnesium" msgstr "镁" #: ../data/elements.xml.in.h:57 msgid "Manganese" msgstr "锰" #: ../data/elements.xml.in.h:58 msgid "Meitnerium" msgstr "" #: ../data/elements.xml.in.h:59 msgid "Mendelevium" msgstr "钔" #: ../data/elements.xml.in.h:60 msgid "Molybdenum" msgstr "钼" #: ../data/elements.xml.in.h:61 msgid "Neodymium" msgstr "钕" #: ../data/elements.xml.in.h:62 msgid "Neon" msgstr "氖" #: ../data/elements.xml.in.h:63 msgid "Neptunium" msgstr "镎" #: ../data/elements.xml.in.h:64 msgid "Nickel" msgstr "镍" #: ../data/elements.xml.in.h:65 msgid "Niobium" msgstr "铌" #: ../data/elements.xml.in.h:66 msgid "Nitrogen" msgstr "氮" #: ../data/elements.xml.in.h:67 msgid "Nobelium" msgstr "锘" #: ../data/elements.xml.in.h:68 msgid "Osmium" msgstr "锇" #: ../data/elements.xml.in.h:69 msgid "Oxygen" msgstr "氧" #: ../data/elements.xml.in.h:70 msgid "Palladium" msgstr "钯" #: ../data/elements.xml.in.h:71 msgid "Phosphorus" msgstr "磷" #: ../data/elements.xml.in.h:72 msgid "Platinum" msgstr "铂" #: ../data/elements.xml.in.h:73 msgid "Plutonium" msgstr "钚" #: ../data/elements.xml.in.h:74 msgid "Polonium" msgstr "钋" #: ../data/elements.xml.in.h:75 msgid "Potassium" msgstr "钾" #: ../data/elements.xml.in.h:76 msgid "Praseodymium" msgstr "镨" #: ../data/elements.xml.in.h:77 msgid "Promethium" msgstr "钷" #: ../data/elements.xml.in.h:78 msgid "Protactinium" msgstr "镤" #: ../data/elements.xml.in.h:79 msgid "Radium" msgstr "镭" #: ../data/elements.xml.in.h:80 msgid "Radon" msgstr "氡" #: ../data/elements.xml.in.h:81 msgid "Rhenium" msgstr "铼" #: ../data/elements.xml.in.h:82 msgid "Rhodium" msgstr "铑" #: ../data/elements.xml.in.h:83 msgid "Roentgenium" msgstr "" #: ../data/elements.xml.in.h:84 msgid "Rubidium" msgstr "铷" #: ../data/elements.xml.in.h:85 msgid "Ruthenium" msgstr "钌" #: ../data/elements.xml.in.h:86 msgid "Rutherfordium" msgstr "" #: ../data/elements.xml.in.h:87 msgid "Samarium" msgstr "钐" #: ../data/elements.xml.in.h:88 msgid "Scandium" msgstr "钪" #: ../data/elements.xml.in.h:89 msgid "Seaborgium" msgstr "" #: ../data/elements.xml.in.h:90 msgid "Selenium" msgstr "硒" #: ../data/elements.xml.in.h:91 msgid "Silicon" msgstr "硅" #: ../data/elements.xml.in.h:92 msgid "Silver" msgstr "银" #: ../data/elements.xml.in.h:93 msgid "Sodium" msgstr "钠" #: ../data/elements.xml.in.h:94 msgid "Strontium" msgstr "锶" #: ../data/elements.xml.in.h:95 msgid "Sulfur" msgstr "硫" #: ../data/elements.xml.in.h:96 msgid "Tantalum" msgstr "钽" #: ../data/elements.xml.in.h:97 msgid "Technetium" msgstr "锝" #: ../data/elements.xml.in.h:98 msgid "Tellurium" msgstr "碲" #: ../data/elements.xml.in.h:99 msgid "Terbium" msgstr "铽" #: ../data/elements.xml.in.h:100 msgid "Thallium" msgstr "铊" #: ../data/elements.xml.in.h:101 msgid "Thorium" msgstr "钍" #: ../data/elements.xml.in.h:102 msgid "Thulium" msgstr "铥" #: ../data/elements.xml.in.h:103 msgid "Tin" msgstr "锡" #: ../data/elements.xml.in.h:104 msgid "Titanium" msgstr "钛" #: ../data/elements.xml.in.h:105 msgid "Tungsten" msgstr "钨" #: ../data/elements.xml.in.h:106 msgid "Ununbium" msgstr "" #: ../data/elements.xml.in.h:107 msgid "Ununhexium" msgstr "" #: ../data/elements.xml.in.h:108 msgid "Ununoctium" msgstr "" #: ../data/elements.xml.in.h:109 msgid "Ununpentium" msgstr "" #: ../data/elements.xml.in.h:110 msgid "Ununquadium" msgstr "" #: ../data/elements.xml.in.h:111 msgid "Ununseptium" msgstr "" #: ../data/elements.xml.in.h:112 msgid "Ununtrium" msgstr "" #: ../data/elements.xml.in.h:113 msgid "Uranium" msgstr "铀" #: ../data/elements.xml.in.h:114 msgid "Vanadium" msgstr "钒" #: ../data/elements.xml.in.h:115 msgid "Xenon" msgstr "氙" #: ../data/elements.xml.in.h:116 msgid "Ytterbium" msgstr "镱" #: ../data/elements.xml.in.h:117 msgid "Yttrium" msgstr "钇" #: ../data/elements.xml.in.h:118 msgid "Zinc" msgstr "锌" #: ../data/elements.xml.in.h:119 msgid "Zirconium" msgstr "锆" #: ../data/functions.xml.in.h:1 msgid "-r:bmi" msgstr "-r:bmi" #: ../data/functions.xml.in.h:2 msgid "10 raised the to power X" msgstr "10的乘方" #: ../data/functions.xml.in.h:3 msgid "1st value" msgstr "值1" #: ../data/functions.xml.in.h:4 msgid "2 raised the to power X" msgstr "2的乘方" #: ../data/functions.xml.in.h:5 msgid "2nd value" msgstr "值2" #: ../data/functions.xml.in.h:6 msgid "ASCII Char" msgstr "ASCII字符" #: ../data/functions.xml.in.h:7 msgid "ASCII Value" msgstr "ASCII值" #: ../data/functions.xml.in.h:8 msgid "Absolute Value" msgstr "绝对值" #: ../data/functions.xml.in.h:9 msgid "Accrued interest of security paying at maturity" msgstr "到期时支付的证券应计利息" #: ../data/functions.xml.in.h:10 msgid "Accrued interest of security with periodic interest payments" msgstr "分期支付的证券应计利息" #: ../data/functions.xml.in.h:11 msgid "Add" msgstr "加" #: ../data/functions.xml.in.h:12 msgid "Add Days" msgstr "加日" #: ../data/functions.xml.in.h:13 msgid "Add Months" msgstr "加月份" #: ../data/functions.xml.in.h:14 msgid "Add Time" msgstr "加时间" #: ../data/functions.xml.in.h:15 msgid "Add Years" msgstr "加年" #: ../data/functions.xml.in.h:16 msgid "" "Adds a time value to a date. The value can be positive or negative, but must " "use a unit based on seconds (such as day and year). Fractions of days are " "truncated." msgstr "将一个时间间隔值加到日期中。该值可正可负,但其单位必须基于秒(如日或者年)。日期的分数部分会被截取掉。" #: ../data/functions.xml.in.h:17 msgid "Adjugate (Adjoint)" msgstr "伴随矩阵" #: ../data/functions.xml.in.h:18 msgid "Algebra" msgstr "代数" #: ../data/functions.xml.in.h:19 msgid "Amortizement period" msgstr "偿还期" #: ../data/functions.xml.in.h:20 msgid "Amount received at maturity for a security bond" msgstr "债券到期时获得的金额" #: ../data/functions.xml.in.h:21 msgid "Analysis" msgstr "分析" #: ../data/functions.xml.in.h:22 msgid "Angle" msgstr "角度" #: ../data/functions.xml.in.h:24 #, no-c-format msgid "Annual coupon rate (%)" msgstr "年息票利率(%)" #: ../data/functions.xml.in.h:25 msgid "Annual rate of security" msgstr "证券年利率" #: ../data/functions.xml.in.h:26 msgid "Annual yield" msgstr "年收益" #: ../data/functions.xml.in.h:28 #, no-c-format msgid "Annualized yield (%)" msgstr "年度基础换算后的收益率(%)" #: ../data/functions.xml.in.h:29 msgid "Arguments" msgstr "自变量" #: ../data/functions.xml.in.h:30 msgid "Arithmetics" msgstr "算术" #: ../data/functions.xml.in.h:31 msgid "Ascending" msgstr "升序" #: ../data/functions.xml.in.h:32 msgid "Base" msgstr "基/底" #: ../data/functions.xml.in.h:33 msgid "Base-10 Logrithm" msgstr "以10为底的对数" #: ../data/functions.xml.in.h:34 msgid "Base-2 Logrithm" msgstr "以2为底的对数" #: ../data/functions.xml.in.h:35 msgid "Base-N Logarithm" msgstr "以n为底的对数" #: ../data/functions.xml.in.h:36 msgid "Beta Function" msgstr "β函数" #: ../data/functions.xml.in.h:37 msgid "Binary" msgstr "二进制" #: ../data/functions.xml.in.h:38 msgid "Binary number" msgstr "二进制数" #: ../data/functions.xml.in.h:39 msgid "Binomial Coefficient" msgstr "二项式系数" #: ../data/functions.xml.in.h:40 msgid "Bits" msgstr "比特" #: ../data/functions.xml.in.h:41 msgid "Bitwise Exclusive OR" msgstr "按位排斥OR" #: ../data/functions.xml.in.h:42 msgid "Bitwise Shift" msgstr "按位移位" #: ../data/functions.xml.in.h:43 msgid "Body Mass Index (BMI)" msgstr "体质指数(BMI)" #: ../data/functions.xml.in.h:44 msgid "Bottom" msgstr "底部" #: ../data/functions.xml.in.h:45 msgid "" "Calculates and returns the price per $100 face value of a security bond. The " "security does not pay interest at maturity. Basis is the type of " "day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "计算并返回一个债券每100美元票面价值的价格。此债券在到期时不支付利息。 " "\"基准\"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), 1: 真实天数, 2: 真实天数/360, " " 3: 真实天数/365 or 4: 欧式 30/360。" #: ../data/functions.xml.in.h:46 msgid "" "Calculates and returns the price per $100 face value of a security. The " "security pays interest at maturity. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "计算并返回一个债券每100美元票面价值的价格。此债券在到期时支付利息。 " "\"基准\"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), 1: 真实天数, 2: 真实天数/360, " " 3: 真实天数/365 or 4: 欧式 30/360。" #: ../data/functions.xml.in.h:47 msgid "" "Calculates number of periods of an investment based on periodic constant " "payments and a constant interest rate. Type defines the due date. 1 " "for payment at the beginning of a period and 0 (default) for payment at the " "end of a period." msgstr "" "计算基于周期性固定支付和固定利率的投资的周期数目。 \"类型\" " "定义了到期日期。\"1\"代表在每个周期的开头支付;\"0\"(缺省值)代表在 " "每个周期末尾支付。" #: ../data/functions.xml.in.h:48 msgid "" "Calculates the Body Mass Index. The resulting BMI-value is sometimes " "interpreted as follows (although varies with age, sex, etc.): " "Underweight < 18.5 Normal weight 18.5-25 " "Overweight 25-30 Obesity > 30 Note that " "you must use units for weight (ex. 59kg) and length (ex. 174cm)." msgstr "" "计算体质指数(Body Mass Index, 简称BMI)。所得BMI结果的参考意义如下: " "体重过轻 < 18.5 体重正常 18.5-25 " "体重过重 25-30 肥胖 > 30 注意您必须使用 " "重量和长度单位(如,59kg和174cm)。" #: ../data/functions.xml.in.h:49 msgid "Calculates the adjugate or adjoint of a matrix." msgstr "计算矩阵的伴随矩阵" #: ../data/functions.xml.in.h:50 msgid "" "Calculates the amount of a payment of an annuity going towards interest. " " Type defines the due date. 1 for payment at the beginning of a period " "and 0 (default) for payment at the end of a period." msgstr "" "计算关于本金的年金利息支付额. \"类型\" 定义了到期日期。\"1\"代表在每个周期的开头支付; " "\"0\"(缺省值)代表在每个周期末尾支付。" #: ../data/functions.xml.in.h:51 msgid "" "Calculates the amount of a payment of an annuity going towards principal." " Type defines the due date. 1 for payment at the beginning of a " "period and 0 (default) for payment at the end of a period." msgstr "" "计算关于本金的年金支付额。 \"类型\" 定义了到期日期。\"1\"代表在每个周期的开头支付; " "\"0\"(缺省值)代表在每个周期末尾支付。" #: ../data/functions.xml.in.h:52 msgid "Calculates the area of a circle using the radius" msgstr "使用半径计算圆面积" #: ../data/functions.xml.in.h:53 msgid "" "Calculates the area of a four-sided figure whose opposite sides are both " "parallel and equal in length." msgstr "计算平行四边形的面积。" #: ../data/functions.xml.in.h:54 msgid "Calculates the area of a four-sided figure with two parallel sides." msgstr "计算梯形的面积。" #: ../data/functions.xml.in.h:55 msgid "Calculates the cofactor of the element at specified position." msgstr "计算指定位置元素的余因子。" #: ../data/functions.xml.in.h:56 msgid "Calculates the cross product of two 3-dimensional vectors." msgstr "计算两个三维向量的向量积" #: ../data/functions.xml.in.h:57 msgid "" "Calculates the demand elasticity. Also works for supply elasticity, income " "elasticity, cross-price elasticity, etc. Just replace demand, with supply, " "or price with income... Ex. elasticity(100-x^2, 3) calculates the " "demand elasticity when the price is 3 for the function \"Q = 100 - x^2\" " "where x is the default price variable." msgstr "" "计算需求弹性。将需求替换成供给、收入……等,也可以用它来计算供给弹性、收入弹性、交叉价格弹性等。 " " 例如,表达式elasticity(100-x^2, 3)计算x为价格变量的函数\"Q = 100 - x^2\",当价格为3时的 " "需求弹性。" #: ../data/functions.xml.in.h:58 msgid "Calculates the determinant of a matrix." msgstr "计算矩阵的行列式。" #: ../data/functions.xml.in.h:59 msgid "Calculates the difference between the first and third quartile." msgstr "计算第一和第三四分位数之间的差。" #: ../data/functions.xml.in.h:60 msgid "Calculates the difference between the min and max value." msgstr "计算最大和最小值之间的差。" #: ../data/functions.xml.in.h:61 msgid "" "Calculates the doublefactorial of an integer. Mulitplies the argument with " "every second lesser positive integer (n(n-2)(n-4)...). Can also be entered " "as a number followed by two exclamation marks. ex. factorial2(5) = " "5!! = 5 * 3 * 1 = 15" msgstr "" "计算整数的双阶乘。即n(n-2)(n-4)....。也可以用整数后面连输两个\"!\"来 " "表示。 例如,factorial2(5) = 5!! = 5 * 3 * 1 = 15" #: ../data/functions.xml.in.h:62 msgid "Calculates the duration of a security." msgstr "计算债券的持续时间。" #: ../data/functions.xml.in.h:63 msgid "Calculates the effective interest for a given nominal rate." msgstr "根据给定的名义利率计算有效利息。" #: ../data/functions.xml.in.h:64 msgid "" "Calculates the factorial of an integer. Mulitplies the argument with every " "lesser positive integer (n(n-1)(n-2)...2*1). Can also be entered as a number " "followed by one exclamation mark. ex. factorial(5) = 5! = 5 * 4 * 3 " "* 2 * 1 = 120" msgstr "" "计算整数的阶乘,即n(n-1)(n-2)...2*1。也可以用整数后面跟一个\"!\"来 " "表示。 例如,factorial(5) = 5! = 5 * 4 * 3 * 2 * 1 = 120" #: ../data/functions.xml.in.h:65 msgid "" "Calculates the hyperfactorial of an integer. Mulitplies the argument raised " "by itself with every lesser positive integer raised by themselves (1^1 * " "2^2 ... n^n). ex. hyperfactorial(3) = (3^3) * (2^2) * (1^1) = 108" msgstr "计算整数的hyper阶乘,即(1^1 * 2^2 ... n^n)。 例如,hyperfactorial(3) = (3^3) * (2^2) * (1^1) = 108" #: ../data/functions.xml.in.h:66 msgid "Calculates the interest paid on a given period of an investment." msgstr "计算一项投资在给定周期内支付的利息。" #: ../data/functions.xml.in.h:67 msgid "" "Calculates the inverse of a matrix. The inverse is the matrix that " "multiplied by the original matrix equals the identity matrix (AB = BA = I)." msgstr "计算矩阵的逆。矩阵的逆是一个与原矩阵相乘等于单位矩阵的矩阵。(AB = BA = I)。" #: ../data/functions.xml.in.h:68 msgid "" "Calculates the multifactorial of an integer. Mulitplies the argument with " "every x lesser positive integer (n(n-x)(n-2x)...). Can also be entered as a " "number followed by three or more exclamation marks. ex. " "multifactorial(18, 4) = 18!!!! = 18 * 14 * 10 * 6 * 2 = 30 240" msgstr "" "计算整数的多阶乘,即n(n-x)(n-2x)...。也可以用在整数后面跟三个或多个\"!\"来表示。 " " 例如,multifactorial(18, 4) = 18!!!! = 18 * 14 * 10 * 6 * 2 = 30240" #: ../data/functions.xml.in.h:69 msgid "" "Calculates the nominal interest rate from a given effective interest rate " "compounded at given intervals." msgstr "根据在给定时间段内复合的给定有效利率计算名义利率。" #: ../data/functions.xml.in.h:70 msgid "Calculates the norm/length of a vector." msgstr "计算向量的范数/长度。" #: ../data/functions.xml.in.h:71 msgid "" "Calculates the perimeter of a four-sided figure whose opposite sides are " "both parallel and equal in length." msgstr "计算平行四边形的周长。" #: ../data/functions.xml.in.h:72 msgid "" "Calculates the permanent of a matrix. The permanent differs from a " "determinant in that all signs in the expansion by minors are taken as " "positive." msgstr "计算矩阵的积和式。积和式与行列式的不同之处在于,在展开时,所有展开式前面的符号都为正。" #: ../data/functions.xml.in.h:73 msgid "" "Calculates the return on continuously compounded interest, given the " "principal, nominal rate and time in years." msgstr "根据给定的本金、名义利率和以年为单位的时间,计算连续复合利率的回报。" #: ../data/functions.xml.in.h:74 msgid "" "Calculates the sum-of-years digits depreciation for an asset based on its " "cost, salvage value, anticipated life, and a particular period. This method " "accelerates the rate of the depreciation, so that more depreciation expense " "occurs in earlier periods than in later ones. The depreciable cost is the " "actual cost minus the salvage value. The useful life is the number of " "periods (typically years) over which the asset is depreciated." msgstr "" "根据一项资产的成本、残值、预期寿命和特定周期计算它的年数总和折旧(SOYD)。 " "这种方法加速折旧率,因此在早期的折旧支出比晚期要多。\"折旧成本\"是实际的成本 " "减去残值。\"寿命\"是指该资产折旧的周期数目(通常单位为年)。" #: ../data/functions.xml.in.h:75 msgid "" "Calculates the superfactorial of an integer. Mulitplies the factorial of the " "argument with the factorial of every lesser positive integer (1! * 2! ... " "n!). ex. superfactorial(5) = 5! * 4! * 3! * 2! * 1! = 34 560" msgstr "计算整数的超级阶乘,即1! * 2! ... n!。 例如, superfactorial(5) = 5! * 4! * 3! * 2! * 1! = 34560" #: ../data/functions.xml.in.h:76 msgid "Calculates the surface area of a prism with rectangular base." msgstr "计算矩形棱柱的表面积" #: ../data/functions.xml.in.h:77 msgid "Calculates the value of a level-coupon bond." msgstr "计算息票债券的值。" #: ../data/functions.xml.in.h:78 msgid "Calculates the value of a zero-coupon (pure discount) bond." msgstr "计算零息债券(纯贴现债券)的值。" #: ../data/functions.xml.in.h:79 msgid "" "Calculates the volume of a 3-dimensional shape standing on a rectangular " "base and terminating in a point at the top." msgstr "计算矩形锥体的体积。" #: ../data/functions.xml.in.h:80 msgid "Calculates the volume of a prism with rectangular base." msgstr "计算矩形棱柱的体积。" #: ../data/functions.xml.in.h:81 msgid "Calculates the volume of a prism with triangular base." msgstr "计算三角棱柱的体积。" #: ../data/functions.xml.in.h:82 msgid "Calculus" msgstr "微积分" #: ../data/functions.xml.in.h:83 msgid "Category" msgstr "类别" #: ../data/functions.xml.in.h:84 msgid "Ceil" msgstr "顶部值" #: ../data/functions.xml.in.h:85 msgid "Character" msgstr "字符" #: ../data/functions.xml.in.h:86 msgid "Circle" msgstr "圆形" #: ../data/functions.xml.in.h:87 msgid "Circle Area" msgstr "圆面积" #: ../data/functions.xml.in.h:88 msgid "Circle Circumference" msgstr "圆周长" #: ../data/functions.xml.in.h:89 msgid "Coefficient" msgstr "系数" #: ../data/functions.xml.in.h:90 msgid "Cofactor" msgstr "余因子" #: ../data/functions.xml.in.h:91 msgid "Column" msgstr "列" #: ../data/functions.xml.in.h:92 msgid "Column variable" msgstr "列标量" #: ../data/functions.xml.in.h:93 msgid "Columns" msgstr "列" #: ../data/functions.xml.in.h:94 msgid "Combinations" msgstr "组合" #: ../data/functions.xml.in.h:95 msgid "Combinatorics" msgstr "组合学" #: ../data/functions.xml.in.h:96 msgid "Complex Exponential (Cis)" msgstr "复指数(Cis)" #: ../data/functions.xml.in.h:97 msgid "Complex number" msgstr "复数" #: ../data/functions.xml.in.h:98 msgid "Compound" msgstr "复合值" #: ../data/functions.xml.in.h:99 msgid "" "Computes the future value of an investment. This is based on periodic, " "constant payments and a constant interest rate. If type = 1 then " "the payment is made at the beginning of the period, If type = 0 (or omitted) " "it is made at the end of each period." msgstr "" "计算一项价值的未来价值。这是根据周期、固定支付和固定利率计算出来的。 " "\"type\"说明了到期日期。\"1\"代表在每个周期的开头支付; \"0\"(缺省值)代表在每个周期末尾支付。" #: ../data/functions.xml.in.h:100 msgid "Concatenate Strings" msgstr "连接字符串" #: ../data/functions.xml.in.h:101 msgid "Condition" msgstr "条件" #: ../data/functions.xml.in.h:102 msgid "Cone" msgstr "圆锥" #: ../data/functions.xml.in.h:103 msgid "Cone Volume" msgstr "圆锥体积" #: ../data/functions.xml.in.h:104 msgid "Construct Matrix" msgstr "构造矩阵" #: ../data/functions.xml.in.h:105 msgid "Construct Vector" msgstr "构造向量" #: ../data/functions.xml.in.h:106 msgid "Consumer Surplus" msgstr "消费者剩余" #: ../data/functions.xml.in.h:107 msgid "Content Part" msgstr "常数公因子" #: ../data/functions.xml.in.h:108 msgid "Convert Matrix to Vector" msgstr "将矩阵转换为向量" #: ../data/functions.xml.in.h:109 msgid "Converts a decimal dollar price into a dollar price expressed as a fraction." msgstr "将用小数表示的美元价格转化为用分数表示的价格。" #: ../data/functions.xml.in.h:110 msgid "" "Converts a dollar price expressed as a fraction into a dollar price " "expressed as a decimal number." msgstr "将用分数表示的美元价格转化为用小数表示的价格。" #: ../data/functions.xml.in.h:111 msgid "" "Corresponds to the product symbol. Multiplies factors for each x ranging " "from the lower to the upper limit." msgstr "相当于连乘符号Π。将从上限到下限的每项x相乘。" #: ../data/functions.xml.in.h:112 msgid "" "Corresponds to the sum symbol. Adds terms for each x ranging from the lower " "to the upper limit." msgstr "相当于求和符号Σ。将从上限到下限的每项x相加。" #: ../data/functions.xml.in.h:113 msgid "Cosecant" msgstr "余割" #: ../data/functions.xml.in.h:114 msgid "Cosine" msgstr "余弦" #: ../data/functions.xml.in.h:115 msgid "Cost" msgstr "成本" #: ../data/functions.xml.in.h:116 msgid "Cotangent" msgstr "余切" #: ../data/functions.xml.in.h:117 msgid "Counter update function" msgstr "计数器更新函数" #: ../data/functions.xml.in.h:118 msgid "Counter variable" msgstr "计数器变量" #: ../data/functions.xml.in.h:119 msgid "Coupon rate" msgstr "息票利率" #: ../data/functions.xml.in.h:120 msgid "Coupons per year" msgstr "息票数每年" #: ../data/functions.xml.in.h:121 msgid "Covariance" msgstr "协方差" #: ../data/functions.xml.in.h:122 msgid "Cross Product" msgstr "向量积" #: ../data/functions.xml.in.h:123 msgid "Cube" msgstr "立方体" #: ../data/functions.xml.in.h:124 msgid "Cube Root" msgstr "立方根" #: ../data/functions.xml.in.h:125 msgid "Cube Volume" msgstr "立方体体积" #: ../data/functions.xml.in.h:126 msgid "Current Time" msgstr "当前时间" #: ../data/functions.xml.in.h:127 msgid "Custom Sum of Elements" msgstr "元素的自定义和" #: ../data/functions.xml.in.h:128 msgid "Cylinder" msgstr "圆柱" #: ../data/functions.xml.in.h:129 msgid "Cylinder Volume" msgstr "圆柱体积" #: ../data/functions.xml.in.h:130 msgid "Data" msgstr "数据" #: ../data/functions.xml.in.h:131 msgid "Data 1" msgstr "数据1" #: ../data/functions.xml.in.h:132 msgid "Data 2" msgstr "数据2" #: ../data/functions.xml.in.h:133 msgid "Date" msgstr "日期" #: ../data/functions.xml.in.h:134 msgid "Date & Time" msgstr "日期与时间" #: ../data/functions.xml.in.h:135 msgid "Date to Unix Timestamp" msgstr "将时间转换为Unix时间戳" #: ../data/functions.xml.in.h:136 msgid "Day counting basis" msgstr "天数计算基准" #: ../data/functions.xml.in.h:137 msgid "Day of Month" msgstr "月份中的第几天" #: ../data/functions.xml.in.h:138 msgid "Day of Week" msgstr "星期中的第几天" #: ../data/functions.xml.in.h:139 msgid "Day of Year" msgstr "一年中的第几天" #: ../data/functions.xml.in.h:140 msgid "Days" msgstr "日" #: ../data/functions.xml.in.h:141 msgid "Days between two dates" msgstr "两个日期之间的天数" #: ../data/functions.xml.in.h:142 msgid "Decile" msgstr "十分位数" #: ../data/functions.xml.in.h:143 msgid "Decimal dollar" msgstr "小数表示的美元" #: ../data/functions.xml.in.h:144 msgid "Demand function" msgstr "需求函数" #: ../data/functions.xml.in.h:145 msgid "Demand function or price" msgstr "需求函数或价格" #: ../data/functions.xml.in.h:146 msgid "Denominator" msgstr "分母" #: ../data/functions.xml.in.h:147 msgid "Denominator of fraction" msgstr "分数的分母" #: ../data/functions.xml.in.h:148 msgid "Derangements" msgstr "重排数" #: ../data/functions.xml.in.h:149 msgid "Derive" msgstr "求导" #: ../data/functions.xml.in.h:150 msgid "Descriptive Statistics" msgstr "描述性统计" #: ../data/functions.xml.in.h:151 msgid "Desired future value" msgstr "期望的未来价值" #: ../data/functions.xml.in.h:152 msgid "Determinant" msgstr "行列式" #: ../data/functions.xml.in.h:153 msgid "" "Determines the straight line depreciation of an asset for a single period." " Cost is the amount you paid for the asset. Salvage is the value of " "the asset at the end of the period. Life is the number of periods over which " "the asset is depreciated. SLN divides the cost evenly over the life of an " "asset." msgstr "" "定义一项资产在单一周期内的直线折旧(SLN方法)。 " "\"成本\"是您购买此资产的花销。\"残值\"是此资产在周期 " "结束时的价值。\"寿命\"是指该资产折旧的周期数目。SLN将资产的价值 " "均摊到它的寿命上。" #: ../data/functions.xml.in.h:154 msgid "Dimension" msgstr "维数" #: ../data/functions.xml.in.h:155 msgid "Dimension / Step size" msgstr "维数/步长" #: ../data/functions.xml.in.h:156 msgid "" "Discontinuous function also known as \"unit step function\". Returns 0 if x " "< 0, 1 if x > 0, and 1/2 if x = 0." msgstr "" "间断函数也被称作是\" 单位阶跃函数\"。当 x < 0时值为0, x > 0时值为1, " " x = 0时则为1/2。" #: ../data/functions.xml.in.h:157 msgid "Discount" msgstr "贴现" #: ../data/functions.xml.in.h:158 msgid "Discount rate" msgstr "贴现率" #: ../data/functions.xml.in.h:159 msgid "Discount rate for a security" msgstr "证券的贴现率" #: ../data/functions.xml.in.h:160 msgid "Display Error" msgstr "显示错误" #: ../data/functions.xml.in.h:161 msgid "Display Message" msgstr "显示信息" #: ../data/functions.xml.in.h:162 msgid "Display Warning" msgstr "显示警告" #: ../data/functions.xml.in.h:163 msgid "Distribution" msgstr "分布" #: ../data/functions.xml.in.h:164 msgid "Divide" msgstr "除" #: ../data/functions.xml.in.h:165 msgid "Do function" msgstr "Do函数" #: ../data/functions.xml.in.h:166 msgid "Dollar Decimal" msgstr "美元小数" #: ../data/functions.xml.in.h:167 msgid "Dollar Fraction" msgstr "美元分数" #: ../data/functions.xml.in.h:168 msgid "Double Factorial" msgstr "双阶乘" #: ../data/functions.xml.in.h:169 msgid "Duration" msgstr "持续时间" #: ../data/functions.xml.in.h:170 msgid "Durbin-Watson" msgstr "Durbin-Watson" #: ../data/functions.xml.in.h:171 msgid "Economics" msgstr "经济学" #: ../data/functions.xml.in.h:172 msgid "Effective Interest Rate" msgstr "有效利率" #: ../data/functions.xml.in.h:173 msgid "Effective interest rate" msgstr "有效利率" #: ../data/functions.xml.in.h:174 msgid "Elasticity" msgstr "弹性" #. Vector/matrix element #: ../data/functions.xml.in.h:176 msgid "Element" msgstr "一个元素" #: ../data/functions.xml.in.h:177 msgid "Element variable" msgstr "元素变量" #. Vector/matrix elements #: ../data/functions.xml.in.h:179 msgid "Elements" msgstr "多个元素" #: ../data/functions.xml.in.h:180 msgid "End column" msgstr "结束列" #: ../data/functions.xml.in.h:181 msgid "End row" msgstr "结束行" #: ../data/functions.xml.in.h:182 msgid "Equation" msgstr "方程" #: ../data/functions.xml.in.h:183 msgid "Equation 1" msgstr "方程1" #: ../data/functions.xml.in.h:184 msgid "Equation 2" msgstr "方程" #: ../data/functions.xml.in.h:185 msgid "Equation vector" msgstr "方程向量" #: ../data/functions.xml.in.h:186 msgid "Even" msgstr "偶" #: ../data/functions.xml.in.h:187 msgid "Exponent" msgstr "指数" #: ../data/functions.xml.in.h:188 msgid "Exponential (e^x)" msgstr "e的乘方" #: ../data/functions.xml.in.h:189 msgid "Exponents & Logarithms" msgstr "指数与对数" #: ../data/functions.xml.in.h:190 msgid "Export To CSV File" msgstr "导出到CSV文件" #: ../data/functions.xml.in.h:191 msgid "Exports a matrix to a CSV data file." msgstr "将矩阵导出到CSV数据文件" #: ../data/functions.xml.in.h:192 msgid "Expression" msgstr "表达式" #: ../data/functions.xml.in.h:193 msgid "Expression if condition is NOT met" msgstr "条件不满足时的表达式" #: ../data/functions.xml.in.h:194 msgid "Expression if condition is met" msgstr "条件满足时的表达式" #: ../data/functions.xml.in.h:195 msgid "Extract Column as Vector" msgstr "将列提取为向量" #: ../data/functions.xml.in.h:196 msgid "Extract Fractional Part" msgstr "提取分数部分" #: ../data/functions.xml.in.h:197 msgid "Extract Integer Part" msgstr "提取整数部分" #: ../data/functions.xml.in.h:198 msgid "Extract row as vector" msgstr "将行提取为向量" #: ../data/functions.xml.in.h:199 msgid "Extreme Values" msgstr "极限值" #: ../data/functions.xml.in.h:200 msgid "Face value" msgstr "票面价值" #: ../data/functions.xml.in.h:201 msgid "Factor expression" msgstr "因子表达式" #: ../data/functions.xml.in.h:202 msgid "Factorial" msgstr "阶乘" #: ../data/functions.xml.in.h:203 msgid "Factors" msgstr "因子" #: ../data/functions.xml.in.h:204 msgid "Filename" msgstr "文件名" #: ../data/functions.xml.in.h:205 msgid "Finance" msgstr "金融" #: ../data/functions.xml.in.h:206 msgid "Financial function mode" msgstr "金融函数模式" #: ../data/functions.xml.in.h:207 msgid "Find Linear Function" msgstr "寻找线性函数" #: ../data/functions.xml.in.h:208 msgid "Finds the linear function for the straight line between two distinct points." msgstr "寻找过两点直线段的线性函数" #: ../data/functions.xml.in.h:209 msgid "First data row" msgstr "第一行数据" #: ../data/functions.xml.in.h:210 msgid "First date" msgstr "第一个日期" #: ../data/functions.xml.in.h:211 msgid "First element" msgstr "最后一个元素" #: ../data/functions.xml.in.h:212 msgid "First interest" msgstr "第一笔利息" #: ../data/functions.xml.in.h:213 msgid "For condition" msgstr "For条件" #: ../data/functions.xml.in.h:214 msgid "For...Do" msgstr "For...Do" #: ../data/functions.xml.in.h:215 msgid "Fractional dollar" msgstr "分数表示的美元" #. Reccurance #: ../data/functions.xml.in.h:217 msgid "Frequency" msgstr "频率" #: ../data/functions.xml.in.h:218 msgid "Function" msgstr "函数" #: ../data/functions.xml.in.h:219 msgid "Future Value" msgstr "未来值" #: ../data/functions.xml.in.h:220 msgid "Future value" msgstr "未来值" #: ../data/functions.xml.in.h:221 msgid "Gamma Function" msgstr "γ函数" #: ../data/functions.xml.in.h:222 msgid "Generate Vector" msgstr "生成向量" #: ../data/functions.xml.in.h:223 msgid "" "Generates a pseudo-random number. Returns a real number between 0 and 1, if " "ceil is zero (default), or an integer between 1 and (including) ceil." msgstr "" "产生一个伪随机数。如果顶部值为0(缺省值),返回一个在0与1之间的实数;否则返回一个 " "在1与顶部值之间(包含顶部值)的整数。" #: ../data/functions.xml.in.h:224 msgid "Geometric Mean" msgstr "几何平均" #: ../data/functions.xml.in.h:225 msgid "Geometry" msgstr "几何" #: ../data/functions.xml.in.h:226 msgid "Greatest Common Divisor" msgstr "最大公约数" #: ../data/functions.xml.in.h:227 msgid "Harmonic Mean" msgstr "调和平均" #: ../data/functions.xml.in.h:228 msgid "Heaviside Step Function" msgstr "Heaviside阶梯函数" #: ../data/functions.xml.in.h:229 msgid "Height" msgstr "高度" #: ../data/functions.xml.in.h:230 msgid "Height of Regular Tetrahedron" msgstr "正四面体的高度" #: ../data/functions.xml.in.h:231 msgid "Height of Square Pyramid" msgstr "方角锥的高度" #: ../data/functions.xml.in.h:232 msgid "Hexadecimal" msgstr "十六进制" #: ../data/functions.xml.in.h:233 msgid "Hexadecimal number" msgstr "十六进制数" #: ../data/functions.xml.in.h:234 msgid "Hyperbolic Cosecant" msgstr "双曲余割" #: ../data/functions.xml.in.h:235 msgid "Hyperbolic Cosine" msgstr "双曲余弦" #: ../data/functions.xml.in.h:236 msgid "Hyperbolic Cotangent" msgstr "双曲余切" #: ../data/functions.xml.in.h:237 msgid "Hyperbolic Secant" msgstr "双曲正切" #: ../data/functions.xml.in.h:238 msgid "Hyperbolic Sine" msgstr "双曲正弦" #: ../data/functions.xml.in.h:239 msgid "Hyperbolic Tangent" msgstr "双曲正割" #: ../data/functions.xml.in.h:240 msgid "Hyperfactorial" msgstr "hyper阶乘" #: ../data/functions.xml.in.h:241 msgid "Hypotenuse" msgstr "斜边" #: ../data/functions.xml.in.h:242 msgid "Identity" msgstr "单位矩阵" #: ../data/functions.xml.in.h:243 msgid "If...Then...Else" msgstr "If...Then...Else" #: ../data/functions.xml.in.h:244 msgid "Imaginary Part" msgstr "虚部" #: ../data/functions.xml.in.h:245 msgid "Index" msgstr "下标" #: ../data/functions.xml.in.h:246 msgid "Index variable" msgstr "下标变量" #: ../data/functions.xml.in.h:247 msgid "Initial value" msgstr "初始值" #: ../data/functions.xml.in.h:248 msgid "Initial value of counter" msgstr "计数器初始值" #: ../data/functions.xml.in.h:249 msgid "Integers" msgstr "整数" #: ../data/functions.xml.in.h:250 msgid "Integral point" msgstr "积分点" #: ../data/functions.xml.in.h:251 msgid "Integrate" msgstr "积分" #: ../data/functions.xml.in.h:252 msgid "Interest paid on a given period of an investment (ISPMT)" msgstr "给定投资期内要支付的利息(ISPMT)" #: ../data/functions.xml.in.h:253 msgid "Interest rate" msgstr "利率" #: ../data/functions.xml.in.h:254 msgid "Interest rate for a fully invested security" msgstr "一项已充分投资证券的利率" #: ../data/functions.xml.in.h:255 msgid "Interquartile Range" msgstr "四分位距" #: ../data/functions.xml.in.h:256 msgid "Inverse Cosecant" msgstr "反余割" #: ../data/functions.xml.in.h:257 msgid "Inverse Cosine" msgstr "反余弦" #: ../data/functions.xml.in.h:258 msgid "Inverse Cotangent" msgstr "反余切" #: ../data/functions.xml.in.h:259 msgid "Inverse Hyperbolic Cosecant" msgstr "反双曲余割" #: ../data/functions.xml.in.h:260 msgid "Inverse Hyperbolic Cosine" msgstr "反双曲余弦" #: ../data/functions.xml.in.h:261 msgid "Inverse Hyperbolic Cotangent" msgstr "反双曲余切" #: ../data/functions.xml.in.h:262 msgid "Inverse Hyperbolic Secant" msgstr "反双曲正割" #: ../data/functions.xml.in.h:263 msgid "Inverse Hyperbolic Sine" msgstr "反双曲正弦" #: ../data/functions.xml.in.h:264 msgid "Inverse Hyperbolic Tangent" msgstr "反双曲正切" #: ../data/functions.xml.in.h:265 msgid "Inverse Secant" msgstr "反正割" #: ../data/functions.xml.in.h:266 msgid "Inverse Sine" msgstr "反正弦" #: ../data/functions.xml.in.h:267 msgid "Inverse Tangent" msgstr "反正切" #: ../data/functions.xml.in.h:268 msgid "Investment" msgstr "投资" #: ../data/functions.xml.in.h:269 msgid "Is Integer" msgstr "是整数" #: ../data/functions.xml.in.h:270 msgid "Is Number" msgstr "是数字" #: ../data/functions.xml.in.h:271 msgid "Is Rational" msgstr "是有理数" #: ../data/functions.xml.in.h:272 msgid "Is Real" msgstr "是实数" #: ../data/functions.xml.in.h:273 msgid "Issue date" msgstr "发表日期" #: ../data/functions.xml.in.h:274 msgid "Kronecker Delta" msgstr "Kronecker Delta" #: ../data/functions.xml.in.h:275 msgid "Lambert W Function (Omega Function, Product Log)" msgstr "Lambert W函数(ω函数, Product Log)" #: ../data/functions.xml.in.h:276 msgid "Last element" msgstr "最后一个元素" #: ../data/functions.xml.in.h:277 msgid "Leading Coefficient" msgstr "首项系数" #: ../data/functions.xml.in.h:278 msgid "Least Common Multiplier" msgstr "最小公倍数" #: ../data/functions.xml.in.h:279 msgid "Length" msgstr "长度" #: ../data/functions.xml.in.h:280 msgid "Length of base" msgstr "底面长度" #: ../data/functions.xml.in.h:281 msgid "Length of side" msgstr "边长" #: ../data/functions.xml.in.h:282 msgid "Length of string" msgstr "字符串长度" #: ../data/functions.xml.in.h:283 msgid "Level-Coupon Bond" msgstr "息票债券" #: ../data/functions.xml.in.h:284 msgid "Life" msgstr "" #: ../data/functions.xml.in.h:285 msgid "Load CSV File" msgstr "载入CSV文件" #: ../data/functions.xml.in.h:286 msgid "Local Date Format" msgstr "本地日期格式" #: ../data/functions.xml.in.h:287 msgid "Logical" msgstr "逻辑" #: ../data/functions.xml.in.h:288 msgid "Logical Exclusive OR" msgstr "逻辑排斥OR" #: ../data/functions.xml.in.h:289 msgid "Logistic Distribution" msgstr "Logistic分布" #: ../data/functions.xml.in.h:290 msgid "Logit Transformation" msgstr "Logit变换" #: ../data/functions.xml.in.h:291 msgid "Lower limit" msgstr "下限" #: ../data/functions.xml.in.h:292 msgid "Lower limit (i)" msgstr "下限(i)" #: ../data/functions.xml.in.h:293 msgid "Lowest Degree (Valuation)" msgstr "末项次数(估计)" #: ../data/functions.xml.in.h:294 msgid "Market interest rate" msgstr "市场利率" #: ../data/functions.xml.in.h:295 msgid "Matrices & Vectors" msgstr "矩阵与向量" #: ../data/functions.xml.in.h:296 msgid "Matrix" msgstr "矩阵" #: ../data/functions.xml.in.h:297 msgid "Matrix Area" msgstr "子矩阵" #: ../data/functions.xml.in.h:298 msgid "Matrix Inverse" msgstr "求逆矩阵" #: ../data/functions.xml.in.h:299 msgid "Matrix or rows/columns" msgstr "矩阵或行/列" #: ../data/functions.xml.in.h:300 msgid "Matrix or vector" msgstr "矩阵或向量" #: ../data/functions.xml.in.h:301 msgid "Matrix variable" msgstr "矩阵变量" #: ../data/functions.xml.in.h:302 msgid "Matrix/vector" msgstr "矩阵/向量" #: ../data/functions.xml.in.h:303 msgid "Maturity date" msgstr "到期日期" #: ../data/functions.xml.in.h:304 msgid "Max" msgstr "最大值" #: ../data/functions.xml.in.h:305 msgid "Mean" msgstr "平均" #: ../data/functions.xml.in.h:306 msgid "Mean Deviation" msgstr "均差" #: ../data/functions.xml.in.h:307 msgid "Means" msgstr "平均" #: ../data/functions.xml.in.h:308 msgid "Median" msgstr "中位数" #: ../data/functions.xml.in.h:309 msgid "Merge Vectors" msgstr "合并向量" #: ../data/functions.xml.in.h:310 msgid "Message" msgstr "信息" #: ../data/functions.xml.in.h:311 msgid "Microeconomics" msgstr "微观经济学" #: ../data/functions.xml.in.h:312 msgid "Min" msgstr "最小值" #: ../data/functions.xml.in.h:313 msgid "Miscellaneous" msgstr "杂项" #: ../data/functions.xml.in.h:314 msgid "Mode" msgstr "模式" #: ../data/functions.xml.in.h:315 msgid "Modulus" msgstr "模" #: ../data/functions.xml.in.h:316 msgid "Moments" msgstr "统计矩" #: ../data/functions.xml.in.h:317 msgid "Month" msgstr "月份" #: ../data/functions.xml.in.h:318 msgid "Months" msgstr "月份" #: ../data/functions.xml.in.h:319 msgid "Multifactorial" msgstr "多阶乘" #: ../data/functions.xml.in.h:320 msgid "Multiply" msgstr "乘" #: ../data/functions.xml.in.h:322 msgid "Natural Logarithm" msgstr "自然对数" #: ../data/functions.xml.in.h:323 msgid "Negate" msgstr "非" #: ../data/functions.xml.in.h:324 msgid "New value" msgstr "新值" #: ../data/functions.xml.in.h:325 msgid "Nominal Interest Rate" msgstr "名义利率" #: ../data/functions.xml.in.h:326 msgid "Nominal interest rate" msgstr "名义利率" #: ../data/functions.xml.in.h:327 msgid "Non-negative value" msgstr "非负值" #: ../data/functions.xml.in.h:328 msgid "Norm (length)" msgstr "范数(长度)" #: ../data/functions.xml.in.h:329 msgid "Nth root" msgstr "N次方根" #. A numerical value #: ../data/functions.xml.in.h:331 msgid "Number" msgstr "数字" #: ../data/functions.xml.in.h:332 msgid "Number Base" msgstr "数字进制" #: ../data/functions.xml.in.h:333 msgid "Number Bases" msgstr "数字进制" #: ../data/functions.xml.in.h:334 msgid "Number Theory" msgstr "数论" #: ../data/functions.xml.in.h:335 msgid "Number of Samples" msgstr "样本数量" #: ../data/functions.xml.in.h:336 msgid "Number of coupons to be paid" msgstr "要支付的息票数量" #: ../data/functions.xml.in.h:337 msgid "Number of elements" msgstr "元素个数" #: ../data/functions.xml.in.h:338 msgid "Number of periods" msgstr "期数" #: ../data/functions.xml.in.h:339 msgid "Numerator" msgstr "分子" #: ../data/functions.xml.in.h:340 msgid "Objects" msgstr "对象个数" #: ../data/functions.xml.in.h:341 msgid "Octal" msgstr "八进制" #: ../data/functions.xml.in.h:342 msgid "Octal number" msgstr "八进制数" #: ../data/functions.xml.in.h:343 msgid "Odd" msgstr "奇" #: ../data/functions.xml.in.h:344 msgid "Order" msgstr "次数" #: ../data/functions.xml.in.h:345 msgid "Original value" msgstr "原始值" #: ../data/functions.xml.in.h:346 msgid "Paired T-Test" msgstr "配对t检验" #: ../data/functions.xml.in.h:347 msgid "Par value" msgstr "面值" #: ../data/functions.xml.in.h:348 msgid "Parallelogram" msgstr "平行四边形" #: ../data/functions.xml.in.h:349 msgid "Parallelogram Area" msgstr "平行四边形面积" #: ../data/functions.xml.in.h:350 msgid "Parallelogram Perimeter" msgstr "平行四边形周长" #: ../data/functions.xml.in.h:351 msgid "Pareto Distribution" msgstr "Pareto分布" #: ../data/functions.xml.in.h:352 msgid "Payment for a loan" msgstr "贷款偿还" #: ../data/functions.xml.in.h:353 msgid "Payment made each period" msgstr "每期支付" #: ../data/functions.xml.in.h:354 msgid "Payment of an annuity going towards interest (IPMT)" msgstr "利息的年金支付额(IPMT)" #: ../data/functions.xml.in.h:355 msgid "Payment of an annuity going towards principal (PPMT)" msgstr "本金的年金支付额(PPMT)" #: ../data/functions.xml.in.h:356 msgid "Pearson's Correlation Coefficient" msgstr "个人相关系数" #: ../data/functions.xml.in.h:357 msgid "Percentile" msgstr "百分位数" #: ../data/functions.xml.in.h:359 #, no-c-format msgid "Percentile (%)" msgstr "百分位数(%)" #: ../data/functions.xml.in.h:360 msgid "Period" msgstr "周期" #: ../data/functions.xml.in.h:361 msgid "Periodic interest rate" msgstr "周期利率" #: ../data/functions.xml.in.h:362 msgid "Periods" msgstr "周期" #: ../data/functions.xml.in.h:363 msgid "Periods for investment to attain desired value" msgstr "要获得想要的值,需要的投资期数" #: ../data/functions.xml.in.h:364 msgid "Periods of an investment" msgstr "投资的期数" #: ../data/functions.xml.in.h:365 msgid "Periods per year" msgstr "每年的期数" #: ../data/functions.xml.in.h:366 msgid "Permanent" msgstr "积和式" #: ../data/functions.xml.in.h:367 msgid "Permutations (Variations)" msgstr "排列" #: ../data/functions.xml.in.h:368 msgid "Polynomial" msgstr "多项式" #: ../data/functions.xml.in.h:369 msgid "Polynomial Degree" msgstr "多项式次数" #: ../data/functions.xml.in.h:370 msgid "Polynomials" msgstr "多项式" #: ../data/functions.xml.in.h:371 msgid "Pooled Variance" msgstr "合并方差" #: ../data/functions.xml.in.h:372 msgid "Precalculate expression" msgstr "预先计算表达式" #: ../data/functions.xml.in.h:373 msgid "Present Value" msgstr "现值" #: ../data/functions.xml.in.h:374 msgid "Present value" msgstr "现值" #: ../data/functions.xml.in.h:375 msgid "Price" msgstr "价格" #: ../data/functions.xml.in.h:376 msgid "Price per $100 face value" msgstr "每$100票面价值的价格" #: ../data/functions.xml.in.h:377 msgid "Price per $100 face value of a security" msgstr "一支证券每$100票面价值的价格" #: ../data/functions.xml.in.h:378 msgid "Price per $100 face value of a security bond" msgstr "一支债券每$100票面价值的价格" #: ../data/functions.xml.in.h:379 msgid "Price variable" msgstr "价格变量" #: ../data/functions.xml.in.h:380 msgid "Primitive Part" msgstr "原始部分" #: ../data/functions.xml.in.h:381 msgid "Principal" msgstr "本金" #: ../data/functions.xml.in.h:382 msgid "Prism" msgstr "棱柱" #: ../data/functions.xml.in.h:383 msgid "Process Matrix Elements" msgstr "处理矩阵元素" #: ../data/functions.xml.in.h:384 msgid "Process Vector Elements" msgstr "处理向量元素" #: ../data/functions.xml.in.h:385 msgid "Producer Surplus" msgstr "" #: ../data/functions.xml.in.h:386 msgid "Product" msgstr "连乘" #: ../data/functions.xml.in.h:387 msgid "Puts each element of a matrix in vertical order in a vector." msgstr "将按照垂直顺序将矩阵中的每个元素放到向量中。" #: ../data/functions.xml.in.h:388 msgid "Pyramid" msgstr "锥体" #: ../data/functions.xml.in.h:389 msgid "Pyramid Volume" msgstr "锥体体积" #: ../data/functions.xml.in.h:390 msgid "Quadratic Mean (RMS)" msgstr "均方(RMS)" #: ../data/functions.xml.in.h:391 msgid "Quantity variabel" msgstr "数量变量" #: ../data/functions.xml.in.h:392 msgid "Quartile" msgstr "四分位数" #: ../data/functions.xml.in.h:393 msgid "RPN Stack Register" msgstr "RPN栈寄存器" #: ../data/functions.xml.in.h:394 msgid "RPN Stack Vector" msgstr "RPN栈向量" #: ../data/functions.xml.in.h:395 msgid "Radians" msgstr "弧度" #: ../data/functions.xml.in.h:396 msgid "Radians to Default Angle Unit" msgstr "将弧度转换到缺省角度单位" #: ../data/functions.xml.in.h:397 msgid "Radius" msgstr "半径" #: ../data/functions.xml.in.h:398 msgid "Raise" msgstr "乘方" #: ../data/functions.xml.in.h:399 msgid "Ramp Function" msgstr " 斜坡函数" #: ../data/functions.xml.in.h:400 msgid "Random Number" msgstr "随机数" #: ../data/functions.xml.in.h:401 msgid "Random Number Between Limits" msgstr "在某一范围内的随机数" #: ../data/functions.xml.in.h:402 msgid "Range" msgstr "范围" #: ../data/functions.xml.in.h:403 msgid "Rank" msgstr "" #: ../data/functions.xml.in.h:404 msgid "Rate" msgstr "利率" #: ../data/functions.xml.in.h:405 msgid "Rayleigh Distribution" msgstr "Rayleigh分布" #: ../data/functions.xml.in.h:406 msgid "Rayleigh Tail Distribution" msgstr "Rayleigh尾分布" #: ../data/functions.xml.in.h:407 msgid "Real Part" msgstr "实部" #: ../data/functions.xml.in.h:408 msgid "Reciprocal" msgstr "倒数" #: ../data/functions.xml.in.h:409 msgid "Rectangle" msgstr "矩形" #: ../data/functions.xml.in.h:410 msgid "Rectangle Area" msgstr "矩形面积" #: ../data/functions.xml.in.h:411 msgid "Rectangle Perimeter" msgstr "矩形周长" #: ../data/functions.xml.in.h:412 msgid "Rectangular Function" msgstr "矩阵函数" #: ../data/functions.xml.in.h:413 msgid "Redemption" msgstr "偿还" #: ../data/functions.xml.in.h:414 msgid "Regression" msgstr "回归分析" #: ../data/functions.xml.in.h:415 msgid "Remainder" msgstr "余数" #: ../data/functions.xml.in.h:416 msgid "" "Removes all units from an expression. The expression is calculated before " "the removal." msgstr "从表达式中删除全部单位。在删除之前会先对表达式进行计算。" #: ../data/functions.xml.in.h:417 msgid "Replace" msgstr "替换" #: ../data/functions.xml.in.h:418 msgid "" "Replaces a certain value in an expression with a new value. The expression " "is calculated before the replacement if the fourth argument is true." msgstr "" "使用新值替换表达式中的特定值。如果第四个参数是真,则在替换前首先对表达式 " "进行计算。" #: ../data/functions.xml.in.h:419 msgid "Represents Integer" msgstr "代表整数" #: ../data/functions.xml.in.h:420 msgid "Represents Number" msgstr "代表数字" #: ../data/functions.xml.in.h:421 msgid "Represents Rational" msgstr "代表有理数" #: ../data/functions.xml.in.h:422 msgid "Represents Real" msgstr "代表实数" #: ../data/functions.xml.in.h:423 msgid "Return on continuously compounded interest" msgstr "根据连续复合利率的回报" #: ../data/functions.xml.in.h:424 msgid "Returns 0 if i != j and 1 if i = j." msgstr "如果i不等于j,返回0;如果i等于j,返回1。" #: ../data/functions.xml.in.h:425 msgid "Returns a column in a matrix as a vector." msgstr "将矩阵的一列作为向量返回。" #: ../data/functions.xml.in.h:426 msgid "Returns a matrix imported from a CSV data file." msgstr "返回从CSV数据文件导入的矩阵" #: ../data/functions.xml.in.h:427 msgid "" "Returns a matrix with specified dimensions and listed elements. Omitted " "elements are set to zero." msgstr "根据指定的维数和列出的元素返回一个矩阵。省略被设为零的元素。" #: ../data/functions.xml.in.h:428 msgid "Returns a part of a matrix." msgstr "返回矩阵的一部分。" #: ../data/functions.xml.in.h:429 msgid "Returns a part of a vector between two positions." msgstr "返回一个向量两个位置之间的一部分。" #: ../data/functions.xml.in.h:430 msgid "Returns a row in a matrix as a vector." msgstr "将矩阵的一行作为向量返回。" #: ../data/functions.xml.in.h:431 msgid "Returns a sorted vector. ex. sort([6, 1, 4])=[1, 4, 6]" msgstr "对向量排序后返回。 例如, sort([6, 1, 4])=[1, 4, 6]" #: ../data/functions.xml.in.h:432 msgid "Returns a value from a hexadecimal number" msgstr "返回一个十六进制数字表示的数值" #: ../data/functions.xml.in.h:433 msgid "" "Returns a vector generated from a function with a variable (default x) " "running from min to max. The fourth argument is either the requested number " "of elements if the sixth argument is false (default) or the step between " "each value of the variable." msgstr "" "根据指定的自变量(缺省为x)和数据范围,用指定函数的值生成一个向量并返回。" "如果第六个参数是假(缺省值),则第四个参数表示需要的元素个数;否则,第四个 " "参数表示变量每个值之间的步长。" #: ../data/functions.xml.in.h:434 msgid "Returns a vector with listed elements." msgstr "使用列出的元素生成一个向量并返回。" #: ../data/functions.xml.in.h:435 msgid "Returns a vector with the elements from two vectors." msgstr "将两个向量合成一个并返回。" #: ../data/functions.xml.in.h:436 msgid "" "Returns a vector with values of elements replaced with their mutual ranks." " ex. rank([6, 1, 4]) = [3, 1, 2]" msgstr "" #: ../data/functions.xml.in.h:437 msgid "" "Returns accrued interest for a security which pays periodic interest. " " Allowed frequencies are 1 - annual, 2 - semi-annual or 4 - quarterly. " "Basis is the type of day counting you want to use: 0: US 30/360 (default), " "1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "返回一个定期支付利息的证券的应计利息。 " "允许的支付频率为:1 - 年付, 2 - 半年付 或 4 - 季付。 " "\"基准\"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), " " 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。" #: ../data/functions.xml.in.h:438 msgid "Returns an integer between (including) bottom and top." msgstr "返回在顶部和底部之间(含底部)的一个整数。" #: ../data/functions.xml.in.h:439 msgid "Returns an integer from a binary number" msgstr "返回一个二进制数字表示的整数值。" #: ../data/functions.xml.in.h:440 msgid "Returns an integer from a number of specified base between 2 and 36" msgstr "返回一个指定进制(2-36之间)数字的值" #: ../data/functions.xml.in.h:441 msgid "Returns an integer from an octal number" msgstr "返回一个八进制数字表示的整数值。" #: ../data/functions.xml.in.h:442 msgid "Returns the RPN stack as a vector." msgstr "将RPN栈作为向量返回。" #: ../data/functions.xml.in.h:443 msgid "" "Returns the accrued interest for a security which pays interest at maturity " "date. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" "返回一个在到期时支付利息的证券的应计利息。 " "\"基准\"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), " " 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。" #: ../data/functions.xml.in.h:444 msgid "" "Returns the amount of payment for a loan based on a constant interest rate " "and constant payments (each payment is equal amount). If type = 1 " "then the payment is made at the beginning of the period, If type = 0 (or " "omitted) it is made at the end of each period." msgstr "" "返回一项利率固定并且定期偿还的贷款的偿还额。(每次偿还金额相同) " "\"类型\" 定义了到期日期。\"1\"代表在每个周期的开头支付; \"0\"(缺省值)代表在每个周期末尾支付。" #: ../data/functions.xml.in.h:445 msgid "" "Returns the amount received at the maturity date for an invested security." " Basis is the type of day counting you want to use: 0: US 30/360 " "(default), 1: real days, 2: real days/360, 3: real days/365 or 4: European " "30/360. The settlement date must be before maturity date." msgstr "" "返回一支证券到期时可得到的金额。 " "\"基准\"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), " " 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。" #: ../data/functions.xml.in.h:446 msgid "Returns the base n logarithm." msgstr "返回以n为底的对数。" #: ../data/functions.xml.in.h:447 msgid "Returns the bond equivalent for a treasury bill." msgstr "返回与一支短期债券等值的债券。" #: ../data/functions.xml.in.h:448 msgid "" "Returns the discount rate for a security. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "返回一支证券的贴现率。 " "\"基准\"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), " " 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。" #: ../data/functions.xml.in.h:449 msgid "" "Returns the element at specified position in a matrix (row and column) or " "vector (index)." msgstr "返回矩阵(行和列)或向量(下标)指定位置上的元素。" #: ../data/functions.xml.in.h:450 msgid "Returns the highest value." msgstr "返回最大值。" #: ../data/functions.xml.in.h:451 msgid "" "Returns the identity matrix of a matrix or with specified number of rows/" "columns." msgstr "返回指定行/列数或与指定矩阵同阶的单位矩阵。" #: ../data/functions.xml.in.h:452 msgid "" "Returns the interest rate for a fully invested security. Basis is " "the type of day counting you want to use: 0: US 30/360 (default), 1: real " "days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "返回一支已充分投资的证券的利率。 " "\"基准\"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), " " 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。" #: ../data/functions.xml.in.h:453 msgid "Returns the inverse function for mx*e^x as ln() does for e^x." msgstr "返回函数mx*e^x的逆函数。" #: ../data/functions.xml.in.h:454 msgid "Returns the lowest value." msgstr "返回最小值。" #: ../data/functions.xml.in.h:455 msgid "Returns the most frequently occuring value." msgstr "返回最常出现的值。" #: ../data/functions.xml.in.h:456 msgid "Returns the non-negative square root of x * pi" msgstr "返回xπ的非负平方根" #: ../data/functions.xml.in.h:457 msgid "Returns the number of columns in a matrix." msgstr "返回矩阵的列数。" #: ../data/functions.xml.in.h:458 msgid "" "Returns the number of coupons to be paid between the settlement and the " "maturity. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" "返回在结算日和到期日期之间要支付的期票数量。 " "\"基准\"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), " " 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。" #: ../data/functions.xml.in.h:459 msgid "" "Returns the number of days between two dates. Basis is the type of " "day counting you want to use: 0: US 30/360, 1: real days (default), 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "返回两个日期之间的天数。 " "\"基准\"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), " " 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。" #: ../data/functions.xml.in.h:460 msgid "Returns the number of elements in a matrix or vector." msgstr "返回一个矩阵或向量内的元素数目。" #: ../data/functions.xml.in.h:461 msgid "Returns the number of elements in a vector." msgstr "返回一个向量内的元素数量。" #: ../data/functions.xml.in.h:462 msgid "" "Returns the number of periods needed for an investment to attain a desired " "value." msgstr "返回一项投资要得到想要的金额,所需要的期数。" #: ../data/functions.xml.in.h:463 msgid "" "Returns the number of possible arrangements of an ordered list with a number " "of objects to choose from and a list size. If there are three objects (1, 2 " "and 3) that is put in a list with two positions, the alternatives are [1, " "2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2], and thus the number of " "permutations is 6." msgstr "" "返回排列数,即从包含指定数量对象的集合中选择指定数量个元素生成有序列表,所能生成 " "的所有不同有序列表的个数。例如,如果集合中有三个元素(1,2和3),从中任选两个元素生成 " "有序列表,可能的列表为[1, 2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2],因此排列数为6。" #: ../data/functions.xml.in.h:464 msgid "" "Returns the number of possible arrangements of an unordered list with a " "number of objects to choose from and a list size. If there are three objects " "(1, 2 and 3) that is put in a list with place for two, the alternatives are " "[1, 2], [1, 3], and [2, 3], and thus the number of combinations is 3." msgstr "" "返回组合数,即从包含指定数量对象的集合中选择指定数量个元素生成无序列表,所能生成 " "的所有不同无序列表的个数。例如,如果集合中有三个元素(1,2和3),从中任选两个元素生成 " "有序列表,可能的列表为[1, 2], [1, 3], and [2, 3],因此组合数为3。" #: ../data/functions.xml.in.h:465 msgid "" "Returns the number of possible rearrangements of an ordered list, of a " "certain size, where none of the objects are on their original position. If " "the original list is [1, 2, 3], the possible derangements is [2, 3, 1] and " "[3, 1, 2], and thus the number of derangements is 2." msgstr "" "返回重排数,即对给定列表中的元素重新排列,并且限定每个元素都不能在原来的位置 " "上,所得的列表数量。例如,如果原始列表为[1,2,3],则可能的重排列表为[2, 3, 1]和" "[3, 1, 2]。因此重排数为2。" #: ../data/functions.xml.in.h:466 msgid "Returns the number of rows in a matrix." msgstr "返回矩阵中的行数。" #: ../data/functions.xml.in.h:467 msgid "Returns the number of samples." msgstr "返回样本数量。" #: ../data/functions.xml.in.h:468 msgid "" "Returns the number of years (fractional) between two dates. Basis " "is the type of day counting you want to use: 0: US 30/360, 1: real days " "(default), 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "返回两个日期之间的年数(分数值)。 " "\"基准\"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), " " 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。" #: ../data/functions.xml.in.h:469 msgid "" "Returns the present value of an investment. If type = 1 then the " "payment is made at the beginning of the period, If type = 0 (or omitted) it " "is made at the end of each period." msgstr "" "返回一项投资的现值。 " "\"类型\" 定义了到期日期。\"1\"代表在每个周期的开头支付; \"0\"(缺省值)代表在每个周期末尾支付。" #: ../data/functions.xml.in.h:470 msgid "Returns the price per $100 value for a treasury bill." msgstr "返回一支短期债券每100美元面值的价格。" #: ../data/functions.xml.in.h:471 msgid "" "Returns the probability density p(x) at x for a Pareto distribution with " "exponent and scale. (from Gnumeric)" msgstr "根据指定的指数和规模返回Pareto分布在x点的密度概率p(x)。(用Gnumeric)" #: ../data/functions.xml.in.h:472 msgid "" "Returns the probability density p(x) at x for a Rayleigh distribution with " "scale parameter sigma. (from Gnumeric)" msgstr "根据指定的规模参数Sigma返回Rayleigh分布在x点的密度概率p(x)。(用Gnumeric)" #: ../data/functions.xml.in.h:473 msgid "" "Returns the probability density p(x) at x for a Rayleigh tail distribution " "with scale parameter sigma and a lower limit. (from Gnumeric)" msgstr "根据指定的规模参数Sigma和下限返回Rayleigh尾分布在x点的密度概率p(x)。(用Gnumeric)" #: ../data/functions.xml.in.h:474 msgid "" "Returns the probability density p(x) at x for a logistic distribution with " "scale parameter. (from Gnumeric)" msgstr "根据指定的规模返回logistic分布在x点的密度概率p(x)。(用Gnumeric)" #: ../data/functions.xml.in.h:475 msgid "Returns the transpose of a matrix." msgstr "返回矩阵的转置。" #: ../data/functions.xml.in.h:476 msgid "Returns the value of a RPN stack register." msgstr "返回RPN栈寄存器的值。" #: ../data/functions.xml.in.h:477 msgid "Returns the value of a roman number." msgstr "返回罗马数字表示的值。" #: ../data/functions.xml.in.h:478 msgid "" "Returns the value of an investment, given the principal, nominal interest " "rate, compounding frequency and time." msgstr "根据给定的本金、名义利率、复合频率和时间计算并返回投资的值。" #: ../data/functions.xml.in.h:479 msgid "Returns the yield for a treasury bill." msgstr "返回短期债券的收益。" #: ../data/functions.xml.in.h:480 msgid "Riemann Zeta" msgstr "Riemann Zeta" #: ../data/functions.xml.in.h:481 msgid "Roman Number" msgstr "罗马数字" #: ../data/functions.xml.in.h:482 msgid "Roman number" msgstr "罗马数字" #: ../data/functions.xml.in.h:483 msgid "Round" msgstr "取整" #: ../data/functions.xml.in.h:484 msgid "Round Downwards" msgstr "向下取整" #: ../data/functions.xml.in.h:485 msgid "Round Towards Zero" msgstr "向零取整" #: ../data/functions.xml.in.h:486 msgid "Round Upwards" msgstr "向上取整" #: ../data/functions.xml.in.h:487 msgid "Rounding" msgstr "取整" #: ../data/functions.xml.in.h:488 msgid "Row" msgstr "行" #: ../data/functions.xml.in.h:489 msgid "Row variable" msgstr "行变量" #: ../data/functions.xml.in.h:490 msgid "Row/index" msgstr "行/下标" #: ../data/functions.xml.in.h:491 msgid "Rows" msgstr "行" #: ../data/functions.xml.in.h:492 msgid "Salvage value" msgstr "残值" #: ../data/functions.xml.in.h:493 msgid "Save as Variable" msgstr "作为变量保存" #: ../data/functions.xml.in.h:494 msgid "Scale" msgstr "规模" #: ../data/functions.xml.in.h:495 msgid "Secant" msgstr "正割" #: ../data/functions.xml.in.h:496 msgid "Second date" msgstr "第二个日期" #: ../data/functions.xml.in.h:497 msgid "Select Vector Elements" msgstr "选择矩阵元素" #: ../data/functions.xml.in.h:498 msgid "Select first match" msgstr "选择第一个匹配项" #: ../data/functions.xml.in.h:499 msgid "Separator" msgstr "分隔符" #: ../data/functions.xml.in.h:500 msgid "Settlement date" msgstr "结算日期" #: ../data/functions.xml.in.h:501 msgid "Side A" msgstr "边A" #: ../data/functions.xml.in.h:502 msgid "Side B" msgstr "边B" #: ../data/functions.xml.in.h:503 msgid "Sigma" msgstr "Sigma" #: ../data/functions.xml.in.h:504 msgid "Sigmoid Function" msgstr "sigmoid函数" #: ../data/functions.xml.in.h:505 msgid "Signum" msgstr "符号函数" #: ../data/functions.xml.in.h:506 msgid "Sine" msgstr "正弦" #: ../data/functions.xml.in.h:507 msgid "Size" msgstr "大小" #: ../data/functions.xml.in.h:508 msgid "Solve equation" msgstr "方程求解" #: ../data/functions.xml.in.h:509 msgid "Solve for multiple variables" msgstr "多变量求解" #: ../data/functions.xml.in.h:510 msgid "Solve for two variables" msgstr "双变量求解" #: ../data/functions.xml.in.h:511 msgid "" "Solves two equations with two unknown variables. Returns the value of the " "first variable." msgstr "解由两个未知数和两个方程组成方程组。返回第一个变量的值。" #: ../data/functions.xml.in.h:512 msgid "Sort" msgstr "排序" #: ../data/functions.xml.in.h:513 msgid "Spearman's Rho" msgstr "" #: ../data/functions.xml.in.h:514 msgid "Sphere" msgstr "球体" #: ../data/functions.xml.in.h:515 msgid "Sphere Volume" msgstr "球体积" #: ../data/functions.xml.in.h:516 msgid "Square" msgstr "正方形" #: ../data/functions.xml.in.h:517 msgid "Square Area" msgstr "正方形面积" #: ../data/functions.xml.in.h:518 msgid "Square Perimeter" msgstr "正方形周长" #: ../data/functions.xml.in.h:519 msgid "Square Root" msgstr "平方根" #: ../data/functions.xml.in.h:520 msgid "Square root (x * pi)" msgstr "平方根(x*π)" #: ../data/functions.xml.in.h:521 msgid "Standard Date Format" msgstr "标准日期格式" #: ../data/functions.xml.in.h:522 msgid "Standard Deviation (entire population)" msgstr "标准差(总体)" #: ../data/functions.xml.in.h:523 msgid "Standard Deviation (random sampling)" msgstr "标准差(随机采样)" #: ../data/functions.xml.in.h:524 msgid "Standard Error" msgstr "标准误差" #: ../data/functions.xml.in.h:525 msgid "Start column" msgstr "起始列" #: ../data/functions.xml.in.h:526 msgid "Start row" msgstr "起始行" #: ../data/functions.xml.in.h:527 msgid "Statistical Correlation" msgstr "统计相关" #: ../data/functions.xml.in.h:528 msgid "Statistical Tests" msgstr "统计测试" #: ../data/functions.xml.in.h:529 msgid "Statistics" msgstr "统计" #: ../data/functions.xml.in.h:530 msgid "Step Functions" msgstr "阶梯函数" #: ../data/functions.xml.in.h:531 msgid "Straight Line Depreciation" msgstr "直线折旧" #: ../data/functions.xml.in.h:532 msgid "Strip Units" msgstr "剥离单位" #: ../data/functions.xml.in.h:533 msgid "Subtract" msgstr "减" #: ../data/functions.xml.in.h:534 msgid "Sum" msgstr "求和" #: ../data/functions.xml.in.h:535 msgid "Sum (total)" msgstr "总和" #: ../data/functions.xml.in.h:536 msgid "Sum-of-Years Digits Depreciation" msgstr "年数总和折旧" #: ../data/functions.xml.in.h:537 msgid "Superfactorial" msgstr "超级阶乘" #: ../data/functions.xml.in.h:538 msgid "Supply function" msgstr "供给函数" #: ../data/functions.xml.in.h:539 msgid "Supply function or price" msgstr "供给函数或价格" #: ../data/functions.xml.in.h:540 msgid "Surface Area of Cone" msgstr "圆锥表面积" #: ../data/functions.xml.in.h:541 msgid "Surface Area of Cube" msgstr "立方体表面积" #: ../data/functions.xml.in.h:542 msgid "Surface Area of Cylinder" msgstr "圆柱体表面积" #: ../data/functions.xml.in.h:543 msgid "Surface Area of Rectangular Prism" msgstr " 矩形棱柱表面积" #: ../data/functions.xml.in.h:544 msgid "Surface Area of Regular Tetrahedron" msgstr "正四面体表面积" #: ../data/functions.xml.in.h:545 msgid "Surface Area of Sphere" msgstr "球体表面积" #: ../data/functions.xml.in.h:546 msgid "Surface Area of Square Pyramid" msgstr "方锥体表面积" #: ../data/functions.xml.in.h:547 msgid "Tangent" msgstr "正切" #: ../data/functions.xml.in.h:548 msgid "Term expression" msgstr "项表达式" #: ../data/functions.xml.in.h:549 msgid "Terms" msgstr "项" #: ../data/functions.xml.in.h:550 msgid "Tests a condition and returns a value depending on the result." msgstr "对一个条件进行测试,并根据测试结果返回一个值。" #: ../data/functions.xml.in.h:551 msgid "Text" msgstr "文字" #: ../data/functions.xml.in.h:552 msgid "Text string 1" msgstr "文字1" #: ../data/functions.xml.in.h:553 msgid "Text string 2" msgstr "文字2" #: ../data/functions.xml.in.h:554 ../data/units.xml.in.h:311 msgid "Time" msgstr "时间" #: ../data/functions.xml.in.h:555 msgid "Timestamp" msgstr "时间戳" #: ../data/functions.xml.in.h:556 msgid "Title" msgstr "标题" #: ../data/functions.xml.in.h:557 msgid "Top" msgstr "顶部" #: ../data/functions.xml.in.h:558 msgid "Trailing Coefficient" msgstr "末项系数" #: ../data/functions.xml.in.h:559 msgid "Transpose" msgstr "转置" #: ../data/functions.xml.in.h:560 msgid "Trapezoid" msgstr "梯形" #: ../data/functions.xml.in.h:561 msgid "Trapezoid Area" msgstr "梯形面积" #: ../data/functions.xml.in.h:562 msgid "Treasury Bill Equivalent" msgstr "短期债券等价物" #: ../data/functions.xml.in.h:563 msgid "Treasury Bill Price" msgstr "短期债券价格" #: ../data/functions.xml.in.h:564 msgid "Treasury Bill Yield" msgstr "短期债券收益" #: ../data/functions.xml.in.h:565 msgid "Triangle" msgstr "三角形" #: ../data/functions.xml.in.h:566 msgid "Triangle Area" msgstr "三角形面积" #: ../data/functions.xml.in.h:567 msgid "Triangle Perimeter" msgstr "(直角)三角形周长" #: ../data/functions.xml.in.h:568 msgid "Triangular Function" msgstr "三角函数" #: ../data/functions.xml.in.h:569 msgid "Trigonometry" msgstr "三角学" #: ../data/functions.xml.in.h:570 msgid "Trimmed Mean" msgstr "截尾均值" #: ../data/functions.xml.in.h:571 msgid "Trimmed percentage (at each end)" msgstr "截尾百分比(在每一端)" #: ../data/functions.xml.in.h:572 msgid "Type" msgstr "类型" #: ../data/functions.xml.in.h:573 msgid "Unit Part" msgstr "单位部分" #: ../data/functions.xml.in.h:574 msgid "Unix Timestamp to Date" msgstr "Unix时间戳转换为日期" #: ../data/functions.xml.in.h:575 msgid "Unpaired T-Test" msgstr "非配对T测试" #: ../data/functions.xml.in.h:576 msgid "Upper limit" msgstr "上限" #: ../data/functions.xml.in.h:577 msgid "Upper limit (n)" msgstr "上限(n)" #: ../data/functions.xml.in.h:578 msgid "Use step size" msgstr "使用步长" #: ../data/functions.xml.in.h:579 msgid "Utilities" msgstr "工具" #: ../data/functions.xml.in.h:580 msgid "Value" msgstr "值" #: ../data/functions.xml.in.h:581 msgid "Value 1" msgstr "值1" #: ../data/functions.xml.in.h:582 msgid "Value 1 (i)" msgstr "值1(i)" #: ../data/functions.xml.in.h:583 msgid "Value 2" msgstr "值2" #: ../data/functions.xml.in.h:584 msgid "Value 2 (j)" msgstr "值2(i)" #: ../data/functions.xml.in.h:585 msgid "Value variable" msgstr "值变量" #: ../data/functions.xml.in.h:586 msgid "Variable" msgstr "变量" #: ../data/functions.xml.in.h:587 msgid "Variable 1" msgstr "变量1" #: ../data/functions.xml.in.h:588 msgid "Variable 2" msgstr "变量2" #: ../data/functions.xml.in.h:589 msgid "Variable of integration" msgstr "积分变量" #: ../data/functions.xml.in.h:590 msgid "Variable vector" msgstr "变量向量" #: ../data/functions.xml.in.h:591 msgid "Variance (entire population)" msgstr "方差(总体)" #: ../data/functions.xml.in.h:592 msgid "Variance (random sampling)" msgstr "方差(随机样本)" #: ../data/functions.xml.in.h:593 msgid "Vector" msgstr "向量" #: ../data/functions.xml.in.h:594 msgid "Vector 1" msgstr "向量1" #: ../data/functions.xml.in.h:595 msgid "Vector 2" msgstr "向量2" #: ../data/functions.xml.in.h:596 msgid "Vector Limits" msgstr "向量限" #: ../data/functions.xml.in.h:597 msgid "Vector variable" msgstr "向量变量" #: ../data/functions.xml.in.h:598 msgid "Volume of Rectangular Prism" msgstr "矩形棱柱体积" #: ../data/functions.xml.in.h:599 msgid "Volume of Regular Tetrahedron" msgstr "正四面体体积" #: ../data/functions.xml.in.h:600 msgid "Volume of Square Pyramid" msgstr "方锥体体积" #: ../data/functions.xml.in.h:601 msgid "Volume of Triangular Prism" msgstr "三角棱柱体积" #: ../data/functions.xml.in.h:602 msgid "Week begins on Sunday" msgstr "每周从星期天开始" #: ../data/functions.xml.in.h:603 msgid "Week of Year" msgstr "一年中的第几周" #: ../data/functions.xml.in.h:605 msgid "Weighted Mean" msgstr "加权平均" #: ../data/functions.xml.in.h:606 msgid "Weights" msgstr "权重" #: ../data/functions.xml.in.h:607 msgid "Width" msgstr "宽度" #: ../data/functions.xml.in.h:608 msgid "Width of base" msgstr "底面宽度" #: ../data/functions.xml.in.h:609 msgid "Winsorized Mean" msgstr "Winsorized平均" #: ../data/functions.xml.in.h:610 msgid "Winsorized percentage (at each end)" msgstr "Winsorized百分比(在每一端)" #: ../data/functions.xml.in.h:611 msgid "With respect to" msgstr "关于" #: ../data/functions.xml.in.h:612 msgid "X" msgstr "X" #: ../data/functions.xml.in.h:613 msgid "X raised to the power Y" msgstr "X的Y次方" #: ../data/functions.xml.in.h:614 msgid "Year" msgstr "年" #: ../data/functions.xml.in.h:615 msgid "Years" msgstr "年" #: ../data/functions.xml.in.h:616 msgid "Years between two dates" msgstr "两个日期之间相隔的年数" #: ../data/functions.xml.in.h:617 msgid "Zero Coupon" msgstr "零息" #: ../data/functions.xml.in.h:618 msgid "au:√,r:sqrt" msgstr "au:√,r:sqrt" #: ../data/functions.xml.in.h:619 msgid "au:Π,r:product" msgstr "au:Π,r:product" #: ../data/functions.xml.in.h:620 msgid "au:Σ,r:sum" msgstr "au:Σ,r:sum" #: ../data/functions.xml.in.h:621 msgid "r:abs" msgstr "r:abs" #: ../data/functions.xml.in.h:622 msgid "r:accrint" msgstr "r:accrint" #: ../data/functions.xml.in.h:623 msgid "r:accrintm" msgstr "r:accrintm" #: ../data/functions.xml.in.h:624 msgid "r:acos" msgstr "r:acos" #: ../data/functions.xml.in.h:625 msgid "r:acosh" msgstr "r:acosh" #: ../data/functions.xml.in.h:626 msgid "r:acot" msgstr "r:acot" #: ../data/functions.xml.in.h:627 msgid "r:acoth" msgstr "r:acoth" #: ../data/functions.xml.in.h:628 msgid "r:acsc" msgstr "r:acsc" #: ../data/functions.xml.in.h:629 msgid "r:acsch" msgstr "r:acsch" #: ../data/functions.xml.in.h:630 msgid "r:add" msgstr "r:add" #: ../data/functions.xml.in.h:631 msgid "r:addDays" msgstr "r:addDays" #: ../data/functions.xml.in.h:632 msgid "r:addMonths" msgstr "r:addMonths" #: ../data/functions.xml.in.h:633 msgid "r:addTime" msgstr "r:addTime" #: ../data/functions.xml.in.h:634 msgid "r:addYears" msgstr "r:addYears" #: ../data/functions.xml.in.h:635 msgid "r:adj" msgstr "r:adj" #. Matrix area #: ../data/functions.xml.in.h:637 msgid "r:area" msgstr "r:area" #: ../data/functions.xml.in.h:638 msgid "r:asec" msgstr "r:asec" #: ../data/functions.xml.in.h:639 msgid "r:asech" msgstr "r:asech" #: ../data/functions.xml.in.h:640 msgid "r:asin" msgstr "r:asin" #: ../data/functions.xml.in.h:641 msgid "r:asinh" msgstr "r:asinh" #: ../data/functions.xml.in.h:642 msgid "r:atan" msgstr "r:atan" #: ../data/functions.xml.in.h:643 msgid "r:atanh" msgstr "r:atanh" #: ../data/functions.xml.in.h:644 msgid "r:base" msgstr "r:base" #: ../data/functions.xml.in.h:645 msgid "r:beta" msgstr "r:beta" #: ../data/functions.xml.in.h:646 msgid "r:bin" msgstr "r:bin" #: ../data/functions.xml.in.h:647 msgid "r:binomial" msgstr "r:binomial" #: ../data/functions.xml.in.h:648 msgid "r:bitxor" msgstr "r:bitxor" #: ../data/functions.xml.in.h:649 msgid "r:cbrt" msgstr "r:cbrt" #: ../data/functions.xml.in.h:650 msgid "r:ceil" msgstr "r:ceil" #: ../data/functions.xml.in.h:651 msgid "r:char" msgstr "r:char" #: ../data/functions.xml.in.h:652 msgid "r:circle" msgstr "r:circle" #: ../data/functions.xml.in.h:653 msgid "r:circumference" msgstr "r:circumference" #: ../data/functions.xml.in.h:654 msgid "r:cis" msgstr "r:cis" #: ../data/functions.xml.in.h:655 msgid "r:code" msgstr "r:code" #: ../data/functions.xml.in.h:656 msgid "r:coeff" msgstr "r:coeff" #: ../data/functions.xml.in.h:657 msgid "r:cofactor" msgstr "r:cofactor" #: ../data/functions.xml.in.h:658 msgid "r:column" msgstr "r:column" #: ../data/functions.xml.in.h:659 msgid "r:columns" msgstr "r:columns" #: ../data/functions.xml.in.h:660 msgid "r:comb" msgstr "r:comb" #: ../data/functions.xml.in.h:661 msgid "r:compound" msgstr "r:compound" #: ../data/functions.xml.in.h:662 msgid "r:concatenate" msgstr "r:concatenate" #: ../data/functions.xml.in.h:663 msgid "r:cone" msgstr "r:cone" #: ../data/functions.xml.in.h:664 msgid "r:cone_sa" msgstr "r:cone_sa" #: ../data/functions.xml.in.h:665 msgid "r:continuous" msgstr "r:continuous" #: ../data/functions.xml.in.h:666 msgid "r:cor" msgstr "r:cor" #: ../data/functions.xml.in.h:667 msgid "r:cos" msgstr "r:cos" #: ../data/functions.xml.in.h:668 msgid "r:cosh" msgstr "r:cosh" #: ../data/functions.xml.in.h:669 msgid "r:cot" msgstr "r:cot" #: ../data/functions.xml.in.h:670 msgid "r:coth" msgstr "r:coth" #: ../data/functions.xml.in.h:671 msgid "r:coupnum" msgstr "r:coupnum" #: ../data/functions.xml.in.h:672 msgid "r:cov,r:covar" msgstr "r:cov,r:covar" #: ../data/functions.xml.in.h:673 msgid "r:cross" msgstr "r:cross" #: ../data/functions.xml.in.h:674 msgid "r:csc" msgstr "r:csc" #: ../data/functions.xml.in.h:675 msgid "r:csch" msgstr "r:csch" #: ../data/functions.xml.in.h:676 msgid "r:csum" msgstr "r:csum" #: ../data/functions.xml.in.h:677 msgid "r:csurplus" msgstr "r:csurplus" #: ../data/functions.xml.in.h:678 msgid "r:cube" msgstr "r:cube" #: ../data/functions.xml.in.h:679 msgid "r:cube_sa" msgstr "r:cube_sa" #: ../data/functions.xml.in.h:680 msgid "r:cylinder" msgstr "r:cylinder" #: ../data/functions.xml.in.h:681 msgid "r:cylinder_sa" msgstr "r:cylinder_sa" #: ../data/functions.xml.in.h:682 msgid "r:day" msgstr "r:day" #: ../data/functions.xml.in.h:683 msgid "r:days" msgstr "r:days" #: ../data/functions.xml.in.h:684 msgid "r:decile" msgstr "r:decile" #: ../data/functions.xml.in.h:685 msgid "r:degree" msgstr "r:degree" #: ../data/functions.xml.in.h:686 msgid "r:denominator" msgstr "r:denominator" #: ../data/functions.xml.in.h:687 msgid "r:derangements" msgstr "r:derangements" #: ../data/functions.xml.in.h:688 msgid "r:det" msgstr "r:det" #: ../data/functions.xml.in.h:689 msgid "r:diff" msgstr "r:diff" #: ../data/functions.xml.in.h:690 msgid "r:dimension" msgstr "r:dimension" #: ../data/functions.xml.in.h:691 msgid "r:disc" msgstr "r:disc" #: ../data/functions.xml.in.h:692 msgid "r:divide" msgstr "r:divide" #: ../data/functions.xml.in.h:693 msgid "r:dollarde" msgstr "r:dollarde" #: ../data/functions.xml.in.h:694 msgid "r:dollarfr" msgstr "r:dollarfr" #: ../data/functions.xml.in.h:695 msgid "r:duration" msgstr "r:duration" #: ../data/functions.xml.in.h:696 msgid "r:durbinwatson" msgstr "r:durbinwatson" #: ../data/functions.xml.in.h:697 msgid "r:effect" msgstr "r:effect" #: ../data/functions.xml.in.h:698 msgid "r:elasticity" msgstr "r:elasticity" #: ../data/functions.xml.in.h:699 msgid "r:element" msgstr "r:element" #: ../data/functions.xml.in.h:700 msgid "r:elements" msgstr "r:elements" #: ../data/functions.xml.in.h:701 msgid "r:error" msgstr "r:error" #: ../data/functions.xml.in.h:702 msgid "r:even" msgstr "r:even" #: ../data/functions.xml.in.h:703 msgid "r:exp" msgstr "r:exp" #: ../data/functions.xml.in.h:704 msgid "r:export" msgstr "r:export" #: ../data/functions.xml.in.h:705 msgid "r:extremum" msgstr "r:extremum" #: ../data/functions.xml.in.h:706 msgid "r:factorial" msgstr "r:factorial" #: ../data/functions.xml.in.h:707 msgid "r:factorial2" msgstr "r:factorial2" #: ../data/functions.xml.in.h:708 msgid "r:floor" msgstr "r:floor" #: ../data/functions.xml.in.h:709 msgid "r:for" msgstr "r:for" #: ../data/functions.xml.in.h:710 msgid "r:frac" msgstr "r:frac" #: ../data/functions.xml.in.h:711 msgid "r:function" msgstr "r:function" #: ../data/functions.xml.in.h:712 msgid "r:fv" msgstr "r:fv" #: ../data/functions.xml.in.h:713 msgid "r:g_duration" msgstr "r:g_duration" #: ../data/functions.xml.in.h:714 msgid "r:gamma" msgstr "r:gamma" #: ../data/functions.xml.in.h:715 msgid "r:gcd" msgstr "r:gcd" #: ../data/functions.xml.in.h:716 msgid "r:genvector" msgstr "r:genvector" #: ../data/functions.xml.in.h:717 msgid "r:geomean" msgstr "r:geomean" #: ../data/functions.xml.in.h:718 msgid "r:harmmean" msgstr "r:harmmean" #: ../data/functions.xml.in.h:719 msgid "r:heaviside" msgstr "r:heaviside" #: ../data/functions.xml.in.h:720 msgid "r:hex" msgstr "r:hex" #: ../data/functions.xml.in.h:721 msgid "r:hyperfactorial" msgstr "r:hyperfactorial" #: ../data/functions.xml.in.h:722 msgid "r:hypot" msgstr "r:hypot" #: ../data/functions.xml.in.h:723 msgid "r:identity" msgstr "r:identity" #: ../data/functions.xml.in.h:724 msgid "r:if" msgstr "r:if" #: ../data/functions.xml.in.h:725 msgid "r:im" msgstr "r:im" #: ../data/functions.xml.in.h:726 msgid "r:int" msgstr "r:int" #: ../data/functions.xml.in.h:727 msgid "r:integrate" msgstr "r:integrate" #: ../data/functions.xml.in.h:728 msgid "r:intrate" msgstr "r:intrate" #: ../data/functions.xml.in.h:729 msgid "r:inv" msgstr "r:inv" #: ../data/functions.xml.in.h:730 msgid "r:inverse" msgstr "r:inverse" #: ../data/functions.xml.in.h:731 msgid "r:ipmt" msgstr "r:ipmt" #: ../data/functions.xml.in.h:732 msgid "r:iqr" msgstr "r:iqr" #: ../data/functions.xml.in.h:733 msgid "r:isInteger" msgstr "r:isInteger" #: ../data/functions.xml.in.h:734 msgid "r:isNumber" msgstr "r:isNumber" #: ../data/functions.xml.in.h:735 msgid "r:isRational" msgstr "r:isRational" #: ../data/functions.xml.in.h:736 msgid "r:isReal" msgstr "r:isReal" #: ../data/functions.xml.in.h:737 msgid "r:isodate" msgstr "r:isodate" #: ../data/functions.xml.in.h:738 msgid "r:ispmt" msgstr "r:ispmt" #: ../data/functions.xml.in.h:739 msgid "r:kronecker" msgstr "r:kronecker" #: ../data/functions.xml.in.h:740 msgid "r:lambertw,productlog" msgstr "r:lambertw,productlog" #: ../data/functions.xml.in.h:741 msgid "r:lcm" msgstr "r:lcm" #: ../data/functions.xml.in.h:742 msgid "r:lcoeff" msgstr "r:lcoeff" #: ../data/functions.xml.in.h:743 msgid "r:ldegree" msgstr "r:ldegree" #: ../data/functions.xml.in.h:744 msgid "r:len" msgstr "r:len" #: ../data/functions.xml.in.h:745 msgid "r:level_coupon" msgstr "r:level_coupon" #: ../data/functions.xml.in.h:746 msgid "r:limits" msgstr "r:limits" #: ../data/functions.xml.in.h:747 msgid "r:linearfunction" msgstr "r:linearfunction" #: ../data/functions.xml.in.h:748 msgid "r:ln" msgstr "r:ln" #: ../data/functions.xml.in.h:749 msgid "r:load" msgstr "r:load" #: ../data/functions.xml.in.h:750 msgid "r:localdate" msgstr "r:localdate" #: ../data/functions.xml.in.h:751 msgid "r:log" msgstr "r:log" #: ../data/functions.xml.in.h:752 msgid "r:logistic" msgstr "r:logistic" #: ../data/functions.xml.in.h:753 msgid "r:logit" msgstr "r:logit" #: ../data/functions.xml.in.h:754 msgid "r:matrix" msgstr "r:matrix" #: ../data/functions.xml.in.h:755 msgid "r:matrix2vector" msgstr "r:matrix2vector" #: ../data/functions.xml.in.h:756 msgid "r:max" msgstr "r:max" #: ../data/functions.xml.in.h:757 msgid "r:mean,average" msgstr "r:mean,average" #: ../data/functions.xml.in.h:758 msgid "r:meandev" msgstr "r:meandev" #: ../data/functions.xml.in.h:759 msgid "r:median" msgstr "r:median" #: ../data/functions.xml.in.h:760 msgid "r:mergevectors" msgstr "r:mergevectors" #: ../data/functions.xml.in.h:761 msgid "r:message" msgstr "r:message" #: ../data/functions.xml.in.h:762 msgid "r:min" msgstr "r:min" #: ../data/functions.xml.in.h:763 msgid "r:mod" msgstr "r:mod" #: ../data/functions.xml.in.h:764 msgid "r:mode" msgstr "r:mode" #: ../data/functions.xml.in.h:765 msgid "r:month" msgstr "r:month" #: ../data/functions.xml.in.h:766 msgid "r:multifactorial" msgstr "r:multifactorial" #: ../data/functions.xml.in.h:767 msgid "r:multiply" msgstr "r:multiply" #: ../data/functions.xml.in.h:768 msgid "r:multisolve" msgstr "r:multisolve" #: ../data/functions.xml.in.h:769 msgid "r:neg" msgstr "r:neg" #: ../data/functions.xml.in.h:770 msgid "r:nominal" msgstr "r:nominal" #: ../data/functions.xml.in.h:771 msgid "r:norm" msgstr "r:norm" #: ../data/functions.xml.in.h:772 msgid "r:nounit,strip_units" msgstr "r:nounit,strip_units" #: ../data/functions.xml.in.h:773 msgid "r:nper" msgstr "r:nper" #. Number of samples #: ../data/functions.xml.in.h:775 msgid "r:number" msgstr "r:number" #: ../data/functions.xml.in.h:776 msgid "r:numerator" msgstr "r:numerator" #: ../data/functions.xml.in.h:777 msgid "r:oct" msgstr "r:oct" #: ../data/functions.xml.in.h:778 msgid "r:odd" msgstr "r:odd" #: ../data/functions.xml.in.h:779 msgid "r:parallelogram" msgstr "r:parallelogram" #: ../data/functions.xml.in.h:780 msgid "r:parallelogram_perimeter" msgstr "r:parallelogram_perimeter" #: ../data/functions.xml.in.h:781 msgid "r:pareto" msgstr "r:pareto" #: ../data/functions.xml.in.h:782 msgid "r:pcontent" msgstr "r:pcontent" #: ../data/functions.xml.in.h:783 msgid "r:pearson,r:correl" msgstr "r:pearson,r:correl" #: ../data/functions.xml.in.h:784 msgid "r:percentile" msgstr "r:percentile" #: ../data/functions.xml.in.h:785 msgid "r:perm,variations" msgstr "r:perm,variations" #: ../data/functions.xml.in.h:786 msgid "r:permanent" msgstr "r:permanent" #: ../data/functions.xml.in.h:787 msgid "r:pmt" msgstr "r:pmt" #: ../data/functions.xml.in.h:788 msgid "r:poolvar" msgstr "r:poolvar" #: ../data/functions.xml.in.h:789 msgid "r:pow" msgstr "r:pow" #: ../data/functions.xml.in.h:790 msgid "r:ppmt" msgstr "r:ppmt" #: ../data/functions.xml.in.h:791 msgid "r:pricedisc" msgstr "r:pricedisc" #: ../data/functions.xml.in.h:792 msgid "r:pricemat" msgstr "r:pricemat" #: ../data/functions.xml.in.h:793 msgid "r:primpart" msgstr "r:primpart" #: ../data/functions.xml.in.h:794 msgid "r:process" msgstr "r:process" #: ../data/functions.xml.in.h:795 msgid "r:processm" msgstr "r:processm" #: ../data/functions.xml.in.h:796 msgid "r:psurplus" msgstr "r:psurplus" #: ../data/functions.xml.in.h:797 msgid "r:pttest" msgstr "r:pttest" #: ../data/functions.xml.in.h:798 msgid "r:punit" msgstr "r:punit" #: ../data/functions.xml.in.h:799 msgid "r:pv" msgstr "r:pv" #: ../data/functions.xml.in.h:800 msgid "r:pyramid" msgstr "r:pyramid" #: ../data/functions.xml.in.h:801 msgid "r:quartile" msgstr "r:quartile" #: ../data/functions.xml.in.h:802 msgid "r:radtodef" msgstr "r:radtodef" #: ../data/functions.xml.in.h:803 msgid "r:raise" msgstr "r:raise" #: ../data/functions.xml.in.h:804 msgid "r:ramp" msgstr "r:ramp" #: ../data/functions.xml.in.h:805 msgid "r:rand" msgstr "r:rand" #: ../data/functions.xml.in.h:806 msgid "r:randbetween" msgstr "r:randbetween" #: ../data/functions.xml.in.h:807 msgid "r:range" msgstr "r:range" #: ../data/functions.xml.in.h:808 msgid "r:rank" msgstr "r:rank" #: ../data/functions.xml.in.h:809 msgid "r:rayleigh" msgstr "r:rayleigh" #: ../data/functions.xml.in.h:810 msgid "r:rayleightail" msgstr "r:rayleightail" #: ../data/functions.xml.in.h:811 msgid "r:re" msgstr "r:re" #: ../data/functions.xml.in.h:812 msgid "r:received" msgstr "r:received" #: ../data/functions.xml.in.h:813 msgid "r:rect" msgstr "r:rect" #: ../data/functions.xml.in.h:814 msgid "r:rect_perimeter" msgstr "r:rect_perimeter" #: ../data/functions.xml.in.h:815 msgid "r:rectangular" msgstr "r:rectangular" #: ../data/functions.xml.in.h:816 msgid "r:rectprism" msgstr "r:rectprism" #: ../data/functions.xml.in.h:817 msgid "r:rectprism_sa" msgstr "r:rectprism_sa" #: ../data/functions.xml.in.h:818 msgid "r:register" msgstr "r:register" #: ../data/functions.xml.in.h:819 msgid "r:rem" msgstr "r:rem" #: ../data/functions.xml.in.h:820 msgid "r:replace" msgstr "r:replace" #: ../data/functions.xml.in.h:821 msgid "r:representsInteger" msgstr "r:representsInteger" #: ../data/functions.xml.in.h:822 msgid "r:representsNumber" msgstr "r:representsNumber" #: ../data/functions.xml.in.h:823 msgid "r:representsRational" msgstr "r:representsRational" #: ../data/functions.xml.in.h:824 msgid "r:representsReal" msgstr "r:representsReal" #: ../data/functions.xml.in.h:825 msgid "r:rms" msgstr "r:rms" #: ../data/functions.xml.in.h:826 msgid "r:roman" msgstr "r:roman" #: ../data/functions.xml.in.h:827 msgid "r:root" msgstr "r:root" #: ../data/functions.xml.in.h:828 msgid "r:round" msgstr "r:round" #: ../data/functions.xml.in.h:829 msgid "r:row" msgstr "r:row" #: ../data/functions.xml.in.h:830 msgid "r:rows" msgstr "r:rows" #: ../data/functions.xml.in.h:831 msgid "r:save" msgstr "r:save" #: ../data/functions.xml.in.h:832 msgid "r:sec" msgstr "r:sec" #: ../data/functions.xml.in.h:833 msgid "r:sech" msgstr "r:sech" #: ../data/functions.xml.in.h:834 msgid "r:select" msgstr "r:select" #: ../data/functions.xml.in.h:835 msgid "r:sgn" msgstr "r:sgn" #: ../data/functions.xml.in.h:836 msgid "r:shift" msgstr "r:shift" #: ../data/functions.xml.in.h:837 msgid "r:sigmoid" msgstr "r:sigmoid" #: ../data/functions.xml.in.h:838 msgid "r:sin" msgstr "r:sin" #: ../data/functions.xml.in.h:839 msgid "r:sinh" msgstr "r:sinh" #: ../data/functions.xml.in.h:840 msgid "r:sln" msgstr "r:sln" #: ../data/functions.xml.in.h:841 msgid "r:solve" msgstr "r:solve" #: ../data/functions.xml.in.h:842 msgid "r:solve2" msgstr "r:solve2" #: ../data/functions.xml.in.h:843 msgid "r:sort" msgstr "r:sort" #: ../data/functions.xml.in.h:844 msgid "r:spearman" msgstr "r:spearman" #: ../data/functions.xml.in.h:845 msgid "r:sphere" msgstr "r:sphere" #: ../data/functions.xml.in.h:846 msgid "r:sphere_sa" msgstr "r:sphere_sa" #: ../data/functions.xml.in.h:847 msgid "r:sq" msgstr "r:sq" #: ../data/functions.xml.in.h:848 msgid "r:sqpyramid" msgstr "r:sqpyramid" #: ../data/functions.xml.in.h:849 msgid "r:sqpyramid_height" msgstr "r:sqpyramid_height" #: ../data/functions.xml.in.h:850 msgid "r:sqpyramid_sa" msgstr "r:sqpyramid_sa" #: ../data/functions.xml.in.h:851 msgid "r:sqrtpi" msgstr "r:sqrtpi" #: ../data/functions.xml.in.h:852 msgid "r:square" msgstr "r:square" #: ../data/functions.xml.in.h:853 msgid "r:square_perimeter" msgstr "r:square_perimeter" #: ../data/functions.xml.in.h:854 msgid "r:stack" msgstr "r:stack" #: ../data/functions.xml.in.h:855 msgid "r:stamptodate" msgstr "r:stamptodate" #: ../data/functions.xml.in.h:856 msgid "r:stderr" msgstr "r:stderr" #: ../data/functions.xml.in.h:857 msgid "r:stdev" msgstr "r:stdev" #: ../data/functions.xml.in.h:858 msgid "r:stdevp" msgstr "r:stdevp" #: ../data/functions.xml.in.h:859 msgid "r:subtract" msgstr "r:subtract" #: ../data/functions.xml.in.h:860 msgid "r:superfactorial" msgstr "r:superfactorial" #: ../data/functions.xml.in.h:861 msgid "r:syd" msgstr "r:syd" #: ../data/functions.xml.in.h:862 msgid "r:tan" msgstr "r:tan" #: ../data/functions.xml.in.h:863 msgid "r:tanh" msgstr "r:tanh" #: ../data/functions.xml.in.h:864 msgid "r:tbilleq" msgstr "r:tbilleq" #: ../data/functions.xml.in.h:865 msgid "r:tbillprice" msgstr "r:tbillprice" #: ../data/functions.xml.in.h:866 msgid "r:tbillyield" msgstr "r:tbillyield" #: ../data/functions.xml.in.h:867 msgid "r:tcoeff" msgstr "r:tcoeff" #: ../data/functions.xml.in.h:868 msgid "r:tetrahedron" msgstr "r:tetrahedron" #: ../data/functions.xml.in.h:869 msgid "r:tetrahedron_height" msgstr "r:tetrahedron_height" #: ../data/functions.xml.in.h:870 msgid "r:tetrahedron_sa" msgstr "r:tetrahedron_sa" #: ../data/functions.xml.in.h:871 msgid "r:time" msgstr "r:time" #: ../data/functions.xml.in.h:872 msgid "r:timestamp" msgstr "r:timestamp" #: ../data/functions.xml.in.h:873 msgid "r:title" msgstr "r:title" #: ../data/functions.xml.in.h:874 msgid "r:total" msgstr "r:total" #: ../data/functions.xml.in.h:875 msgid "r:transpose" msgstr "r:transpose" #: ../data/functions.xml.in.h:876 msgid "r:trapezoid" msgstr "r:trapezoid" #: ../data/functions.xml.in.h:877 msgid "r:triangle" msgstr "r:triangle" #: ../data/functions.xml.in.h:878 msgid "r:triangle_perimeter" msgstr "r:triangle_perimeter" #: ../data/functions.xml.in.h:879 msgid "r:triangleprism" msgstr "r:triangleprism" #: ../data/functions.xml.in.h:880 msgid "r:triangular" msgstr "r:triangular" #: ../data/functions.xml.in.h:881 msgid "r:trimmean" msgstr "r:trimmean" #: ../data/functions.xml.in.h:882 msgid "r:trunc" msgstr "r:trunc" #: ../data/functions.xml.in.h:883 msgid "r:ttest" msgstr "r:ttest" #: ../data/functions.xml.in.h:884 msgid "r:var" msgstr "r:var" #: ../data/functions.xml.in.h:885 msgid "r:varp" msgstr "r:varp" #: ../data/functions.xml.in.h:886 msgid "r:vector" msgstr "r:vector" #: ../data/functions.xml.in.h:887 msgid "r:warning" msgstr "r:warning" #: ../data/functions.xml.in.h:888 msgid "r:week" msgstr "r:week" #: ../data/functions.xml.in.h:889 msgid "r:weekday" msgstr "r:weekday" #: ../data/functions.xml.in.h:890 msgid "r:weighmean" msgstr "r:weighmean" #: ../data/functions.xml.in.h:891 msgid "r:winsormean" msgstr "r:winsormean" #: ../data/functions.xml.in.h:892 msgid "r:xor" msgstr "r:xor" #: ../data/functions.xml.in.h:893 msgid "r:year" msgstr "r:year" #: ../data/functions.xml.in.h:894 msgid "r:yearday" msgstr "r:yearday" #: ../data/functions.xml.in.h:895 msgid "r:yearfrac" msgstr "r:yearfrac" #: ../data/functions.xml.in.h:896 msgid "r:zero_coupon" msgstr "r:zero_coupon" #: ../data/functions.xml.in.h:897 msgid "r:zeta" msgstr "r:zeta" #: ../data/functions.xml.in.h:898 msgid "rs:exp10" msgstr "rs:exp10" #: ../data/functions.xml.in.h:899 msgid "rs:exp2" msgstr "rs:exp2" #: ../data/functions.xml.in.h:900 msgid "rs:log10" msgstr "rs:log10" #: ../data/functions.xml.in.h:901 msgid "rs:log2" msgstr "rs:log2" #: ../data/functions.xml.in.h:902 msgid "x1" msgstr "x1" #: ../data/functions.xml.in.h:903 msgid "x2" msgstr "x2" #: ../data/functions.xml.in.h:904 msgid "y1" msgstr "y1" #: ../data/functions.xml.in.h:905 msgid "y2" msgstr "y2" #. Planet #: ../data/planets.xml.in.h:2 msgid "!planets!Mercury" msgstr "水星" #: ../data/planets.xml.in.h:3 msgid "Earth" msgstr "地球" #: ../data/planets.xml.in.h:4 msgid "Jupiter" msgstr "木星" #: ../data/planets.xml.in.h:5 msgid "Mars" msgstr "火星" #: ../data/planets.xml.in.h:6 msgid "Neptune" msgstr "海王星" #: ../data/planets.xml.in.h:7 msgid "Pluto" msgstr "冥王星" #: ../data/planets.xml.in.h:8 msgid "Saturn" msgstr "土星" #: ../data/planets.xml.in.h:9 msgid "Uranus" msgstr "天王星" #: ../data/planets.xml.in.h:10 msgid "Venus" msgstr "金星" #. Unit category #: ../data/units.xml.in.h:2 msgid "!units!Angle" msgstr "角度" #. Unit category #: ../data/units.xml.in.h:4 msgid "!units!Frequency" msgstr "频率" #. Unit category #: ../data/units.xml.in.h:6 msgid "!units!Length" msgstr "长度" #. Unit category #: ../data/units.xml.in.h:8 msgid "!units!Mass" msgstr "质量" #: ../data/units.xml.in.h:9 msgid "Ångström" msgstr "" #: ../data/units.xml.in.h:10 msgid "ATA Pica" msgstr "" #: ../data/units.xml.in.h:11 msgid "ATA Point" msgstr "" #: ../data/units.xml.in.h:12 msgid "Abampere" msgstr "绝对安培" #: ../data/units.xml.in.h:13 msgid "Abcoulomb" msgstr "绝对库伦" #: ../data/units.xml.in.h:14 msgid "Abohm" msgstr "绝对单位欧姆" #: ../data/units.xml.in.h:15 msgid "Absorbed Dose" msgstr "吸收剂量" #: ../data/units.xml.in.h:16 msgid "Absorbed Dose Rate" msgstr "剂量吸收率" #: ../data/units.xml.in.h:17 msgid "Abvolt" msgstr "绝对伏特" #: ../data/units.xml.in.h:18 msgid "Acceleration" msgstr "加速度" #: ../data/units.xml.in.h:19 msgid "Acre" msgstr "英亩" #: ../data/units.xml.in.h:20 msgid "Ampere" msgstr "安培" #: ../data/units.xml.in.h:21 msgid "Ampere per Meter" msgstr "安培每米" #: ../data/units.xml.in.h:22 msgid "Ampere per Meter Squared" msgstr "安培每平方米" #: ../data/units.xml.in.h:23 msgid "Ampere per Volt" msgstr "安培每伏特" #: ../data/units.xml.in.h:24 msgid "Angular Acceleration" msgstr "角加速度" #: ../data/units.xml.in.h:25 msgid "Angular Velocity" msgstr "角速度" #: ../data/units.xml.in.h:26 msgid "Arcminute" msgstr "弧分" #: ../data/units.xml.in.h:27 msgid "Arcsecond" msgstr "弧秒" #: ../data/units.xml.in.h:28 msgid "Are" msgstr "" #: ../data/units.xml.in.h:29 msgid "Area" msgstr "面积" #: ../data/units.xml.in.h:30 msgid "Astronomical Unit" msgstr "天文单位" #: ../data/units.xml.in.h:31 msgid "Atmosphere" msgstr "大气压" #: ../data/units.xml.in.h:32 msgid "Atomic Mass Unit" msgstr "原子质量单位" #: ../data/units.xml.in.h:33 msgid "Bar" msgstr "巴" #: ../data/units.xml.in.h:34 msgid "Barn" msgstr "靶" #: ../data/units.xml.in.h:35 msgid "Becquerel" msgstr "贝可" #: ../data/units.xml.in.h:36 msgid "Bel" msgstr "贝" #: ../data/units.xml.in.h:37 msgid "Bit" msgstr "比特" #: ../data/units.xml.in.h:38 msgid "British Thermal Unit (IT)" msgstr "英制热量单位(IT)" #: ../data/units.xml.in.h:39 msgid "Byte (8-bit)" msgstr "字节(8比特)" #: ../data/units.xml.in.h:40 msgid "Calorie (15 degrees Celcius)" msgstr "Calorie(15摄氏度)" #: ../data/units.xml.in.h:41 msgid "Calorie (capital C)" msgstr "" #: ../data/units.xml.in.h:42 msgid "Calorie (international table)" msgstr "" #: ../data/units.xml.in.h:43 msgid "Calorie (mean)" msgstr "" #: ../data/units.xml.in.h:44 msgid "Calorie (thermochemical)" msgstr "" #: ../data/units.xml.in.h:45 msgid "Candela" msgstr "" #: ../data/units.xml.in.h:46 msgid "Candela Steradian" msgstr "" #: ../data/units.xml.in.h:47 msgid "Candela per Meter Squared" msgstr "" #: ../data/units.xml.in.h:48 msgid "Capacitance" msgstr "电容" #: ../data/units.xml.in.h:49 msgid "Carat" msgstr "克拉" #: ../data/units.xml.in.h:50 msgid "Catalytic Activity" msgstr "催化活性" #: ../data/units.xml.in.h:51 msgid "Catalytic Concentration" msgstr "催化浓度" #: ../data/units.xml.in.h:52 msgid "Cental" msgstr "百磅" #: ../data/units.xml.in.h:53 msgid "Centiliter" msgstr "厘升" #: ../data/units.xml.in.h:54 msgid "Centimeter" msgstr "厘米" #: ../data/units.xml.in.h:55 msgid "Chain" msgstr "链" #: ../data/units.xml.in.h:56 msgid "Cicero" msgstr "" #: ../data/units.xml.in.h:57 msgid "Cooking" msgstr "烹饪" #: ../data/units.xml.in.h:58 msgid "Coulomb" msgstr "库仑" #: ../data/units.xml.in.h:59 msgid "Coulomb per Cubic Meter" msgstr "库仑每立方米" #: ../data/units.xml.in.h:60 msgid "Coulomb per Kilogram" msgstr "库仑每千克" #: ../data/units.xml.in.h:61 msgid "Coulomb per Meter Squared" msgstr "库仑每平米" #: ../data/units.xml.in.h:62 msgid "Coulomb per Volt" msgstr "库仑每伏特" #: ../data/units.xml.in.h:63 msgid "Cubic Inch" msgstr "立方英寸" #: ../data/units.xml.in.h:64 msgid "Cubic Meter" msgstr "立方米" #: ../data/units.xml.in.h:65 msgid "Cubic Meter per Kilogram" msgstr "立方米每公斤" #: ../data/units.xml.in.h:66 msgid "Cup" msgstr "杯" #: ../data/units.xml.in.h:67 msgid "Curie" msgstr "居里" #: ../data/units.xml.in.h:68 msgid "Current Density" msgstr "电流密度" #: ../data/units.xml.in.h:69 msgid "Day" msgstr "日" #: ../data/units.xml.in.h:70 msgid "Decibel" msgstr "分贝" #: ../data/units.xml.in.h:71 msgid "Deciliter" msgstr "分升" #: ../data/units.xml.in.h:72 msgid "Decimeter" msgstr "分米" #: ../data/units.xml.in.h:73 msgid "Degree" msgstr "度" #: ../data/units.xml.in.h:74 msgid "Degree Celcius" msgstr "摄氏度" #: ../data/units.xml.in.h:75 msgid "Degrees Fahrenheit" msgstr "华氏度" #: ../data/units.xml.in.h:76 msgid "Degrees Rankine" msgstr "" #: ../data/units.xml.in.h:78 msgid "Dessertspoon" msgstr "点心匙" #: ../data/units.xml.in.h:79 msgid "Didot Point" msgstr "" #: ../data/units.xml.in.h:80 msgid "Dose Equivalent" msgstr "剂量当量" #: ../data/units.xml.in.h:81 msgid "Dram" msgstr "英钱" #: ../data/units.xml.in.h:82 msgid "Dynamic Viscosity" msgstr "动态粘度" #: ../data/units.xml.in.h:83 msgid "Dyne" msgstr "达因" #: ../data/units.xml.in.h:84 msgid "Einstein" msgstr "爱因斯坦" #: ../data/units.xml.in.h:85 msgid "Einstein per Meter Squared per Second" msgstr "爱因斯坦每平方米每秒" #: ../data/units.xml.in.h:86 msgid "Electric Charge" msgstr "电荷" #: ../data/units.xml.in.h:87 msgid "Electric Charge Density" msgstr "电荷密度" #: ../data/units.xml.in.h:88 msgid "Electric Conductance" msgstr "电导" #: ../data/units.xml.in.h:89 msgid "Electric Current" msgstr "电流" #: ../data/units.xml.in.h:90 msgid "Electric Field Strength" msgstr "电场强度" #: ../data/units.xml.in.h:91 msgid "Electric Flux Density" msgstr "电通密度" #: ../data/units.xml.in.h:92 msgid "Electric Potential" msgstr "电势" #: ../data/units.xml.in.h:93 msgid "Electric Resistance" msgstr "电阻" #: ../data/units.xml.in.h:94 msgid "Electricity" msgstr "电学" #: ../data/units.xml.in.h:95 msgid "Electron Volt" msgstr "电子伏特" #: ../data/units.xml.in.h:96 msgid "Energy" msgstr "能量" #: ../data/units.xml.in.h:97 msgid "Energy Density" msgstr "能量密度" #: ../data/units.xml.in.h:98 msgid "Entropy" msgstr "熵" #: ../data/units.xml.in.h:99 msgid "Erg" msgstr "" #: ../data/units.xml.in.h:100 msgid "Exposure" msgstr "照射量" #: ../data/units.xml.in.h:101 msgid "Farad" msgstr "法拉" #: ../data/units.xml.in.h:102 msgid "Farad per Meter" msgstr "法拉每米" #: ../data/units.xml.in.h:103 msgid "Fathom" msgstr "英寻" #: ../data/units.xml.in.h:104 msgid "Foe" msgstr "" #: ../data/units.xml.in.h:105 msgid "Foot" msgstr "英尺" #: ../data/units.xml.in.h:106 msgid "Foot-Candle" msgstr "" #: ../data/units.xml.in.h:107 msgid "Foot-Pound Force" msgstr "" #: ../data/units.xml.in.h:108 msgid "Force" msgstr "力学" #: ../data/units.xml.in.h:109 msgid "Fortnight" msgstr "两星期" #: ../data/units.xml.in.h:110 msgid "Fuel Economy" msgstr "燃料经济" #: ../data/units.xml.in.h:111 msgid "Furlong" msgstr "弗隆" #: ../data/units.xml.in.h:112 msgid "Galileo" msgstr "伽利略" #: ../data/units.xml.in.h:113 msgid "Gauss" msgstr "高斯" #: ../data/units.xml.in.h:114 msgid "Gee" msgstr "" #: ../data/units.xml.in.h:115 msgid "Gibibit" msgstr "" #: ../data/units.xml.in.h:116 msgid "Gibibyte" msgstr "" #: ../data/units.xml.in.h:117 msgid "Gigabit" msgstr "千兆比特" #: ../data/units.xml.in.h:118 msgid "Gigabyte" msgstr "千兆比特" #: ../data/units.xml.in.h:119 msgid "Gradian (Gon)" msgstr "" #: ../data/units.xml.in.h:120 msgid "Grain" msgstr "格令" #: ../data/units.xml.in.h:121 msgid "Gram" msgstr "克" #: ../data/units.xml.in.h:122 msgid "Gram of TNT" msgstr "克TNT当量" #: ../data/units.xml.in.h:123 msgid "Gram per Cubic Centimeter" msgstr "克每立方厘米" #: ../data/units.xml.in.h:124 msgid "Gram per Cubic Decimeter" msgstr "克每立方分米" #: ../data/units.xml.in.h:125 msgid "Gram per Mole" msgstr "克每摩尔" #: ../data/units.xml.in.h:126 msgid "Gray" msgstr "戈瑞" #: ../data/units.xml.in.h:127 msgid "Gray per Second" msgstr "戈瑞每秒" #: ../data/units.xml.in.h:128 msgid "Hand" msgstr "" #: ../data/units.xml.in.h:129 msgid "Hectare" msgstr "公顷" #: ../data/units.xml.in.h:130 msgid "Hektogram" msgstr "" #: ../data/units.xml.in.h:131 msgid "Henry" msgstr "亨利" #: ../data/units.xml.in.h:132 msgid "Henry per Meter" msgstr "亨利每米" #: ../data/units.xml.in.h:133 msgid "Hertz" msgstr "赫兹" #: ../data/units.xml.in.h:134 msgid "Horse Power" msgstr "匹" #: ../data/units.xml.in.h:135 msgid "Hour" msgstr "小时" #: ../data/units.xml.in.h:136 msgid "Illuminance" msgstr "照度" #: ../data/units.xml.in.h:137 msgid "Imperial Bushel" msgstr "" #: ../data/units.xml.in.h:138 msgid "Imperial Capacity" msgstr "" #: ../data/units.xml.in.h:139 msgid "Imperial Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:140 msgid "Imperial Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:141 msgid "Imperial Fluid Scuple" msgstr "" #: ../data/units.xml.in.h:142 msgid "Imperial Gallon" msgstr "" #: ../data/units.xml.in.h:143 msgid "Imperial Gill" msgstr "" #: ../data/units.xml.in.h:144 msgid "Imperial Minim" msgstr "" #: ../data/units.xml.in.h:145 msgid "Imperial Pint" msgstr "" #: ../data/units.xml.in.h:146 msgid "Imperial Quart" msgstr "" #: ../data/units.xml.in.h:147 msgid "Inch" msgstr "英寸" #: ../data/units.xml.in.h:148 msgid "Inch of Mercury" msgstr "英寸汞柱" #: ../data/units.xml.in.h:149 msgid "Inductance" msgstr "电感" #: ../data/units.xml.in.h:150 msgid "Information" msgstr "信息" #: ../data/units.xml.in.h:151 msgid "Irradiance" msgstr "辐照度" #: ../data/units.xml.in.h:152 msgid "Joule" msgstr "焦耳" #: ../data/units.xml.in.h:153 msgid "Joule per Cubic Meter" msgstr "焦耳每立方米" #: ../data/units.xml.in.h:154 msgid "Joule per Kelvin" msgstr "焦耳每开尔文" #: ../data/units.xml.in.h:155 msgid "Joule per Kilogram" msgstr "焦耳每千克" #: ../data/units.xml.in.h:156 msgid "Joule per Kilogram Kelvin" msgstr "焦耳每千克开尔文" #: ../data/units.xml.in.h:157 msgid "Joule per Mole" msgstr "焦耳每摩尔" #: ../data/units.xml.in.h:158 msgid "Joule per Mole Kelvin" msgstr "焦耳每摩尔开尔文" #: ../data/units.xml.in.h:159 msgid "Joule per Second" msgstr "焦耳每秒" #: ../data/units.xml.in.h:160 msgid "Julian Year" msgstr "儒略年" #: ../data/units.xml.in.h:161 msgid "Katal" msgstr "卡塔尔" #: ../data/units.xml.in.h:162 msgid "Katal per Cubic Meter" msgstr "卡塔尔每立方米" #: ../data/units.xml.in.h:163 msgid "Kelvin" msgstr "开尔文" #: ../data/units.xml.in.h:164 msgid "Kibibit" msgstr "" #: ../data/units.xml.in.h:165 msgid "Kibibyte" msgstr "" #: ../data/units.xml.in.h:166 msgid "Kilobit" msgstr "千比特" #: ../data/units.xml.in.h:167 msgid "Kilobyte" msgstr "千字节" #: ../data/units.xml.in.h:168 msgid "Kilogram" msgstr "千克" #: ../data/units.xml.in.h:169 msgid "Kilogram per Cubic Meter" msgstr "千克每立方米" #: ../data/units.xml.in.h:170 msgid "Kilogram per Kilogram" msgstr "千克每千克" #: ../data/units.xml.in.h:171 msgid "Kilometer" msgstr "千米" #: ../data/units.xml.in.h:172 msgid "Kilometer per Hour" msgstr "千米每小时" #: ../data/units.xml.in.h:173 msgid "Kilometer per Liter" msgstr "千米每升" #: ../data/units.xml.in.h:174 msgid "Kilopond (Kilogram-Force)" msgstr "千克力" #: ../data/units.xml.in.h:175 msgid "Kilowatt Hour" msgstr "度(千瓦时)" #: ../data/units.xml.in.h:176 msgid "Kinematic Viscosity" msgstr "运动粘度" #: ../data/units.xml.in.h:177 msgid "Knot" msgstr "节" #: ../data/units.xml.in.h:178 msgid "Light" msgstr "光学" #: ../data/units.xml.in.h:179 msgid "Light Year" msgstr "光年" #: ../data/units.xml.in.h:180 msgid "Ligne" msgstr "" #: ../data/units.xml.in.h:181 msgid "Link" msgstr "" #: ../data/units.xml.in.h:182 msgid "Liter" msgstr "升" #: ../data/units.xml.in.h:183 msgid "Liter per Kilometer" msgstr "升每千米" #: ../data/units.xml.in.h:184 msgid "Long Hundredweight" msgstr "长担" #: ../data/units.xml.in.h:185 msgid "Long Ton" msgstr "长吨" #: ../data/units.xml.in.h:186 msgid "Lumen" msgstr "流明" #: ../data/units.xml.in.h:187 msgid "Lumen per Foot Squared" msgstr "流明每平方英尺" #: ../data/units.xml.in.h:188 msgid "Lumen per Meter Squared" msgstr "流明每平米" #: ../data/units.xml.in.h:189 msgid "Luminance" msgstr "亮度" #: ../data/units.xml.in.h:190 msgid "Luminous Flux" msgstr "光通量" #: ../data/units.xml.in.h:191 msgid "Luminous Intensity" msgstr "发光强度" #: ../data/units.xml.in.h:192 msgid "Lux" msgstr "勒克斯" #: ../data/units.xml.in.h:193 msgid "Magnetic Field Strength" msgstr "磁场强度" #: ../data/units.xml.in.h:194 msgid "Magnetic Flux" msgstr "磁通量" #: ../data/units.xml.in.h:195 msgid "Magnetic Flux Density" msgstr "磁通密度" #: ../data/units.xml.in.h:196 msgid "Magnetism" msgstr "磁学" #: ../data/units.xml.in.h:197 msgid "Mass Fraction" msgstr "质量分数" #: ../data/units.xml.in.h:198 msgid "Maxwell" msgstr "麦克斯韦" #: ../data/units.xml.in.h:199 msgid "Mebibit" msgstr "" #: ../data/units.xml.in.h:200 msgid "Mebibyte" msgstr "" #: ../data/units.xml.in.h:201 msgid "Megabit" msgstr "兆比特" #: ../data/units.xml.in.h:202 msgid "Megabyte" msgstr "兆字节" #: ../data/units.xml.in.h:203 msgid "Meter" msgstr "米" #: ../data/units.xml.in.h:204 msgid "Meter Kilogram per Second Squared" msgstr "米千克每平方秒" #: ../data/units.xml.in.h:205 msgid "Meter per Meter" msgstr "米每米" #: ../data/units.xml.in.h:206 msgid "Meter per Second" msgstr "米每秒" #: ../data/units.xml.in.h:207 msgid "Meter per Second Squared" msgstr "米每平方秒" #: ../data/units.xml.in.h:208 msgid "Metric Ton (Tonne)" msgstr "公吨" #: ../data/units.xml.in.h:209 msgid "Microeinstein per Meter Squared per Second" msgstr "" #: ../data/units.xml.in.h:210 msgid "Mil (1/1000 in)" msgstr "毫英寸(1/1000英寸)" #: ../data/units.xml.in.h:211 msgid "Mile" msgstr "英里" #: ../data/units.xml.in.h:212 msgid "Miles per Gallon" msgstr "英里每加仑" #: ../data/units.xml.in.h:213 msgid "Miles per Hour" msgstr "英里每小时" #: ../data/units.xml.in.h:214 msgid "Milliliter" msgstr "毫升" #: ../data/units.xml.in.h:215 msgid "Millimeter" msgstr "毫米" #: ../data/units.xml.in.h:216 msgid "Millimeter of Mercury" msgstr "毫米汞柱" #: ../data/units.xml.in.h:217 msgid "Minute" msgstr "分" #: ../data/units.xml.in.h:218 msgid "Molar Energy" msgstr "" #: ../data/units.xml.in.h:219 msgid "Molar Entropy" msgstr "摩尔熵" #: ../data/units.xml.in.h:220 msgid "Mole" msgstr "摩尔" #: ../data/units.xml.in.h:221 msgid "Mole per Cubic Meter" msgstr "摩尔每平米" #: ../data/units.xml.in.h:222 msgid "Moment of Force" msgstr "力矩" #: ../data/units.xml.in.h:223 msgid "Nautical Mile" msgstr "海里" #: ../data/units.xml.in.h:224 msgid "Nautical Mile per Hour" msgstr "海里每小时" #: ../data/units.xml.in.h:225 msgid "Neper" msgstr "奈培" #: ../data/units.xml.in.h:226 msgid "New Didot Point" msgstr "" #: ../data/units.xml.in.h:227 msgid "Newton" msgstr "牛顿" #: ../data/units.xml.in.h:228 msgid "Newton Meter" msgstr "牛顿米" #: ../data/units.xml.in.h:229 msgid "Newton per Meter" msgstr "牛顿每米" #: ../data/units.xml.in.h:230 msgid "Newton per Meter Squared" msgstr "牛顿每平米" #: ../data/units.xml.in.h:231 msgid "Nibble" msgstr "半字节" #: ../data/units.xml.in.h:232 msgid "Oersted" msgstr "奥斯特" #: ../data/units.xml.in.h:233 msgid "Ohm" msgstr "欧姆" #: ../data/units.xml.in.h:234 msgid "Ounce" msgstr "盎司" #: ../data/units.xml.in.h:235 msgid "Ounce (troy)" msgstr "金衡制盎司" #: ../data/units.xml.in.h:236 msgid "Parsec" msgstr "秒差距" #: ../data/units.xml.in.h:237 msgid "Pascal" msgstr "帕斯卡" #: ../data/units.xml.in.h:238 msgid "Pascal Second" msgstr "帕斯卡秒" #: ../data/units.xml.in.h:239 msgid "Pennyweight" msgstr "本尼威特" #: ../data/units.xml.in.h:240 msgid "Permeability" msgstr "磁导率" #: ../data/units.xml.in.h:241 msgid "Permittivity" msgstr "电容率" #: ../data/units.xml.in.h:242 msgid "Pferdestärke" msgstr "" #: ../data/units.xml.in.h:243 msgid "Pfund" msgstr "" #: ../data/units.xml.in.h:244 msgid "Phot" msgstr "幅透" #: ../data/units.xml.in.h:245 msgid "Pied du roi (French Royal Foot)" msgstr "" #: ../data/units.xml.in.h:246 msgid "Plane Angle" msgstr "平面角" #: ../data/units.xml.in.h:247 msgid "Poise" msgstr "泊" #: ../data/units.xml.in.h:248 msgid "Pond (Gram-Force)" msgstr "克力" #: ../data/units.xml.in.h:249 msgid "PostScript Pica" msgstr "" #: ../data/units.xml.in.h:250 msgid "PostScript Point" msgstr "" #: ../data/units.xml.in.h:251 msgid "Pouce (French Royal Inch)" msgstr "" #: ../data/units.xml.in.h:252 msgid "Pound" msgstr "磅" #: ../data/units.xml.in.h:253 msgid "Pound (troy)" msgstr "金衡制磅" #: ../data/units.xml.in.h:254 msgid "Pound Foot per Second Squared" msgstr "磅英尺每平方秒" #: ../data/units.xml.in.h:255 msgid "Pound-force" msgstr "磅力" #: ../data/units.xml.in.h:256 msgid "Pound-force per Square Inch" msgstr "磅力每平方英寸" #: ../data/units.xml.in.h:257 msgid "Pound-force per Square Inch (psi)" msgstr "磅力每平方英寸(psi)" #: ../data/units.xml.in.h:258 msgid "Poundal" msgstr "磅达" #: ../data/units.xml.in.h:259 msgid "Power" msgstr "功率" #: ../data/units.xml.in.h:260 msgid "Pressure" msgstr "压强" #: ../data/units.xml.in.h:261 msgid "Rad" msgstr "" #: ../data/units.xml.in.h:262 msgid "Radian" msgstr "弧度" #: ../data/units.xml.in.h:263 msgid "Radiance" msgstr "辐射率" #: ../data/units.xml.in.h:264 msgid "Radians per Second" msgstr "弧度每秒" #: ../data/units.xml.in.h:265 msgid "Radians per Second Squared" msgstr "弧度每平方秒" #: ../data/units.xml.in.h:266 msgid "Radiant Intensity" msgstr "辐射强度" #: ../data/units.xml.in.h:267 msgid "Radioactivity" msgstr "放射性" #: ../data/units.xml.in.h:268 msgid "Ratio" msgstr "比值" #: ../data/units.xml.in.h:269 msgid "Reciprocal Meter" msgstr "" #: ../data/units.xml.in.h:270 msgid "Reciprocal Seconds Mole" msgstr "" #: ../data/units.xml.in.h:271 msgid "Rem" msgstr "人体伦琴当量" #: ../data/units.xml.in.h:272 msgid "Rod (pole/perch)" msgstr "" #: ../data/units.xml.in.h:273 msgid "Roentgen" msgstr "伦琴" #: ../data/units.xml.in.h:274 msgid "Rood" msgstr "" #: ../data/units.xml.in.h:275 msgid "Second" msgstr "秒" #: ../data/units.xml.in.h:276 msgid "Second Ampere" msgstr "秒安培" #: ../data/units.xml.in.h:277 msgid "Section" msgstr "" #: ../data/units.xml.in.h:278 msgid "Short Hundredweight" msgstr "短英担" #: ../data/units.xml.in.h:279 msgid "Short Ton" msgstr "短吨" #: ../data/units.xml.in.h:280 msgid "Siemens" msgstr "" #: ../data/units.xml.in.h:281 msgid "Sievert" msgstr "" #: ../data/units.xml.in.h:282 msgid "Solid Angle" msgstr "立体角" #: ../data/units.xml.in.h:283 msgid "Specific Energy" msgstr "" #: ../data/units.xml.in.h:284 msgid "Specific Entropy" msgstr "" #: ../data/units.xml.in.h:285 msgid "Specific Volume" msgstr "" #: ../data/units.xml.in.h:286 msgid "Speed" msgstr "速度" #: ../data/units.xml.in.h:287 msgid "Square Foot" msgstr "平方英尺" #: ../data/units.xml.in.h:288 msgid "Square Inch" msgstr "平方英寸" #: ../data/units.xml.in.h:289 msgid "Square Kilometer" msgstr "平方千米" #: ../data/units.xml.in.h:290 msgid "Square Meter" msgstr "平方米" #: ../data/units.xml.in.h:291 msgid "Square Meter per Second" msgstr "平方米每秒" #: ../data/units.xml.in.h:292 msgid "Square Meter per Square Meter" msgstr "平方米每平方米" #: ../data/units.xml.in.h:293 msgid "Square Mile" msgstr "平方英里" #: ../data/units.xml.in.h:294 msgid "Statcoloumb (Franklin)" msgstr "" #: ../data/units.xml.in.h:295 msgid "Statohm" msgstr "静欧姆" #: ../data/units.xml.in.h:296 msgid "Statvolt" msgstr "静伏特" #: ../data/units.xml.in.h:297 msgid "Steradian" msgstr "球面度" #: ../data/units.xml.in.h:298 msgid "Stilb" msgstr "熙提" #: ../data/units.xml.in.h:299 msgid "Stokes" msgstr "" #: ../data/units.xml.in.h:300 msgid "Stone" msgstr "" #: ../data/units.xml.in.h:301 msgid "Substance" msgstr "物质" #: ../data/units.xml.in.h:302 msgid "Substance Concentration" msgstr "物质浓度" #: ../data/units.xml.in.h:303 msgid "Surface Tension" msgstr "表面张力" #: ../data/units.xml.in.h:304 msgid "Tablespoon" msgstr "汤匙" #: ../data/units.xml.in.h:305 msgid "Teaspoon" msgstr "茶匙" #: ../data/units.xml.in.h:306 msgid "Temperature" msgstr "温度" #: ../data/units.xml.in.h:307 msgid "Terabit" msgstr "万亿比特" #: ../data/units.xml.in.h:308 msgid "Terabyte" msgstr "万亿字节" #: ../data/units.xml.in.h:309 msgid "Tesla" msgstr "特斯拉" #: ../data/units.xml.in.h:310 msgid "Thermal Conductivity" msgstr "导热系数" #: ../data/units.xml.in.h:312 msgid "Toise" msgstr "" #: ../data/units.xml.in.h:313 msgid "Ton of TNT" msgstr "吨TNT当量" #: ../data/units.xml.in.h:314 msgid "Torr" msgstr "托" #: ../data/units.xml.in.h:315 msgid "Township" msgstr "" #: ../data/units.xml.in.h:316 msgid "Tribble" msgstr "" #: ../data/units.xml.in.h:317 msgid "Turn" msgstr "" #: ../data/units.xml.in.h:318 msgid "Typography" msgstr "印刷" #: ../data/units.xml.in.h:319 msgid "U.S. Barrell (oil)" msgstr "" #: ../data/units.xml.in.h:320 msgid "U.S. Bushel" msgstr "" #: ../data/units.xml.in.h:321 msgid "U.S. Capacity" msgstr "" #: ../data/units.xml.in.h:322 msgid "U.S. Dry Pint" msgstr "" #: ../data/units.xml.in.h:323 msgid "U.S. Dry Quart" msgstr "" #: ../data/units.xml.in.h:324 msgid "U.S. Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:325 msgid "U.S. Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:326 msgid "U.S. Gallon" msgstr "" #: ../data/units.xml.in.h:327 msgid "U.S. Gill" msgstr "" #: ../data/units.xml.in.h:328 msgid "U.S. Liquid Pints" msgstr "" #: ../data/units.xml.in.h:329 msgid "U.S. Liquid Quarts" msgstr "" #: ../data/units.xml.in.h:330 msgid "U.S. Minim" msgstr "" #: ../data/units.xml.in.h:331 msgid "U.S. Peck" msgstr "" #: ../data/units.xml.in.h:332 msgid "U.S. Survey Foot" msgstr "" #: ../data/units.xml.in.h:333 msgid "U.S. Survey Inch" msgstr "" #: ../data/units.xml.in.h:334 msgid "U.S. Survey Mile" msgstr "" #: ../data/units.xml.in.h:335 msgid "Volt" msgstr "伏特" #: ../data/units.xml.in.h:336 msgid "Volt Seconds" msgstr "伏特秒" #: ../data/units.xml.in.h:337 msgid "Volt per Ampere" msgstr "伏特每安培" #: ../data/units.xml.in.h:338 msgid "Volt per Meter" msgstr "伏特每米" #: ../data/units.xml.in.h:339 msgid "Volume" msgstr "体积" #: ../data/units.xml.in.h:340 msgid "Watt" msgstr "瓦" #: ../data/units.xml.in.h:341 msgid "Watt Hour" msgstr "瓦小时" #: ../data/units.xml.in.h:342 msgid "Watt per Ampere" msgstr "瓦每安培" #: ../data/units.xml.in.h:343 msgid "Watt per Meter Kelvin" msgstr "瓦每米开尔文" #: ../data/units.xml.in.h:344 msgid "Watt per Meter Squared" msgstr "瓦每平米" #: ../data/units.xml.in.h:345 msgid "Watt per Square Meter Steradian" msgstr "瓦每平米球面度" #: ../data/units.xml.in.h:346 msgid "Watt per Steradian" msgstr "瓦每球面度" #: ../data/units.xml.in.h:347 msgid "Wave Number" msgstr "波数" #: ../data/units.xml.in.h:348 msgid "Weber" msgstr "韦伯" #: ../data/units.xml.in.h:349 msgid "Weber per Ampere" msgstr "韦伯每安培" #: ../data/units.xml.in.h:350 msgid "Weber per Meter Squared" msgstr "韦伯每平米" #: ../data/units.xml.in.h:351 msgid "Week" msgstr "周" #: ../data/units.xml.in.h:352 msgid "Word (16-bit)" msgstr "字(16比特)" #: ../data/units.xml.in.h:353 msgid "Yard" msgstr "码" #: ../data/units.xml.in.h:354 msgid "Zentner" msgstr "" #: ../data/units.xml.in.h:355 msgid "a-cr:gTNT,gramTNT" msgstr "a-cr:gTNT,gramTNT" #: ../data/units.xml.in.h:356 msgid "a-cr:mpg" msgstr "a-cr:mpg" #: ../data/units.xml.in.h:357 msgid "a-cr:mph" msgstr "a-cr:mph" #: ../data/units.xml.in.h:358 msgid "a-cr:psi" msgstr "a-cr:psi" #: ../data/units.xml.in.h:359 msgid "a-cr:tTNT,tonTNT" msgstr "a-cr:tTNT,tonTNT" #: ../data/units.xml.in.h:360 msgid "ais:cal_IT,ar:cal,c:calorie,cp:calories" msgstr "ais:cal_IT,ar:cal,c:calorie,cp:calories" #: ../data/units.xml.in.h:361 msgid "ar:A,ampere,p:amperes" msgstr "ar:A,ampere,p:amperes" #: ../data/units.xml.in.h:362 msgid "ar:AU,astronomical_unit,p:astronomical_units" msgstr "ar:AU,astronomical_unit,p:astronomical_units" #: ../data/units.xml.in.h:363 msgid "ar:B,bel,p:bels" msgstr "ar:B,bel,p:bels" #: ../data/units.xml.in.h:364 msgid "ar:Bq,becquerel,p:becquerels" msgstr "ar:Bq,becquerel,p:becquerels" #: ../data/units.xml.in.h:365 msgid "ar:Btu" msgstr "ar:Btu" #: ../data/units.xml.in.h:366 msgid "ar:C,coulomb,p:coulombs" msgstr "ar:C,coulomb,p:coulombs" #: ../data/units.xml.in.h:367 msgid "ar:Ci,curie,p:curies" msgstr "ar:Ci,curie,p:curies" #: ../data/units.xml.in.h:368 msgid "ar:F,farad,p:farads" msgstr "ar:F,farad,p:farads" #: ../data/units.xml.in.h:369 msgid "ar:Gal,galileo,p:galileos" msgstr "ar:Gal,galileo,p:galileos" #: ../data/units.xml.in.h:370 msgid "ar:Gy,gray,p:grays" msgstr "ar:Gy,gray,p:grays" #: ../data/units.xml.in.h:371 msgid "ar:H,henry,p:henrys" msgstr "ar:H,henry,p:henrys" #: ../data/units.xml.in.h:372 msgid "ar:Hz,hertz" msgstr "ar:Hz,hertz" #: ../data/units.xml.in.h:373 msgid "ar:J,joule,p:joules" msgstr "ar:J,joule,p:joules" #: ../data/units.xml.in.h:374 msgid "ar:K,kelvin,p:kelvins" msgstr "ar:K,kelvin,p:kelvins" #: ../data/units.xml.in.h:375 msgid "ar:L,a:l,liter,p:liters,litre,p:litres" msgstr "ar:L,a:l,liter,p:liters,litre,p:litres" #: ../data/units.xml.in.h:376 msgid "ar:Mx,maxwell,p:maxwells" msgstr "ar:Mx,maxwell,p:maxwells" #: ../data/units.xml.in.h:377 msgid "ar:N,newton,p:newtons" msgstr "ar:N,newton,p:newtons" #: ../data/units.xml.in.h:378 msgid "ar:Np,neper,p:nepers" msgstr "ar:Np,neper,p:nepers" #: ../data/units.xml.in.h:379 msgid "ar:Oe,oersted,p:oersteds" msgstr "ar:Oe,oersted,p:oersteds" #: ../data/units.xml.in.h:380 msgid "ar:P,poise,p:poises" msgstr "ar:P,poise,p:poises" #: ../data/units.xml.in.h:381 msgid "ar:PS,u:pferdestärke" msgstr "ar:PS,u:pferdestärke" #: ../data/units.xml.in.h:382 msgid "ar:Pa,pascal,p:pascals" msgstr "ar:Pa,pascal,p:pascals" #: ../data/units.xml.in.h:383 msgid "ar:R,roentgen,p:roentgens" msgstr "ar:R,roentgen,p:roentgens" #: ../data/units.xml.in.h:384 msgid "ar:S,siemens" msgstr "ar:S,siemens" #: ../data/units.xml.in.h:385 msgid "ar:St,stokes" msgstr "ar:St,stokes" #: ../data/units.xml.in.h:386 msgid "ar:Sv,sievert,p:sieverts" msgstr "ar:Sv,sievert,p:sieverts" #: ../data/units.xml.in.h:387 msgid "ar:T,tesla,p:teslas" msgstr "ar:T,tesla,p:teslas" #: ../data/units.xml.in.h:388 msgid "ar:UK_bu,imperial_bushel,p:imperial_bushels" msgstr "ar:UK_bu,imperial_bushel,p:imperial_bushels" #: ../data/units.xml.in.h:389 msgid "ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms" msgstr "ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms" #: ../data/units.xml.in.h:390 msgid "ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces" msgstr "ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces" #: ../data/units.xml.in.h:391 msgid "ar:UK_gal,imperial_gallon,p:imperial_gallons" msgstr "ar:UK_gal,imperial_gallon,p:imperial_gallons" #: ../data/units.xml.in.h:392 msgid "ar:UK_gi,imperial_gill,p:imperial_gills" msgstr "ar:UK_gi,imperial_gill,p:imperial_gills" #: ../data/units.xml.in.h:393 msgid "ar:UK_pt,imperial_pint,p:imperial_pints" msgstr "ar:UK_pt,imperial_pint,p:imperial_pints" #: ../data/units.xml.in.h:394 msgid "ar:UK_qt,imperial_quart,p:imperial_quarts" msgstr "ar:UK_qt,imperial_quart,p:imperial_quarts" #: ../data/units.xml.in.h:395 msgid "ar:US_ft,US_foot,p:US_feet" msgstr "ar:US_ft,US_foot,p:US_feet" #: ../data/units.xml.in.h:396 msgid "ar:US_in,US_inch,p:US_inches" msgstr "ar:US_in,US_inch,p:US_inches" #: ../data/units.xml.in.h:397 msgid "ar:US_mi,US_mile,p:US_miles" msgstr "ar:US_mi,US_mile,p:US_miles" #: ../data/units.xml.in.h:398 msgid "ar:V,volt,p:volts" msgstr "ar:V,volt,p:volts" #: ../data/units.xml.in.h:399 msgid "ar:W,watt,p:watts" msgstr "ar:W,watt,p:watts" #: ../data/units.xml.in.h:400 msgid "ar:Wb,weber,p:webers" msgstr "ar:Wb,weber,p:webers" #: ../data/units.xml.in.h:401 msgid "ar:a,are,p:ares" msgstr "ar:a,are,p:ares" #: ../data/units.xml.in.h:402 msgid "ar:atm,atmosphere,p:atmospheres" msgstr "ar:atm,atmosphere,p:atmospheres" #: ../data/units.xml.in.h:403 msgid "ar:b,barn,p:barns" msgstr "ar:b,barn,p:barns" #: ../data/units.xml.in.h:404 msgid "ar:bbl,barrell,p:barrells" msgstr "ar:bbl,barrell,p:barrells" #: ../data/units.xml.in.h:405 msgid "ar:bu,bushel,p:bushels" msgstr "ar:bu,bushel,p:bushels" #: ../data/units.xml.in.h:406 msgid "ar:cd,candela,p:candelas" msgstr "ar:cd,candela,p:candelas" #: ../data/units.xml.in.h:407 msgid "ar:ch,chain,p:chains" msgstr "ar:ch,chain,p:chains" #: ../data/units.xml.in.h:408 msgid "ar:cwt,hundredweight,p:hundredweights" msgstr "ar:cwt,hundredweight,p:hundredweights" #: ../data/units.xml.in.h:409 msgid "ar:d,day,p:days" msgstr "ar:d,day,p:days" #: ../data/units.xml.in.h:410 msgid "ar:deg,au:°,degree,p:degrees" msgstr "ar:deg,au:°,degree,p:degrees" #: ../data/units.xml.in.h:411 msgid "ar:dr,dram,p:drams" msgstr "ar:dr,dram,p:drams" #: ../data/units.xml.in.h:412 msgid "ar:dry_pt,dry_pint,p:dry_pints" msgstr "ar:dry_pt,dry_pint,p:dry_pints" #: ../data/units.xml.in.h:413 msgid "ar:dry_qt,dry_quart,p:dry_quarts" msgstr "ar:dry_qt,dry_quart,p:dry_quarts" #: ../data/units.xml.in.h:414 msgid "ar:dyn,dyne,p:dynes" msgstr "ar:dyn,dyne,p:dynes" #: ../data/units.xml.in.h:415 msgid "ar:eV,electron_volt,p:electron_volts" msgstr "ar:eV,electron_volt,p:electron_volts" #: ../data/units.xml.in.h:416 msgid "ar:fc,footcandle,p:footcandles" msgstr "ar:fc,footcandle,p:footcandles" #: ../data/units.xml.in.h:417 msgid "ar:fl_dr,fluid_drachm,p:fluid_drachms" msgstr "ar:fl_dr,fluid_drachm,p:fluid_drachms" #: ../data/units.xml.in.h:418 msgid "ar:fl_oz,fluid_ounce,p:fluid_ounces" msgstr "ar:fl_oz,fluid_ounce,p:fluid_ounces" #: ../data/units.xml.in.h:419 msgid "ar:ft,foot,p:feet" msgstr "ar:ft,foot,p:feet" #: ../data/units.xml.in.h:420 msgid "ar:fur,furlong,p:furlongs" msgstr "ar:fur,furlong,p:furlongs" #: ../data/units.xml.in.h:421 msgid "ar:g,gram,p:grams" msgstr "ar:g,gram,p:grams" #: ../data/units.xml.in.h:422 msgid "ar:gal,gallon,p:gallons" msgstr "ar:gal,gallon,p:gallons" #: ../data/units.xml.in.h:423 msgid "ar:gi,gill,p:gills" msgstr "ar:gi,gill,p:gills" #: ../data/units.xml.in.h:424 msgid "ar:gr,grain,p:grains" msgstr "ar:gr,grain,p:grains" #: ../data/units.xml.in.h:425 msgid "ar:gra,gradian,p:gradians,gon,p:gons" msgstr "ar:gra,gradian,p:gradians,gon,p:gons" #: ../data/units.xml.in.h:426 msgid "ar:h,hour,p:hours" msgstr "ar:h,hour,p:hours" #: ../data/units.xml.in.h:427 msgid "ar:hp,horsepower,p:horsepowers" msgstr "ar:hp,horsepower,p:horsepowers" #: ../data/units.xml.in.h:428 msgid "ar:in,inch,p:inches" msgstr "ar:in,inch,p:inches" #: ../data/units.xml.in.h:429 msgid "ar:inHg" msgstr "ar:inHg" #: ../data/units.xml.in.h:430 msgid "ar:kat,katal,p:katals" msgstr "ar:kat,katal,p:katals" #: ../data/units.xml.in.h:431 msgid "ar:l_cwt,long_hundredweight,p:long_hundredweights" msgstr "ar:l_cwt,long_hundredweight,p:long_hundredweights" #: ../data/units.xml.in.h:432 msgid "ar:l_ton,long_ton,p:long_tons" msgstr "ar:l_ton,long_ton,p:long_tons" #: ../data/units.xml.in.h:433 msgid "ar:lb,pound,p:pounds" msgstr "ar:lb,pound,p:pounds" #: ../data/units.xml.in.h:434 msgid "ar:lb_t,troy_pound,p:troy_pounds" msgstr "ar:lb_t,troy_pound,p:troy_pounds" #: ../data/units.xml.in.h:435 msgid "ar:lbf,pound_force" msgstr "ar:lbf,pound_force" #: ../data/units.xml.in.h:436 msgid "ar:li,link,p:links" msgstr "ar:li,link,p:links" #: ../data/units.xml.in.h:437 msgid "ar:liq_pt,liquid_pint,p:liquid_pints" msgstr "ar:liq_pt,liquid_pint,p:liquid_pints" #: ../data/units.xml.in.h:438 msgid "ar:liq_qt,liquid_quart,p:liquid_quarts" msgstr "ar:liq_qt,liquid_quart,p:liquid_quarts" #: ../data/units.xml.in.h:439 msgid "ar:lm,lumen,p:lumens" msgstr "ar:lm,lumen,p:lumens" #: ../data/units.xml.in.h:440 msgid "ar:lx,lux" msgstr "ar:lx,lux" #: ../data/units.xml.in.h:441 msgid "ar:ly,lightyear,p:lightyears" msgstr "ar:ly,lightyear,p:lightyears" #: ../data/units.xml.in.h:442 msgid "ar:m,meter,p:meters,metre,p:metres" msgstr "ar:m,meter,p:meters,metre,p:metres" #: ../data/units.xml.in.h:443 msgid "ar:mi,mile,p:miles" msgstr "ar:mi,mile,p:miles" #: ../data/units.xml.in.h:444 msgid "ar:min,minute,p:minutes" msgstr "ar:min,minute,p:minutes" #: ../data/units.xml.in.h:445 msgid "ar:mmHg" msgstr "ar:mmHg" #: ../data/units.xml.in.h:446 msgid "ar:mol,mole,p:moles" msgstr "ar:mol,mole,p:moles" #: ../data/units.xml.in.h:447 msgid "ar:oC,au:°C,r:celcius" msgstr "ar:oC,au:°C,r:celcius" #: ../data/units.xml.in.h:448 msgid "ar:oF,au:°F,r:fahrenheit" msgstr "ar:oF,au:°F,r:fahrenheit" #: ../data/units.xml.in.h:449 msgid "ar:oR,au:°R,r:rankine" msgstr "ar:oR,au:°R,r:rankine" #: ../data/units.xml.in.h:450 msgid "ar:oz,ounce,p:ounces" msgstr "ar:oz,ounce,p:ounces" #: ../data/units.xml.in.h:451 msgid "ar:oz_t,troy_ounce,p:troy_ounces" msgstr "ar:oz_t,troy_ounce,p:troy_ounces" #: ../data/units.xml.in.h:452 msgid "ar:pc,parsec,p:parsecs" msgstr "ar:pc,parsec,p:parsecs" #: ../data/units.xml.in.h:453 msgid "ar:ph,phot,p:phots" msgstr "ar:ph,phot,p:phots" #: ../data/units.xml.in.h:454 msgid "ar:pk,peck,p:pecks" msgstr "ar:pk,peck,p:pecks" #: ../data/units.xml.in.h:455 msgid "ar:pt,a:pts,point,p:points" msgstr "ar:pt,a:pts,point,p:points" #: ../data/units.xml.in.h:456 msgid "ar:pwt,pennyweight,p:pennyweights" msgstr "ar:pwt,pennyweight,p:pennyweights" #: ../data/units.xml.in.h:457 msgid "ar:rad,radian,p:radians" msgstr "ar:rad,radian,p:radians" #: ../data/units.xml.in.h:458 msgid "ar:rd,rod,p:rods" msgstr "ar:rd,rod,p:rods" #: ../data/units.xml.in.h:459 msgid "ar:s,second,p:seconds" msgstr "ar:s,second,p:seconds" #: ../data/units.xml.in.h:460 msgid "ar:s_ton,short_ton,p:short_tons" msgstr "ar:s_ton,short_ton,p:short_tons" #: ../data/units.xml.in.h:461 msgid "ar:sb,stilb,p:stilbs" msgstr "ar:sb,stilb,p:stilbs" #: ../data/units.xml.in.h:462 msgid "ar:sr,steradian,p:steradians" msgstr "ar:sr,steradian,p:steradians" #: ../data/units.xml.in.h:463 msgid "ar:t,tonne,p:tonnes,ton,p:tons" msgstr "ar:t,tonne,p:tonnes,ton,p:tons" #: ../data/units.xml.in.h:464 msgid "ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units" msgstr "ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units" #: ../data/units.xml.in.h:465 msgid "ar:yd,yard,p:yards" msgstr "ar:yd,yard,p:yards" #: ../data/units.xml.in.h:466 msgid "ars:cal_fifteen" msgstr "ars:cal_fifteen" #: ../data/units.xml.in.h:467 msgid "ars:cal_mean" msgstr "ars:cal_mean" #: ../data/units.xml.in.h:468 msgid "ars:cal_th" msgstr "ars:cal_th" #: ../data/units.xml.in.h:469 msgid "aru:Å,u:ångström,angstrom" msgstr "aru:Å,u:ångström,angstrom" #: ../data/units.xml.in.h:470 msgid "au:Ω,r:ohm,p:ohms" msgstr "au:Ω,r:ohm,p:ohms" #: ../data/units.xml.in.h:471 msgid "cr:Calorie,cp:Calories" msgstr "cr:Calorie,cp:Calories" #: ../data/units.xml.in.h:472 msgid "r:abampere,a:abA,a:aA,p:abamperes" msgstr "r:abampere,a:abA,a:aA,p:abamperes" #: ../data/units.xml.in.h:473 msgid "r:abcoulomb,p:abcoulombs,a:abC,a:aC" msgstr "r:abcoulomb,p:abcoulombs,a:abC,a:aC" #: ../data/units.xml.in.h:474 msgid "r:abohm,p:abohms,au:abΩ" msgstr "r:abohm,p:abohms,au:abΩ" #: ../data/units.xml.in.h:475 msgid "r:abvolt,p:abvolts,a:abV" msgstr "r:abvolt,p:abvolts,a:abV" #: ../data/units.xml.in.h:476 msgid "r:acre,p:acres" msgstr "r:acre,p:acres" #: ../data/units.xml.in.h:477 msgid "r:arcminute,p:arcminutes" msgstr "r:arcminute,p:arcminutes" #: ../data/units.xml.in.h:478 msgid "r:arcsecond,p:arcseconds" msgstr "r:arcsecond,p:arcseconds" #: ../data/units.xml.in.h:479 msgid "r:ata_pica,p:ata_picas" msgstr "r:ata_pica,p:ata_picas" #: ../data/units.xml.in.h:480 msgid "r:ata_point,a:ata_pt,p:ata_points" msgstr "r:ata_point,a:ata_pt,p:ata_points" #: ../data/units.xml.in.h:481 msgid "r:bar,p:bars" msgstr "r:bar,p:bars" #: ../data/units.xml.in.h:482 msgid "r:bit,p:bits" msgstr "r:bit,p:bits" #: ../data/units.xml.in.h:483 msgid "r:byte,p:bytes,octet,p:octets" msgstr "r:byte,p:bytes,octet,p:octets" #: ../data/units.xml.in.h:484 msgid "r:carat,p:carats" msgstr "r:carat,p:carats" #: ../data/units.xml.in.h:485 msgid "r:cental,p:centals" msgstr "r:cental,p:centals" #: ../data/units.xml.in.h:486 msgid "r:cicero" msgstr "r:cicero" #: ../data/units.xml.in.h:487 msgid "r:cup,p:cups" msgstr "r:cup,p:cups" #: ../data/units.xml.in.h:488 msgid "r:dessertspoon,p:dessertspoons" msgstr "r:dessertspoon,p:dessertspoons" #: ../data/units.xml.in.h:489 msgid "r:didot,a:dd" msgstr "r:didot,a:dd" #: ../data/units.xml.in.h:490 msgid "r:einstein,p:einsteins" msgstr "r:einstein,p:einsteins" #: ../data/units.xml.in.h:491 msgid "r:erg,p:ergs" msgstr "r:erg,p:ergs" #: ../data/units.xml.in.h:492 msgid "r:fathom,p:fathoms" msgstr "r:fathom,p:fathoms" #: ../data/units.xml.in.h:493 msgid "r:foe,p:foes" msgstr "r:foe,p:foes" #: ../data/units.xml.in.h:494 msgid "r:fortnight,p:fortnights" msgstr "r:fortnight,p:fortnights" #: ../data/units.xml.in.h:495 msgid "r:gauss" msgstr "r:gauss" #: ../data/units.xml.in.h:496 msgid "r:gee,p:gees" msgstr "r:gee,p:gees" #: ../data/units.xml.in.h:497 msgid "r:hand,p:hands" msgstr "r:hand,p:hands" #: ../data/units.xml.in.h:498 msgid "r:imperial_fluid_scuple,p:imperial_fluid_scuples" msgstr "r:imperial_fluid_scuple,p:imperial_fluid_scuples" #: ../data/units.xml.in.h:499 msgid "r:imperial_minim,p:imperial_minims" msgstr "r:imperial_minim,p:imperial_minims" #: ../data/units.xml.in.h:500 msgid "r:knot,p:knots" msgstr "r:knot,p:knots" #: ../data/units.xml.in.h:501 msgid "r:ligne" msgstr "r:ligne" #: ../data/units.xml.in.h:502 msgid "r:mil,p:mils" msgstr "r:mil,p:mils" #: ../data/units.xml.in.h:503 msgid "r:minim,p:minims" msgstr "r:minim,p:minims" #: ../data/units.xml.in.h:504 msgid "r:nautical_mile,p:nautical_miles" msgstr "r:nautical_mile,p:nautical_miles" #: ../data/units.xml.in.h:505 msgid "r:new_didot" msgstr "r:new_didot" #: ../data/units.xml.in.h:506 msgid "r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets" msgstr "r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets" #: ../data/units.xml.in.h:507 msgid "r:pfund" msgstr "r:pfund" #: ../data/units.xml.in.h:508 msgid "r:pica,p:picas" msgstr "r:pica,p:picas" #: ../data/units.xml.in.h:509 msgid "r:pied_du_roi" msgstr "r:pied_du_roi" #: ../data/units.xml.in.h:510 msgid "r:pond,p:ponds,a:gf" msgstr "r:pond,p:ponds,a:gf" #: ../data/units.xml.in.h:511 msgid "r:pouce" msgstr "r:pouce" #: ../data/units.xml.in.h:512 msgid "r:poundal,p:poundals,a:pdl" msgstr "r:poundal,p:poundals,a:pdl" #: ../data/units.xml.in.h:513 msgid "r:rad_radioactivity" msgstr "r:rad_radioactivity" #: ../data/units.xml.in.h:514 msgid "r:rem_radioactivity" msgstr "r:rem_radioactivity" #: ../data/units.xml.in.h:515 msgid "r:rood,p:roods" msgstr "r:rood,p:roods" #: ../data/units.xml.in.h:516 msgid "r:section,p:sections" msgstr "r:section,p:sections" #: ../data/units.xml.in.h:517 msgid "r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins" msgstr "r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins" #: ../data/units.xml.in.h:518 msgid "r:statohm,p:statohms,au:statΩ" msgstr "r:statohm,p:statohms,au:statΩ" #: ../data/units.xml.in.h:519 msgid "r:statvolt,p:statvolts,a:statV" msgstr "r:statvolt,p:statvolts,a:statV" #: ../data/units.xml.in.h:520 msgid "r:stone,p:stones" msgstr "r:stone,p:stones" #: ../data/units.xml.in.h:521 msgid "r:tablespoon,p:tablespoons" msgstr "r:tablespoon,p:tablespoons" #: ../data/units.xml.in.h:522 msgid "r:teaspoon,p:teaspoons" msgstr "r:teaspoon,p:teaspoons" #: ../data/units.xml.in.h:523 msgid "r:toise" msgstr "r:toise" #: ../data/units.xml.in.h:524 msgid "r:torr,p:torrs" msgstr "r:torr,p:torrs" #: ../data/units.xml.in.h:525 msgid "r:township,p:townships" msgstr "r:township,p:townships" #: ../data/units.xml.in.h:526 msgid "r:tribble,p:tribbles" msgstr "r:tribble,p:tribbles" #: ../data/units.xml.in.h:527 msgid "r:turn,p:turns" msgstr "r:turn,p:turns" #: ../data/units.xml.in.h:528 msgid "r:week,p:weeks" msgstr "r:week,p:weeks" #: ../data/units.xml.in.h:529 msgid "r:word,p:words" msgstr "r:word,p:words" #: ../data/units.xml.in.h:530 msgid "r:year,p:years" msgstr "r:year,p:years" #: ../data/units.xml.in.h:531 msgid "r:zentner" msgstr "r:zentner" #: ../data/variables.xml.in.h:1 msgid "-r:billion" msgstr "-r:billion" #: ../data/variables.xml.in.h:2 msgid "-r:centillion" msgstr "-r:centillion" #: ../data/variables.xml.in.h:3 msgid "-r:decillion" msgstr "-r:decillion" #: ../data/variables.xml.in.h:4 msgid "-r:duodecillion" msgstr "-r:duodecillion" #: ../data/variables.xml.in.h:5 msgid "-r:hundred" msgstr "-r:hundred" #: ../data/variables.xml.in.h:6 msgid "-r:million" msgstr "-r:million" #: ../data/variables.xml.in.h:7 msgid "-r:nonillion" msgstr "-r:nonillion" #: ../data/variables.xml.in.h:8 msgid "-r:novemdecillion" msgstr "-r:novemdecillion" #: ../data/variables.xml.in.h:9 msgid "-r:octillion" msgstr "-r:octillion" #: ../data/variables.xml.in.h:10 msgid "-r:octodecillion" msgstr "-r:octodecillion" #: ../data/variables.xml.in.h:11 msgid "-r:quadrillion" msgstr "-r:quadrillion" #: ../data/variables.xml.in.h:12 msgid "-r:quattuordecillion" msgstr "-r:quattuordecillion" #: ../data/variables.xml.in.h:13 msgid "-r:quindecillion" msgstr "-r:quindecillion" #: ../data/variables.xml.in.h:14 msgid "-r:quintillion" msgstr "-r:quintillion" #: ../data/variables.xml.in.h:15 msgid "-r:septendecillion" msgstr "-r:septendecillion" #: ../data/variables.xml.in.h:16 msgid "-r:septillion" msgstr "-r:septillion" #: ../data/variables.xml.in.h:17 msgid "-r:sexdecillion" msgstr "-r:sexdecillion" #: ../data/variables.xml.in.h:18 msgid "-r:sextillion" msgstr "-r:sextillion" #: ../data/variables.xml.in.h:19 msgid "-r:thousand" msgstr "-r:thousand" #: ../data/variables.xml.in.h:20 msgid "-r:tredecillion" msgstr "-r:tredecillion" #: ../data/variables.xml.in.h:21 msgid "-r:trillion" msgstr "-r:trillion" #: ../data/variables.xml.in.h:22 msgid "-r:undecillion" msgstr "-r:undecillion" #: ../data/variables.xml.in.h:23 msgid "-r:vigintillion" msgstr "-r:vigintillion" #: ../data/variables.xml.in.h:24 msgid "Alpha Particle Mass" msgstr "α粒子质量" #: ../data/variables.xml.in.h:25 msgid "Apery's Constant" msgstr "Apery常数" #: ../data/variables.xml.in.h:26 msgid "Archimede's Constant (pi)" msgstr "圆周率(π)" #: ../data/variables.xml.in.h:27 msgid "Atomic Mass Constant" msgstr "原子质量常数" #: ../data/variables.xml.in.h:28 msgid "Atomic and Nuclear Constants" msgstr "原子与核物理常数" #: ../data/variables.xml.in.h:29 msgid "Avogadro Constant" msgstr "阿佛加德罗常数" #: ../data/variables.xml.in.h:30 msgid "Base of Natural Logarithms (e)" msgstr "自然对数的底e" #: ../data/variables.xml.in.h:31 msgid "Basic Constants" msgstr "基本常数" #: ../data/variables.xml.in.h:32 msgid "Billion" msgstr "十亿" #: ../data/variables.xml.in.h:33 msgid "Bohr Radius" msgstr "玻尔半径" #: ../data/variables.xml.in.h:34 msgid "Boltzmann Constant" msgstr "玻耳兹曼常数" #: ../data/variables.xml.in.h:35 msgid "Borh Magneton" msgstr "玻尔磁子" #: ../data/variables.xml.in.h:36 msgid "Catalan's Constant" msgstr "Catalan常数" #: ../data/variables.xml.in.h:37 msgid "Centillion" msgstr "百万的一百次方" #: ../data/variables.xml.in.h:38 msgid "Characteristic Impedance of Vacuum" msgstr "真空特性阻抗" #: ../data/variables.xml.in.h:39 msgid "Classical Electron Radius" msgstr "经典电子半径" #: ../data/variables.xml.in.h:40 msgid "Compton Wavelength" msgstr "康普顿波长" #: ../data/variables.xml.in.h:41 msgid "Conductance Quantum" msgstr "量子电导" #: ../data/variables.xml.in.h:42 msgid "Decillion" msgstr "" #: ../data/variables.xml.in.h:43 msgid "Duodecillion" msgstr "" #: ../data/variables.xml.in.h:44 msgid "Electric Constant (Permittivity of Free Space)" msgstr "介电常数(自由空间介电常数)" #: ../data/variables.xml.in.h:45 msgid "Electromagnetic Constants" msgstr "电磁常数" #: ../data/variables.xml.in.h:46 msgid "Electron Mass" msgstr "电子质量" #: ../data/variables.xml.in.h:47 msgid "Elementary Charge" msgstr "基本电荷" #: ../data/variables.xml.in.h:48 msgid "Euler's Constant" msgstr "欧拉常数" #: ../data/variables.xml.in.h:49 msgid "False" msgstr "假" #: ../data/variables.xml.in.h:50 msgid "Faraday Constant" msgstr "法拉第常数" #: ../data/variables.xml.in.h:51 msgid "First Radiation Constant" msgstr "第一辐射常数" #: ../data/variables.xml.in.h:52 msgid "Golden Ratio" msgstr "黄金比例" #: ../data/variables.xml.in.h:53 msgid "Googol" msgstr "大数" #: ../data/variables.xml.in.h:54 msgid "Googolplex" msgstr "" #: ../data/variables.xml.in.h:55 msgid "Helion Mass" msgstr "Helion质量" #: ../data/variables.xml.in.h:56 msgid "Hundred" msgstr "百" #: ../data/variables.xml.in.h:57 msgid "Ideal Gas Constant" msgstr "理想气体常数" #: ../data/variables.xml.in.h:58 msgid "Imaginary i (sqrt -1)" msgstr "虚数i(sqrt -1)" #: ../data/variables.xml.in.h:59 msgid "Infinity" msgstr "无穷" #: ../data/variables.xml.in.h:60 msgid "Josephson Constant" msgstr "约瑟夫森常数" #: ../data/variables.xml.in.h:61 msgid "Large Numbers" msgstr "大数" #: ../data/variables.xml.in.h:62 msgid "Magnetic Constant (Permeability of Free Space)" msgstr "磁常数(自由空间磁导率)" #: ../data/variables.xml.in.h:63 msgid "Magnetic Flux Quantum" msgstr "磁通量量子" #: ../data/variables.xml.in.h:64 msgid "Million" msgstr "百万" #: ../data/variables.xml.in.h:65 msgid "Negative Infinity" msgstr "负无穷" #: ../data/variables.xml.in.h:66 msgid "Neutron Mass" msgstr "中子质量" #: ../data/variables.xml.in.h:67 msgid "Newtonian Constant of Gravitation" msgstr "牛顿引力常数" #: ../data/variables.xml.in.h:68 msgid "Nonillion" msgstr "" #: ../data/variables.xml.in.h:69 msgid "Novemdecillion" msgstr "" #: ../data/variables.xml.in.h:70 msgid "Nuclear Magneton" msgstr "核磁子" #: ../data/variables.xml.in.h:71 msgid "Octillion" msgstr "" #: ../data/variables.xml.in.h:72 msgid "Octodecillion" msgstr "" #: ../data/variables.xml.in.h:73 msgid "Omega Constant" msgstr "Ω常数" #: ../data/variables.xml.in.h:74 msgid "Per Mille" msgstr "千分之一" #: ../data/variables.xml.in.h:75 msgid "Per Myriad" msgstr "万分之一" #: ../data/variables.xml.in.h:76 msgid "Physical Constants" msgstr "物理常数" #: ../data/variables.xml.in.h:77 msgid "Physico-Chemical Constants" msgstr "物理化学常数" #: ../data/variables.xml.in.h:78 msgid "Planck Constant" msgstr "普朗克常数" #: ../data/variables.xml.in.h:79 msgid "Planck Constant over 2 pi" msgstr "普朗克常数每2π" #: ../data/variables.xml.in.h:80 msgid "Planck Length" msgstr "普朗克长度" #: ../data/variables.xml.in.h:81 msgid "Planck Mass" msgstr "普朗克质量" #: ../data/variables.xml.in.h:82 msgid "Planck Temperature" msgstr "普朗克温度" #: ../data/variables.xml.in.h:83 msgid "Planck Time" msgstr "普朗克时间" #: ../data/variables.xml.in.h:84 msgid "Positive Infinity" msgstr "正无穷" #: ../data/variables.xml.in.h:85 msgid "Procent" msgstr "" #: ../data/variables.xml.in.h:86 msgid "Proton Mass" msgstr "质子质量" #: ../data/variables.xml.in.h:87 msgid "Pythagora's Constant (sqrt 2)" msgstr "毕达哥拉斯常数(根号2)" #: ../data/variables.xml.in.h:88 msgid "Quadrillion" msgstr "" #: ../data/variables.xml.in.h:89 msgid "Quattuordecillion" msgstr "" #: ../data/variables.xml.in.h:90 msgid "Quindecillion" msgstr "" #: ../data/variables.xml.in.h:91 msgid "Quintillion" msgstr "" #: ../data/variables.xml.in.h:92 msgid "Rydberg Constant" msgstr "里德伯常数" #: ../data/variables.xml.in.h:93 msgid "Second Radiation Constant" msgstr "第二辐射常数" #: ../data/variables.xml.in.h:94 msgid "Septendecillion" msgstr "" #: ../data/variables.xml.in.h:95 msgid "Septillion" msgstr "" #: ../data/variables.xml.in.h:96 msgid "Sexdecillion" msgstr "" #: ../data/variables.xml.in.h:97 msgid "Sextillion" msgstr "" #: ../data/variables.xml.in.h:98 msgid "Small Numbers" msgstr "小数字" #: ../data/variables.xml.in.h:99 msgid "Special Numbers" msgstr "特殊数字" #: ../data/variables.xml.in.h:100 msgid "Speed of Light in Vacuum" msgstr "真空中光速" #: ../data/variables.xml.in.h:101 msgid "Tau Mass" msgstr "γ质量" #: ../data/variables.xml.in.h:102 msgid "Thousand" msgstr "千" #: ../data/variables.xml.in.h:103 msgid "Tredecillion" msgstr "" #: ../data/variables.xml.in.h:104 msgid "Trillion" msgstr "兆" #: ../data/variables.xml.in.h:105 msgid "True" msgstr "真" #: ../data/variables.xml.in.h:106 msgid "Undecillion" msgstr "" #: ../data/variables.xml.in.h:107 msgid "Undefined" msgstr "未定义的" #: ../data/variables.xml.in.h:108 msgid "Universal Constants" msgstr "普适常数" #: ../data/variables.xml.in.h:109 msgid "Unknowns" msgstr "未知数" #: ../data/variables.xml.in.h:110 msgid "Vigintillion" msgstr "" #: ../data/variables.xml.in.h:112 #, no-c-format msgid "a:%,r:procent" msgstr "a:%,r:procent" #: ../data/variables.xml.in.h:113 msgid "ar:c,speed_of_light" msgstr "ar:c,speed_of_light" #: ../data/variables.xml.in.h:114 msgid "au:γ,r:euler" msgstr "au:γ,r:euler" #: ../data/variables.xml.in.h:115 msgid "au:π,r:pi" msgstr "au:π,r:pi" #: ../data/variables.xml.in.h:116 msgid "r:alpha_particle_mass,aisu:m_α" msgstr "r:alpha_particle_mass,aisu:m_α" #: ../data/variables.xml.in.h:117 msgid "r:apery" msgstr "r:apery" #: ../data/variables.xml.in.h:118 msgid "r:atomic_mass,ais:m_u" msgstr "r:atomic_mass,ais:m_u" #: ../data/variables.xml.in.h:119 msgid "r:avogadro,ais:N_A" msgstr "r:avogadro,ais:N_A" #: ../data/variables.xml.in.h:120 msgid "r:bohr_magneton,aisu:μ_B" msgstr "r:bohr_magneton,aisu:μ_B" #: ../data/variables.xml.in.h:121 msgid "r:bohr_radius,ais:a_o" msgstr "r:bohr_radius,ais:a_o" #: ../data/variables.xml.in.h:122 msgid "r:boltzmann" msgstr "r:boltzmann" #: ../data/variables.xml.in.h:123 msgid "r:catalan" msgstr "r:catalan" #: ../data/variables.xml.in.h:124 msgid "r:characteristic_impedance,ais:Z_0" msgstr "r:characteristic_impedance,ais:Z_0" #: ../data/variables.xml.in.h:125 msgid "r:classical_electron_radius,ais:r_e" msgstr "r:classical_electron_radius,ais:r_e" #: ../data/variables.xml.in.h:126 msgid "r:compton_wavelength,aisu:λ_C" msgstr "r:compton_wavelength,aisu:λ_C" #: ../data/variables.xml.in.h:127 msgid "r:conductance_quantum,ais:G_0" msgstr "r:conductance_quantum,ais:G_0" #: ../data/variables.xml.in.h:128 msgid "r:e" msgstr "r:e" #: ../data/variables.xml.in.h:129 msgid "r:electric_constant,aisu:ε_0" msgstr "r:electric_constant,aisu:ε_0" #: ../data/variables.xml.in.h:130 msgid "r:electron_mass,ais:m_e" msgstr "r:electron_mass,ais:m_e" #: ../data/variables.xml.in.h:131 msgid "r:elementary_charge,ais:e_charge" msgstr "r:elementary_charge,ais:e_charge" #: ../data/variables.xml.in.h:132 msgid "r:false,r:no" msgstr "r:false,r:no" #: ../data/variables.xml.in.h:133 msgid "r:faraday" msgstr "r:faraday" #: ../data/variables.xml.in.h:134 msgid "r:first_radiation,ais:c_1" msgstr "r:first_radiation,ais:c_1" #: ../data/variables.xml.in.h:135 msgid "r:golden,au:φ" msgstr "r:golden,au:φ" #: ../data/variables.xml.in.h:136 msgid "r:googol" msgstr "r:googol" #: ../data/variables.xml.in.h:137 msgid "r:googolplex" msgstr "r:googolplex" #: ../data/variables.xml.in.h:138 msgid "r:helion_mass,ais:m_h" msgstr "r:helion_mass,ais:m_h" #: ../data/variables.xml.in.h:139 msgid "r:i" msgstr "r:i" #: ../data/variables.xml.in.h:140 msgid "r:ideal_gas" msgstr "r:ideal_gas" #: ../data/variables.xml.in.h:141 msgid "r:infinity" msgstr "r:infinity" #: ../data/variables.xml.in.h:142 msgid "r:josephson,ais:K_J" msgstr "r:josephson,ais:K_J" #: ../data/variables.xml.in.h:143 msgid "r:klitzing,ais:R_K" msgstr "r:klitzing,ais:R_K" #: ../data/variables.xml.in.h:144 msgid "r:magnetic_constant,aisu:μ_0" msgstr "r:magnetic_constant,aisu:μ_0" #: ../data/variables.xml.in.h:145 msgid "r:magnetic_flux_quantum,aisu:Φ_0" msgstr "r:magnetic_flux_quantum,aisu:Φ_0" #: ../data/variables.xml.in.h:146 msgid "r:minus_infinity" msgstr "r:minus_infinity" #: ../data/variables.xml.in.h:147 msgid "r:neutron_mass,ais:m_n" msgstr "r:neutron_mass,ais:m_n" #: ../data/variables.xml.in.h:148 msgid "r:newtonian_constant,a:G" msgstr "r:newtonian_constant,a:G" #: ../data/variables.xml.in.h:149 msgid "r:nuclear_magneton,aisu:μ_N" msgstr "r:nuclear_magneton,aisu:μ_N" #: ../data/variables.xml.in.h:150 msgid "r:omega" msgstr "" #: ../data/variables.xml.in.h:151 msgid "r:permille,au:‰" msgstr "r:permille,au:‰" #: ../data/variables.xml.in.h:152 msgid "r:permyriad,au:‱" msgstr "r:permyriad,au:‱" #: ../data/variables.xml.in.h:153 msgid "r:planck" msgstr "r:planck" #: ../data/variables.xml.in.h:154 msgid "r:planck2pi" msgstr "r:planck2pi" #: ../data/variables.xml.in.h:155 msgid "r:planck_length,ais:l_P" msgstr "r:planck_length,ais:l_P" #: ../data/variables.xml.in.h:156 msgid "r:planck_mass,ais:m_P" msgstr "r:planck_mass,ais:m_P" #: ../data/variables.xml.in.h:157 msgid "r:planck_temperature,ais:T_P" msgstr "r:planck_temperature,ais:T_P" #: ../data/variables.xml.in.h:158 msgid "r:planck_time,ais:t_P" msgstr "r:planck_time,ais:t_P" #: ../data/variables.xml.in.h:159 msgid "r:plus_infinity" msgstr "r:plus_infinity" #: ../data/variables.xml.in.h:160 msgid "r:proton_mass,ais:m_p" msgstr "r:proton_mass,ais:m_p" #: ../data/variables.xml.in.h:161 msgid "r:pythagoras" msgstr "r:pythagoras" #: ../data/variables.xml.in.h:162 msgid "r:rydberg,aisu:R_∞" msgstr "r:rydberg,aisu:R_∞" #: ../data/variables.xml.in.h:163 msgid "r:second_radiation,ais:c_2" msgstr "r:second_radiation,ais:c_2" #: ../data/variables.xml.in.h:164 msgid "r:tau_mass,aisu:m_τ" msgstr "r:tau_mass,aisu:m_τ" #: ../data/variables.xml.in.h:165 msgid "r:true,r:yes" msgstr "r:true,r:yes" #: ../data/variables.xml.in.h:166 msgid "r:undefined" msgstr "r:undefined" #: ../data/variables.xml.in.h:167 msgid "r:x" msgstr "r:x" #: ../data/variables.xml.in.h:168 msgid "r:y" msgstr "r:y" #: ../data/variables.xml.in.h:169 msgid "r:z" msgstr "r:z" #: ../data/variables.xml.in.h:170 msgid "von Klitzing Constant" msgstr "冯·克里青常数" libqalculate-0.9.7/po-defs/POTFILES.in0000644000175100017510000000036211305546373014236 00000000000000# List of source files containing translatable strings. [encoding: UTF-8] data/currencies.xml.in data/datasets.xml.in data/elements.xml.in data/functions.xml.in data/planets.xml.in data/prefixes.xml.in data/units.xml.in data/variables.xml.in libqalculate-0.9.7/po-defs/sv.po0000644000175100017510000047524411305546373013470 00000000000000# translation of sv.po to Swedish # This file is distributed under the same license as the PACKAGE package. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. # Niklas Knutsson , 2003. # msgid "" msgstr "" "Project-Id-Version: sv\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-06-15 11:15+0200\n" "PO-Revision-Date: 2007-06-15 11:13+0100\n" "Last-Translator: Niklas Knutsson \n" "Language-Team: Swedish\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../data/currencies.xml.in.h:1 msgid "Australian Dollars" msgstr "Australiensiska dollar" #: ../data/currencies.xml.in.h:2 msgid "Austrian Schilling" msgstr "Österrikiska schilling" #: ../data/currencies.xml.in.h:3 msgid "Belgian Franc" msgstr "Belgiska franc" #: ../data/currencies.xml.in.h:4 msgid "British Pounds" msgstr "Brittiska pund" #: ../data/currencies.xml.in.h:5 msgid "Bulgarian Lev" msgstr "Bulgariska lev" #: ../data/currencies.xml.in.h:6 msgid "Canadian Dollars" msgstr "Kanadensiska dollar" #: ../data/currencies.xml.in.h:7 msgid "Cent (USD)" msgstr "Cent (USD)" #: ../data/currencies.xml.in.h:8 msgid "Croatian Kuna" msgstr "Kroatiska kuna" #: ../data/currencies.xml.in.h:9 msgid "Currency" msgstr "Valuta" #: ../data/currencies.xml.in.h:10 msgid "Cypriot Pound" msgstr "Cypriotiska pund" #: ../data/currencies.xml.in.h:11 msgid "Czech Koruna" msgstr "Tjeckiska koruna" #: ../data/currencies.xml.in.h:12 msgid "Danish Kroner" msgstr "Danska kronor" #: ../data/currencies.xml.in.h:13 msgid "Deutche Mark" msgstr "Tyska mark" #: ../data/currencies.xml.in.h:14 msgid "Dutch Guilder" msgstr "Nederländska gulden" #: ../data/currencies.xml.in.h:15 msgid "Estonian Kroon" msgstr "Estoniska kroon" #: ../data/currencies.xml.in.h:16 msgid "Euro Cent" msgstr "Eurocent" #: ../data/currencies.xml.in.h:17 msgid "European Euros" msgstr "Euro" #: ../data/currencies.xml.in.h:18 msgid "Finnish Markka" msgstr "Finska mark" #: ../data/currencies.xml.in.h:19 msgid "French Franc" msgstr "Franska franc" #: ../data/currencies.xml.in.h:20 msgid "Greek Drachma" msgstr "Grekiska drachmer" #: ../data/currencies.xml.in.h:21 msgid "Hong Kong Dollars" msgstr "Hong Kong dollar" #: ../data/currencies.xml.in.h:22 msgid "Hungarian Forint" msgstr "Ungerska forint" #: ../data/currencies.xml.in.h:23 msgid "Icelandic Krona" msgstr "Isländska kronor" #: ../data/currencies.xml.in.h:24 msgid "Indonesian Rupiah" msgstr "Indonesiska rupiah" #: ../data/currencies.xml.in.h:25 msgid "Irish Pound" msgstr "Irländska pund" #: ../data/currencies.xml.in.h:26 msgid "Italian Lira" msgstr "Italienska lire" #: ../data/currencies.xml.in.h:27 msgid "Japanese Yen" msgstr "Japanska yen" #: ../data/currencies.xml.in.h:28 msgid "Latvian Lat" msgstr "Lettiska lat" #: ../data/currencies.xml.in.h:29 msgid "Lithuanian Lit" msgstr "Litauiska lit" #: ../data/currencies.xml.in.h:30 msgid "Luxembourg Franc" msgstr "Luxemburgfranc" #: ../data/currencies.xml.in.h:31 msgid "Malaysian Ringgit" msgstr "Malaysiska ringgit" #: ../data/currencies.xml.in.h:32 msgid "Maltese Lira" msgstr "Maltesiska lire" #: ../data/currencies.xml.in.h:33 msgid "New Zealand Dollars" msgstr "Nya Zeeländska dollar" #: ../data/currencies.xml.in.h:34 msgid "Norwegian Kroner" msgstr "Norska kronor" #: ../data/currencies.xml.in.h:35 msgid "Phillipine Peso" msgstr "Fillipinska peso" #: ../data/currencies.xml.in.h:36 msgid "Polish Zloty" msgstr "Polska zloty" #: ../data/currencies.xml.in.h:37 msgid "Portuguese Escudo" msgstr "Portugisiska escudos" #: ../data/currencies.xml.in.h:38 msgid "Romanian New Leu" msgstr "Rumänska nya leu" #: ../data/currencies.xml.in.h:39 msgid "Russian Ruble" msgstr "Ryska rubel" #: ../data/currencies.xml.in.h:40 msgid "Singapore Dollars" msgstr "Singaporedollar" #: ../data/currencies.xml.in.h:41 msgid "Slovakian Koruna" msgstr "Slovakiska koruna" #: ../data/currencies.xml.in.h:42 msgid "Slovenian Tolar" msgstr "Slovenska tolar" #: ../data/currencies.xml.in.h:43 msgid "South African Rand" msgstr "Sydafrikanska rand" #: ../data/currencies.xml.in.h:44 msgid "South Korean Won" msgstr "Sydkoreanska won" #: ../data/currencies.xml.in.h:45 msgid "Spanish Peseta" msgstr "Spanska pesetas" #: ../data/currencies.xml.in.h:46 msgid "Swedish Krona" msgstr "Svenska kronor" #: ../data/currencies.xml.in.h:47 msgid "Swiss Francs" msgstr "Schweizerfranc" #: ../data/currencies.xml.in.h:48 msgid "Thai Bat" msgstr "Thailändska bat" #: ../data/currencies.xml.in.h:49 msgid "Turkish New Lira" msgstr "Turkiska nya lira" #: ../data/currencies.xml.in.h:50 msgid "U.S. Dollars" msgstr "Amerikanska dollar" #: ../data/currencies.xml.in.h:51 msgid "Yuan Renmimbi (PR China)" msgstr "" #: ../data/currencies.xml.in.h:52 msgid "a:$,ar:USD,dollar,p:dollars" msgstr "a:$,a:USD,dollar" #: ../data/currencies.xml.in.h:53 msgid "ar:ATS,schilling" msgstr "" #: ../data/currencies.xml.in.h:54 msgid "ar:AUD" msgstr "" #: ../data/currencies.xml.in.h:55 msgid "ar:BEF" msgstr "" #: ../data/currencies.xml.in.h:56 msgid "ar:CAD" msgstr "" #: ../data/currencies.xml.in.h:57 msgid "ar:CHF" msgstr "" #: ../data/currencies.xml.in.h:58 msgid "ar:CNY" msgstr "" #: ../data/currencies.xml.in.h:59 msgid "ar:CYP" msgstr "" #: ../data/currencies.xml.in.h:60 msgid "ar:CZK" msgstr "" #: ../data/currencies.xml.in.h:61 msgid "ar:DEM,mark" msgstr "" #: ../data/currencies.xml.in.h:62 msgid "ar:DKK" msgstr "" #: ../data/currencies.xml.in.h:63 msgid "ar:EEK" msgstr "" #: ../data/currencies.xml.in.h:64 msgid "ar:ESP,peseta,p:pesetas" msgstr "" #: ../data/currencies.xml.in.h:65 msgid "ar:EUR,au:€,euro,p:euros" msgstr "a:EUR,au:€,euro" #: ../data/currencies.xml.in.h:66 msgid "ar:FIM,markka" msgstr "" #: ../data/currencies.xml.in.h:67 msgid "ar:FRF,franc" msgstr "" #: ../data/currencies.xml.in.h:68 msgid "ar:GBP,au:£" msgstr "" #: ../data/currencies.xml.in.h:69 msgid "ar:GRD" msgstr "" #: ../data/currencies.xml.in.h:70 msgid "ar:HKD" msgstr "" #: ../data/currencies.xml.in.h:71 msgid "ar:HRK" msgstr "" #: ../data/currencies.xml.in.h:72 msgid "ar:IDR" msgstr "" #: ../data/currencies.xml.in.h:73 msgid "ar:IEP" msgstr "" #: ../data/currencies.xml.in.h:74 msgid "ar:ISK" msgstr "" #: ../data/currencies.xml.in.h:75 msgid "ar:ITL,lira" msgstr "ar:ITL,lire" #: ../data/currencies.xml.in.h:76 msgid "ar:JPY,au:¥,yen" msgstr "" #: ../data/currencies.xml.in.h:77 msgid "ar:KRW" msgstr "" #: ../data/currencies.xml.in.h:78 msgid "ar:LUF" msgstr "" #: ../data/currencies.xml.in.h:79 msgid "ar:MTL" msgstr "" #: ../data/currencies.xml.in.h:80 msgid "ar:MYR" msgstr "" #: ../data/currencies.xml.in.h:81 msgid "ar:NLG,guilder" msgstr "a:NLG,gulden" #: ../data/currencies.xml.in.h:82 msgid "ar:NOK" msgstr "" #: ../data/currencies.xml.in.h:83 msgid "ar:NZD" msgstr "" #: ../data/currencies.xml.in.h:84 msgid "ar:PHP" msgstr "" #: ../data/currencies.xml.in.h:85 msgid "ar:PTE,escudo" msgstr "" #: ../data/currencies.xml.in.h:86 msgid "ar:RUB,ruble" msgstr "a:RUB,rubel" #: ../data/currencies.xml.in.h:87 msgid "ar:SEK" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:88 msgid "ar:SGD" msgstr "" #: ../data/currencies.xml.in.h:89 msgid "ar:SKK" msgstr "" #: ../data/currencies.xml.in.h:90 msgid "ar:THB" msgstr "" #: ../data/currencies.xml.in.h:91 msgid "ar:TRY" msgstr "" #: ../data/currencies.xml.in.h:92 msgid "ar:ZAR" msgstr "" #: ../data/currencies.xml.in.h:93 msgid "au:¢,r:cent,p:cents" msgstr "au:¢,cent" #: ../data/currencies.xml.in.h:94 msgid "forint,ar:HUF" msgstr "" #: ../data/currencies.xml.in.h:95 msgid "lat,ar:LVL" msgstr "" #: ../data/currencies.xml.in.h:96 msgid "leu,ar:RON" msgstr "" #: ../data/currencies.xml.in.h:97 msgid "lev,ar:BGN" msgstr "" #: ../data/currencies.xml.in.h:98 msgid "lit,ar:LTL" msgstr "" #: ../data/currencies.xml.in.h:99 msgid "r:eurocent,p:eurocents" msgstr "eurocent" #: ../data/currencies.xml.in.h:100 msgid "tolar,ar:SIT" msgstr "" #: ../data/currencies.xml.in.h:101 msgid "zloty,ar:PLN" msgstr "" #. Object argument for chemical elements data set #: ../data/datasets.xml.in.h:2 msgid "!datasets!Element" msgstr "Element" #. Data set for chemical elements #: ../data/datasets.xml.in.h:4 msgid "!datasets!Elements" msgstr "Element" #. Planet mass #: ../data/datasets.xml.in.h:6 msgid "!datasets!Mass" msgstr "Massa" #. Chemical elements number #: ../data/datasets.xml.in.h:8 msgid "!datasets!Number" msgstr "Nummer" #. Surface area of planet #: ../data/datasets.xml.in.h:10 msgid "!datasets!r:area" msgstr "" #. Chemical elements number #: ../data/datasets.xml.in.h:12 msgid "!datasets!r:number" msgstr "nummer" #. Orbital period for planet #: ../data/datasets.xml.in.h:14 msgid "!datasets!r:year" msgstr "år" #: ../data/datasets.xml.in.h:15 msgid "" "A number representing an element group: 1 Alkali Metal 2 Alkaline-" "Earth Metal 3 Lanthanide 4 Actinide 5 Transition Metal 6 " "Metal 7 Metalloid 8 Non-Metal 9 Halogen 10 Noble Gas 11 " "Transactinide" msgstr "" "Ett nummer som representerar en elementgrupp: 1 Alkalimetall 2 " "Jordalkalimetall 3 Lantanid 4 Aktinid 5 Övergångsmetall 6 " "Metall 7 Halvmetall 8 Icke-metall 9 Halogen 10 " "Ädelgas 11 Transaktinid" #: ../data/datasets.xml.in.h:16 msgid "Average Orbital Speed" msgstr "Genomsnittlig kretsloppshastighet" #: ../data/datasets.xml.in.h:17 msgid "Boiling Point" msgstr "Kokpunkt" #: ../data/datasets.xml.in.h:18 msgid "Classification" msgstr "Klassificering" #: ../data/datasets.xml.in.h:19 msgid "Covalent Radius" msgstr "Kovalent radie" #: ../data/datasets.xml.in.h:20 msgid "Data Sets" msgstr "Dataset" #: ../data/datasets.xml.in.h:21 ../data/units.xml.in.h:77 msgid "Density" msgstr "Densitet" #: ../data/datasets.xml.in.h:22 msgid "Density at 295K" msgstr "Densitet vid 295K" #: ../data/datasets.xml.in.h:23 msgid "Eccentricity" msgstr "Excentricitet" #: ../data/datasets.xml.in.h:24 msgid "Equatorial Gravity" msgstr "Ekvatoriell tyngdkraft" #: ../data/datasets.xml.in.h:25 msgid "Inclination" msgstr "Inklination" #: ../data/datasets.xml.in.h:26 msgid "Ionization Potential" msgstr "Joniseringspotential" #: ../data/datasets.xml.in.h:27 msgid "Mean Density" msgstr "Genomsnittlig densitet" #: ../data/datasets.xml.in.h:28 msgid "Mean Surface Temperature" msgstr "Genomsnittlig yttemperatur" #: ../data/datasets.xml.in.h:29 msgid "Melting Point" msgstr "Smältpunkt" #: ../data/datasets.xml.in.h:30 ../data/functions.xml.in.h:321 msgid "Name" msgstr "Namn" #: ../data/datasets.xml.in.h:31 msgid "Number of Satellites" msgstr "Antal satelliter" #: ../data/datasets.xml.in.h:32 msgid "Orbital Period (Year)" msgstr "Omkretstid (år)" #: ../data/datasets.xml.in.h:33 msgid "Planet" msgstr "" #: ../data/datasets.xml.in.h:34 msgid "Planets" msgstr "Planeter" #: ../data/datasets.xml.in.h:35 msgid "Surface Area" msgstr "Ytarea" #: ../data/datasets.xml.in.h:36 msgid "Symbol" msgstr "Symbol" #: ../data/datasets.xml.in.h:37 ../data/functions.xml.in.h:604 msgid "Weight" msgstr "Vikt" #: ../data/datasets.xml.in.h:38 msgid "X Position" msgstr "" #: ../data/datasets.xml.in.h:39 msgid "Y Position" msgstr "" #: ../data/datasets.xml.in.h:40 msgid "r:atom" msgstr "" #: ../data/datasets.xml.in.h:41 msgid "r:boiling" msgstr "kokpunkt" #: ../data/datasets.xml.in.h:42 msgid "r:class" msgstr "klass" #: ../data/datasets.xml.in.h:43 msgid "r:covalent" msgstr "kovalent" #: ../data/datasets.xml.in.h:44 msgid "r:density" msgstr "densitet" #: ../data/datasets.xml.in.h:45 msgid "r:eccentricity" msgstr "excentricitet" #: ../data/datasets.xml.in.h:46 msgid "r:gravity" msgstr "tyngdkraft" #: ../data/datasets.xml.in.h:47 msgid "r:inclination" msgstr "inklination" #: ../data/datasets.xml.in.h:48 msgid "r:ionization" msgstr "jonisering" #: ../data/datasets.xml.in.h:49 msgid "r:mass" msgstr "massa" #: ../data/datasets.xml.in.h:50 msgid "r:melting" msgstr "smältpunkt" #: ../data/datasets.xml.in.h:51 msgid "r:name" msgstr "namn" #: ../data/datasets.xml.in.h:52 msgid "r:planet" msgstr "" #: ../data/datasets.xml.in.h:53 msgid "r:satellites" msgstr "satelliter" #: ../data/datasets.xml.in.h:54 msgid "r:speed" msgstr "hastighet" #: ../data/datasets.xml.in.h:55 msgid "r:symbol" msgstr "" #: ../data/datasets.xml.in.h:56 msgid "r:temperature" msgstr "temperatur" #: ../data/datasets.xml.in.h:57 msgid "r:weight,mass" msgstr "vikt,massa" #: ../data/datasets.xml.in.h:58 msgid "r:x_pos" msgstr "" #: ../data/datasets.xml.in.h:59 msgid "r:y_pos" msgstr "" #. Chemical element #: ../data/elements.xml.in.h:2 msgid "!elements!Mercury" msgstr "Kvicksilver" #: ../data/elements.xml.in.h:3 msgid "Actinium" msgstr "Aktinium" #: ../data/elements.xml.in.h:4 msgid "Aluminum" msgstr "Aluminium" #: ../data/elements.xml.in.h:5 msgid "Americium" msgstr "" #: ../data/elements.xml.in.h:6 msgid "Antimony" msgstr "Antimon" #: ../data/elements.xml.in.h:7 msgid "Argon" msgstr "" #: ../data/elements.xml.in.h:8 msgid "Arsenic" msgstr "Arsenik" #: ../data/elements.xml.in.h:9 msgid "Astatine" msgstr "Astat" #: ../data/elements.xml.in.h:10 msgid "Barium" msgstr "" #: ../data/elements.xml.in.h:11 msgid "Berkelium" msgstr "" #: ../data/elements.xml.in.h:12 msgid "Beryllium" msgstr "" #: ../data/elements.xml.in.h:13 msgid "Bismuth" msgstr "Vismut" #: ../data/elements.xml.in.h:14 msgid "Bohrium" msgstr "" #: ../data/elements.xml.in.h:15 msgid "Boron" msgstr "Bor" #: ../data/elements.xml.in.h:16 msgid "Bromine" msgstr "Brom" #: ../data/elements.xml.in.h:17 msgid "Cadmium" msgstr "Kadmium" #: ../data/elements.xml.in.h:18 msgid "Calcium" msgstr "Kalcium" #: ../data/elements.xml.in.h:19 msgid "Californium" msgstr "" #: ../data/elements.xml.in.h:20 msgid "Carbon" msgstr "Kol" #: ../data/elements.xml.in.h:21 msgid "Cerium" msgstr "" #: ../data/elements.xml.in.h:22 msgid "Cesium" msgstr "" #: ../data/elements.xml.in.h:23 msgid "Chlorine" msgstr "Klor" #: ../data/elements.xml.in.h:24 msgid "Chromium" msgstr "Krom" #: ../data/elements.xml.in.h:25 msgid "Cobalt" msgstr "Kobolt" #: ../data/elements.xml.in.h:26 msgid "Copper" msgstr "Koppar" #: ../data/elements.xml.in.h:27 msgid "Curium" msgstr "" #: ../data/elements.xml.in.h:28 msgid "Darmstadtium" msgstr "" #: ../data/elements.xml.in.h:29 msgid "Dubnium" msgstr "" #: ../data/elements.xml.in.h:30 msgid "Dysprosium" msgstr "" #: ../data/elements.xml.in.h:31 msgid "Einsteinium" msgstr "" #: ../data/elements.xml.in.h:32 msgid "Erbium" msgstr "" #: ../data/elements.xml.in.h:33 msgid "Europium" msgstr "" #: ../data/elements.xml.in.h:34 msgid "Fermium" msgstr "" #: ../data/elements.xml.in.h:35 msgid "Fluorine" msgstr "Fluor" #: ../data/elements.xml.in.h:36 msgid "Francium" msgstr "" #: ../data/elements.xml.in.h:37 msgid "Gadolinium" msgstr "Gadolinium guld" #: ../data/elements.xml.in.h:38 msgid "Gallium" msgstr "" #: ../data/elements.xml.in.h:39 msgid "Germanium" msgstr "" #: ../data/elements.xml.in.h:40 msgid "Gold" msgstr "Guld" #: ../data/elements.xml.in.h:41 msgid "Hafnium" msgstr "" #: ../data/elements.xml.in.h:42 msgid "Hassium" msgstr "" #: ../data/elements.xml.in.h:43 msgid "Helium" msgstr "" #: ../data/elements.xml.in.h:44 msgid "Holmium" msgstr "" #: ../data/elements.xml.in.h:45 msgid "Hydrogen" msgstr "Väte" #: ../data/elements.xml.in.h:46 msgid "Indium" msgstr "" #: ../data/elements.xml.in.h:47 msgid "Iodine" msgstr "Jod" #: ../data/elements.xml.in.h:48 msgid "Iridium" msgstr "" #: ../data/elements.xml.in.h:49 msgid "Iron" msgstr "Järn" #: ../data/elements.xml.in.h:50 msgid "Krypton" msgstr "" #: ../data/elements.xml.in.h:51 msgid "Lanthanum" msgstr "Lantan" #: ../data/elements.xml.in.h:52 msgid "Lawrencium" msgstr "" #: ../data/elements.xml.in.h:53 msgid "Lead" msgstr "Bly" #: ../data/elements.xml.in.h:54 msgid "Lithium" msgstr "Litium" #: ../data/elements.xml.in.h:55 msgid "Lutetium" msgstr "" #: ../data/elements.xml.in.h:56 msgid "Magnesium" msgstr "" #: ../data/elements.xml.in.h:57 msgid "Manganese" msgstr "Mangan" #: ../data/elements.xml.in.h:58 msgid "Meitnerium" msgstr "" #: ../data/elements.xml.in.h:59 msgid "Mendelevium" msgstr "" #: ../data/elements.xml.in.h:60 msgid "Molybdenum" msgstr "Molybden" #: ../data/elements.xml.in.h:61 msgid "Neodymium" msgstr "Neodym" #: ../data/elements.xml.in.h:62 msgid "Neon" msgstr "" #: ../data/elements.xml.in.h:63 msgid "Neptunium" msgstr "" #: ../data/elements.xml.in.h:64 msgid "Nickel" msgstr "" #: ../data/elements.xml.in.h:65 msgid "Niobium" msgstr "Niob" #: ../data/elements.xml.in.h:66 msgid "Nitrogen" msgstr "Kväve" #: ../data/elements.xml.in.h:67 msgid "Nobelium" msgstr "" #: ../data/elements.xml.in.h:68 msgid "Osmium" msgstr "" #: ../data/elements.xml.in.h:69 msgid "Oxygen" msgstr "Syre" #: ../data/elements.xml.in.h:70 msgid "Palladium" msgstr "" #: ../data/elements.xml.in.h:71 msgid "Phosphorus" msgstr "Fosfor" #: ../data/elements.xml.in.h:72 msgid "Platinum" msgstr "Platina" #: ../data/elements.xml.in.h:73 msgid "Plutonium" msgstr "" #: ../data/elements.xml.in.h:74 msgid "Polonium" msgstr "" #: ../data/elements.xml.in.h:75 msgid "Potassium" msgstr "Kalium" #: ../data/elements.xml.in.h:76 msgid "Praseodymium" msgstr "Praseodym" #: ../data/elements.xml.in.h:77 msgid "Promethium" msgstr "Prometium" #: ../data/elements.xml.in.h:78 msgid "Protactinium" msgstr "Protaktinium" #: ../data/elements.xml.in.h:79 msgid "Radium" msgstr "" #: ../data/elements.xml.in.h:80 msgid "Radon" msgstr "" #: ../data/elements.xml.in.h:81 msgid "Rhenium" msgstr "" #: ../data/elements.xml.in.h:82 msgid "Rhodium" msgstr "Rodium" #: ../data/elements.xml.in.h:83 msgid "Roentgenium" msgstr "" #: ../data/elements.xml.in.h:84 msgid "Rubidium" msgstr "" #: ../data/elements.xml.in.h:85 msgid "Ruthenium" msgstr "Rutenium" #: ../data/elements.xml.in.h:86 msgid "Rutherfordium" msgstr "" #: ../data/elements.xml.in.h:87 msgid "Samarium" msgstr "" #: ../data/elements.xml.in.h:88 msgid "Scandium" msgstr "Skandium" #: ../data/elements.xml.in.h:89 msgid "Seaborgium" msgstr "" #: ../data/elements.xml.in.h:90 msgid "Selenium" msgstr "Selen" #: ../data/elements.xml.in.h:91 msgid "Silicon" msgstr "Kisel" #: ../data/elements.xml.in.h:92 msgid "Silver" msgstr "" #: ../data/elements.xml.in.h:93 msgid "Sodium" msgstr "Natrium" #: ../data/elements.xml.in.h:94 msgid "Strontium" msgstr "" #: ../data/elements.xml.in.h:95 msgid "Sulfur" msgstr "Svavel" #: ../data/elements.xml.in.h:96 msgid "Tantalum" msgstr "Tantal" #: ../data/elements.xml.in.h:97 msgid "Technetium" msgstr "Teknetium" #: ../data/elements.xml.in.h:98 msgid "Tellurium" msgstr "Tellur" #: ../data/elements.xml.in.h:99 msgid "Terbium" msgstr "" #: ../data/elements.xml.in.h:100 msgid "Thallium" msgstr "Tallium" #: ../data/elements.xml.in.h:101 msgid "Thorium" msgstr "Torium" #: ../data/elements.xml.in.h:102 msgid "Thulium" msgstr "Tulium" #: ../data/elements.xml.in.h:103 msgid "Tin" msgstr "Tenn" #: ../data/elements.xml.in.h:104 msgid "Titanium" msgstr "Titan" #: ../data/elements.xml.in.h:105 msgid "Tungsten" msgstr "Volfram" #: ../data/elements.xml.in.h:106 msgid "Ununbium" msgstr "" #: ../data/elements.xml.in.h:107 msgid "Ununhexium" msgstr "" #: ../data/elements.xml.in.h:108 msgid "Ununoctium" msgstr "" #: ../data/elements.xml.in.h:109 msgid "Ununpentium" msgstr "" #: ../data/elements.xml.in.h:110 msgid "Ununquadium" msgstr "" #: ../data/elements.xml.in.h:111 msgid "Ununseptium" msgstr "" #: ../data/elements.xml.in.h:112 msgid "Ununtrium" msgstr "" #: ../data/elements.xml.in.h:113 msgid "Uranium" msgstr "Uran" #: ../data/elements.xml.in.h:114 msgid "Vanadium" msgstr "Vanadin" #: ../data/elements.xml.in.h:115 msgid "Xenon" msgstr "" #: ../data/elements.xml.in.h:116 msgid "Ytterbium" msgstr "" #: ../data/elements.xml.in.h:117 msgid "Yttrium" msgstr "" #: ../data/elements.xml.in.h:118 msgid "Zinc" msgstr "Zink" #: ../data/elements.xml.in.h:119 msgid "Zirconium" msgstr "Zirkonium" #: ../data/functions.xml.in.h:1 msgid "-r:bmi" msgstr "" #: ../data/functions.xml.in.h:2 msgid "10 raised the to power X" msgstr "10 upphöjt med X" #: ../data/functions.xml.in.h:3 msgid "1st value" msgstr "1:a värdet" #: ../data/functions.xml.in.h:4 msgid "2 raised the to power X" msgstr "2 upphöjt med X" #: ../data/functions.xml.in.h:5 msgid "2nd value" msgstr "2:a värdet" #: ../data/functions.xml.in.h:6 msgid "ASCII Char" msgstr "ASCII tecken" #: ../data/functions.xml.in.h:7 msgid "ASCII Value" msgstr "ASCII värde" #: ../data/functions.xml.in.h:8 msgid "Absolute Value" msgstr "Absolut värde" #: ../data/functions.xml.in.h:9 msgid "Accrued interest of security paying at maturity" msgstr "Ränta för en säkerhet från start till mognad" #: ../data/functions.xml.in.h:10 msgid "Accrued interest of security with periodic interest payments" msgstr "Ränta för en säkerhet med periodisk ränta" #: ../data/functions.xml.in.h:11 msgid "Add" msgstr "Addera" #: ../data/functions.xml.in.h:12 msgid "Add Days" msgstr "Addera dagar" #: ../data/functions.xml.in.h:13 msgid "Add Months" msgstr "Addera månader" #: ../data/functions.xml.in.h:14 msgid "Add Time" msgstr "Addera tid" #: ../data/functions.xml.in.h:15 msgid "Add Years" msgstr "Addera år" #: ../data/functions.xml.in.h:16 msgid "" "Adds a time value to a date. The value can be positive or negative, but must " "use a unit based on seconds (such as day and year). Fractions of days are " "truncated." msgstr "" "Adderar ett tidsvärde till ett datum. Värdet kan vara positivt eller " "negativt, men måste använda en enhet baserad på sekunder (såsom dag och år). " "Delar av dagar avrundas mot noll." #: ../data/functions.xml.in.h:17 msgid "Adjugate (Adjoint)" msgstr "" #: ../data/functions.xml.in.h:18 msgid "Algebra" msgstr "Algebra" #: ../data/functions.xml.in.h:19 msgid "Amortizement period" msgstr "Amorteringsperiod" #: ../data/functions.xml.in.h:20 msgid "Amount received at maturity for a security bond" msgstr "Erhållet belopp för en säkerhet vid mognad" #: ../data/functions.xml.in.h:21 msgid "Analysis" msgstr "Analys" #: ../data/functions.xml.in.h:22 msgid "Angle" msgstr "Vinkel" #: ../data/functions.xml.in.h:24 #, no-c-format msgid "Annual coupon rate (%)" msgstr "Årlig kupongränta (%)" #: ../data/functions.xml.in.h:25 msgid "Annual rate of security" msgstr "Årlig hastighet" #: ../data/functions.xml.in.h:26 msgid "Annual yield" msgstr "Årlig avkastning" #: ../data/functions.xml.in.h:28 #, no-c-format msgid "Annualized yield (%)" msgstr "Årlig avkastning (%)" #: ../data/functions.xml.in.h:29 msgid "Arguments" msgstr "Parametrar" #: ../data/functions.xml.in.h:30 msgid "Arithmetics" msgstr "Aritmetik" #: ../data/functions.xml.in.h:31 msgid "Ascending" msgstr "Stigande" #: ../data/functions.xml.in.h:32 msgid "Base" msgstr "Bas" #: ../data/functions.xml.in.h:33 msgid "Base-10 Logrithm" msgstr "Bas-10-logaritm" #: ../data/functions.xml.in.h:34 msgid "Base-2 Logrithm" msgstr "Bas-2-logaritm" #: ../data/functions.xml.in.h:35 msgid "Base-N Logarithm" msgstr "Bas-N-logaritm" #: ../data/functions.xml.in.h:36 msgid "Beta Function" msgstr "Betafunktion" #: ../data/functions.xml.in.h:37 msgid "Binary" msgstr "Binär" #: ../data/functions.xml.in.h:38 msgid "Binary number" msgstr "Binärt nummer" #: ../data/functions.xml.in.h:39 msgid "Binomial Coefficient" msgstr "Binomial koefficient" #: ../data/functions.xml.in.h:40 msgid "Bits" msgstr "" #: ../data/functions.xml.in.h:41 msgid "Bitwise Exclusive OR" msgstr "" #: ../data/functions.xml.in.h:42 msgid "Bitwise Shift" msgstr "" #: ../data/functions.xml.in.h:43 msgid "Body Mass Index (BMI)" msgstr "" #: ../data/functions.xml.in.h:44 msgid "Bottom" msgstr "Nedre gräns" #: ../data/functions.xml.in.h:45 msgid "" "Calculates and returns the price per $100 face value of a security bond. The " "security does not pay interest at maturity. Basis is the type of " "day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Beräknar och returnerar priset per $100 värde av en säkerhet. Säkerheten " "betalar inte ränta vid mognad. Dagsräkningssystem kan vara: 0: " "Amerikanskt 30/360 (förvald), 1: verkliga dagar, 2: verkliga dagar/360, 3: " "verkliga dagar/365, eller 4: Europeiskt 30/360" #: ../data/functions.xml.in.h:46 msgid "" "Calculates and returns the price per $100 face value of a security. The " "security pays interest at maturity. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Beräknar och returnerar priset per $100 värde av en säkerhet. Säkerheten " "betalar ränta vid mognad. Dagsräkningssystem kan vara: 0: " "Amerikanskt 30/360 (förvald), 1: verkliga dagar, 2: verkliga dagar/360, 3: " "verkliga dagar/365, eller 4: Europeiskt 30/360" #: ../data/functions.xml.in.h:47 msgid "" "Calculates number of periods of an investment based on periodic constant " "payments and a constant interest rate. Type defines the due date. 1 " "for payment at the beginning of a period and 0 (default) for payment at the " "end of a period." msgstr "" "Beräknar anatalet perioder för investering baserad på periodiska, konstanta " "betalningar och konstant ränta. Typ anger när betalningarna sker. 1 " "för betalning i början av perioden och 0 (förvald) för betalning i slutet av " "perioden." #: ../data/functions.xml.in.h:48 msgid "" "Calculates the Body Mass Index. The resulting BMI-value is sometimes " "interpreted as follows (although varies with age, sex, etc.): " "Underweight < 18.5 Normal weight 18.5-25 " "Overweight 25-30 Obesity > 30 Note that " "you must use units for weight (ex. 59kg) and length (ex. 174cm)." msgstr "" "Beräknar BMI (Body Mass Index). Det resulterande BMI-värdet tolkas ibland " "som följer: Undervikt < 18.5 Idealvikt " " 18.5-25 Övervikt 25-30 Fetma > 30 " " Notera att du måste använda enheter för vikt (ex. 59kg) och längd (ex. " "174cm)." #: ../data/functions.xml.in.h:49 msgid "Calculates the adjugate or adjoint of a matrix." msgstr "" #: ../data/functions.xml.in.h:50 msgid "" "Calculates the amount of a payment of an annuity going towards interest. " " Type defines the due date. 1 for payment at the beginning of a period " "and 0 (default) for payment at the end of a period." msgstr "" "Beräknar summan av en betalning på en livränta som går mot ränta. " "Typ anger när betalningarna sker. 1 för betalning i början av perioden och 0 " "(förvald) för betalning i slutet av perioden." #: ../data/functions.xml.in.h:51 msgid "" "Calculates the amount of a payment of an annuity going towards principal." " Type defines the due date. 1 for payment at the beginning of a " "period and 0 (default) for payment at the end of a period." msgstr "" "Beräknar summan av en betalning på en livränta som går mot kapital. " "Typ anger när betalningarna sker. 1 för betalning i början av perioden och 0 " "(förvald) för betalning i slutet av perioden." #: ../data/functions.xml.in.h:52 msgid "Calculates the area of a circle using the radius" msgstr "Beräknar arean för en cirkel." #: ../data/functions.xml.in.h:53 msgid "" "Calculates the area of a four-sided figure whose opposite sides are both " "parallel and equal in length." msgstr "" "Beräknar arean för en fyrsidig figur vars motstående sidor är parallella och " "är lika långa." #: ../data/functions.xml.in.h:54 msgid "Calculates the area of a four-sided figure with two parallel sides." msgstr "Beräknar arean för en fyrsidig figur med två parallella sidor." #: ../data/functions.xml.in.h:55 msgid "Calculates the cofactor of the element at specified position." msgstr "Beräknar kofaktorn för elementet på angiven position" #: ../data/functions.xml.in.h:56 msgid "Calculates the cross product of two 3-dimensional vectors." msgstr "Beräknar den vektoriella produkten för två 3-dimensionella vektorer." #: ../data/functions.xml.in.h:57 msgid "" "Calculates the demand elasticity. Also works for supply elasticity, income " "elasticity, cross-price elasticity, etc. Just replace demand, with supply, " "or price with income... Ex. elasticity(100-x^2, 3) calculates the " "demand elasticity when the price is 3 for the function \"Q = 100 - x^2\" " "where x is the default price variable." msgstr "" "Beräknar efterfrågeelasticitet. Fungerar lika bra för tillgång- och " "inkomstelasticitet, etc. Ersätt bara efterfrågan, med tillgång, eller pris " "med inkomst... t ex elasticity(100-x^2, 3) beräknar " "efterfrågeelasticiteten när priset är 3 för functionen \"Q = 100 - x^2\" där " "x är den förvalda prisvariabeln." #: ../data/functions.xml.in.h:58 msgid "Calculates the determinant of a matrix." msgstr "Beräknar determinanten för en matris." #: ../data/functions.xml.in.h:59 msgid "Calculates the difference between the first and third quartile." msgstr "Beräknar skillnaden mellan den första och tredje kvartilen." #: ../data/functions.xml.in.h:60 msgid "Calculates the difference between the min and max value." msgstr "Beräknar skillnaden mellan min och max värdet." #: ../data/functions.xml.in.h:61 msgid "" "Calculates the doublefactorial of an integer. Mulitplies the argument with " "every second lesser positive integer (n(n-2)(n-4)...). Can also be entered " "as a number followed by two exclamation marks. ex. factorial2(5) = " "5!! = 5 * 3 * 1 = 15" msgstr "" "Beräknar dubbelfakulteten för ett heltal. Multiplicerar parametern med " "varannan mindre positivt heltal (n(n-2)(n-4)...). Kan också skrivas som ett " "nummer följt av två utropstecken. t ex factorial2(5) = 5!! = 5 * 3 " "* 1 = 15" #: ../data/functions.xml.in.h:62 msgid "Calculates the duration of a security." msgstr "Beräknar livslängden på en säkerhet." #: ../data/functions.xml.in.h:63 msgid "Calculates the effective interest for a given nominal rate." msgstr "Beräknar den effektiva räntan från en given nominell räntesats." #: ../data/functions.xml.in.h:64 msgid "" "Calculates the factorial of an integer. Mulitplies the argument with every " "lesser positive integer (n(n-1)(n-2)...2*1). Can also be entered as a number " "followed by one exclamation mark. ex. factorial(5) = 5! = 5 * 4 * 3 " "* 2 * 1 = 120" msgstr "" "Beräknar fakulteten för ett heltal. Multiplicerar parametern med varje " "mindre positivt heltal (n(n-1)(n-2)...2*1). Kan också skrivas som ett nummer " "följt av ett utropstecken. t ex factorial(5) = 5! = 5 * 4 * 3 * 2 * " "1 = 120" #: ../data/functions.xml.in.h:65 msgid "" "Calculates the hyperfactorial of an integer. Mulitplies the argument raised " "by itself with every lesser positive integer raised by themselves (1^1 * " "2^2 ... n^n). ex. hyperfactorial(3) = (3^3) * (2^2) * (1^1) = 108" msgstr "" "Beräknar hyperfakulteten för ett heltal. Multiplicerar parametern upphöjt " "med varje mindre positivt heltal upphöjt dem själva(1^1 * 2^2 ... n^n). " " t ex hyperfactorial(3) = (3^3) * (2^2) * (1^1) = 108" #: ../data/functions.xml.in.h:66 msgid "Calculates the interest paid on a given period of an investment." msgstr "Beräknar den betalda räntan för en viss period av en investering." #: ../data/functions.xml.in.h:67 msgid "" "Calculates the inverse of a matrix. The inverse is the matrix that " "multiplied by the original matrix equals the identity matrix (AB = BA = I)." msgstr "" "Beräknar inversen av en matris. Inversen är den matrix som multiplicerad med " "den ursprungliga matrisen är lika med identitetsmatrisen (AB = BA = I)." #: ../data/functions.xml.in.h:68 msgid "" "Calculates the multifactorial of an integer. Mulitplies the argument with " "every x lesser positive integer (n(n-x)(n-2x)...). Can also be entered as a " "number followed by three or more exclamation marks. ex. " "multifactorial(18, 4) = 18!!!! = 18 * 14 * 10 * 6 * 2 = 30 240" msgstr "" "Beräknar multifakulteten för ett heltal. Multiplicerar parametern med varje " "x mindre positivt heltal (n(n-x)(n-2x)...). Kan också skrivas som ett nummer " "följt av tre eller fler utropstecken. t ex multifactorial(18, 4) = " "18!!!! = 18 * 14 * 10 * 6 * 2 = 30 240" #: ../data/functions.xml.in.h:69 msgid "" "Calculates the nominal interest rate from a given effective interest rate " "compounded at given intervals." msgstr "Beräknar den nominella räntesatsen från en given effektiv ränta." #: ../data/functions.xml.in.h:70 msgid "Calculates the norm/length of a vector." msgstr "Beräknar normalen för en vektor." #: ../data/functions.xml.in.h:71 msgid "" "Calculates the perimeter of a four-sided figure whose opposite sides are " "both parallel and equal in length." msgstr "" "Beräknar omkretsen för en fyrsidig figur vars motstående sidor är både " "parallella och lika långa." #: ../data/functions.xml.in.h:72 msgid "" "Calculates the permanent of a matrix. The permanent differs from a " "determinant in that all signs in the expansion by minors are taken as " "positive." msgstr "" "Beräknar permanenten av en matris. Permanenten skiljer sig från en " "determinant genom att alla tecken i expansionen sätts som positiva." #: ../data/functions.xml.in.h:73 msgid "" "Calculates the return on continuously compounded interest, given the " "principal, nominal rate and time in years." msgstr "" #: ../data/functions.xml.in.h:74 msgid "" "Calculates the sum-of-years digits depreciation for an asset based on its " "cost, salvage value, anticipated life, and a particular period. This method " "accelerates the rate of the depreciation, so that more depreciation expense " "occurs in earlier periods than in later ones. The depreciable cost is the " "actual cost minus the salvage value. The useful life is the number of " "periods (typically years) over which the asset is depreciated." msgstr "" "Beräknar \"sum-of-years digits\"-avskrivningen för en tillgång, baserat på " "dess kostnad, slutvärde, förväntad livslängd och en given period. Metoden " "accelererar värdeminskningen, så att störst värdeminskning sker i början. " "Den avskrivbara kostnaden är den faktiskta kostnaden minus slutvärdet. " "Livslängden är den period (anges ofta i år) som värdeminskningen pågår." #: ../data/functions.xml.in.h:75 msgid "" "Calculates the superfactorial of an integer. Mulitplies the factorial of the " "argument with the factorial of every lesser positive integer (1! * 2! ... " "n!). ex. superfactorial(5) = 5! * 4! * 3! * 2! * 1! = 34 560" msgstr "" "Beräknar superfakulteten för ett heltal. Mulitplicerar fakulteten av " "parametern med fakulteten för varje mindre positivt heltal (1! * 2! ... n!). " " t ex superfactorial(5) = 5! * 4! * 3! * 2! * 1! = 34 560" #: ../data/functions.xml.in.h:76 msgid "Calculates the surface area of a prism with rectangular base." msgstr "Beräknar ytarean för en prisma med rektangulär bas." #: ../data/functions.xml.in.h:77 msgid "Calculates the value of a level-coupon bond." msgstr "" #: ../data/functions.xml.in.h:78 msgid "Calculates the value of a zero-coupon (pure discount) bond." msgstr "" #: ../data/functions.xml.in.h:79 msgid "" "Calculates the volume of a 3-dimensional shape standing on a rectangular " "base and terminating in a point at the top." msgstr "" "Beräknar volymen för en 3-dimensionell form som står på en rektangulär bas " "och som slutar en punkt på toppen." #: ../data/functions.xml.in.h:80 msgid "Calculates the volume of a prism with rectangular base." msgstr "Beräknar volymen för en prisma med rektangulär bas." #: ../data/functions.xml.in.h:81 msgid "Calculates the volume of a prism with triangular base." msgstr "Beräknar volymen för en prisma med triangulär bas." #: ../data/functions.xml.in.h:82 msgid "Calculus" msgstr "Calculus" #: ../data/functions.xml.in.h:83 msgid "Category" msgstr "Kategori" #: ../data/functions.xml.in.h:84 msgid "Ceil" msgstr "Tak" #: ../data/functions.xml.in.h:85 msgid "Character" msgstr "Tecken" #: ../data/functions.xml.in.h:86 msgid "Circle" msgstr "Cirkel" #: ../data/functions.xml.in.h:87 msgid "Circle Area" msgstr "Cirkelarea" #: ../data/functions.xml.in.h:88 msgid "Circle Circumference" msgstr "Cirkelomkrets" #: ../data/functions.xml.in.h:89 msgid "Coefficient" msgstr "Koefficient" #: ../data/functions.xml.in.h:90 msgid "Cofactor" msgstr "Kofaktor" #: ../data/functions.xml.in.h:91 msgid "Column" msgstr "Kolumn" #: ../data/functions.xml.in.h:92 msgid "Column variable" msgstr "Kolumnvariabel" #: ../data/functions.xml.in.h:93 msgid "Columns" msgstr "Kolumner" #: ../data/functions.xml.in.h:94 msgid "Combinations" msgstr "Kombinationer" #: ../data/functions.xml.in.h:95 msgid "Combinatorics" msgstr "Kombinatorik" #: ../data/functions.xml.in.h:96 msgid "Complex Exponential (Cis)" msgstr "Komplex exponentialfunction (Cis)" #: ../data/functions.xml.in.h:97 msgid "Complex number" msgstr "Komplext nummer" #: ../data/functions.xml.in.h:98 msgid "Compound" msgstr "" #: ../data/functions.xml.in.h:99 msgid "" "Computes the future value of an investment. This is based on periodic, " "constant payments and a constant interest rate. If type = 1 then " "the payment is made at the beginning of the period, If type = 0 (or omitted) " "it is made at the end of each period." msgstr "" "Beräknar anatalet perioder för investering baserad på periodiska, konstanta " "betalningar och konstant ränta. Typ anger när betalningarna sker. 1 " "för betalning i början av perioden och 0 (förvald) för betalning i slutet av " "perioden." #: ../data/functions.xml.in.h:100 msgid "Concatenate Strings" msgstr "Sammanfoga textsträngar" #: ../data/functions.xml.in.h:101 msgid "Condition" msgstr "Förutsättning" #: ../data/functions.xml.in.h:102 msgid "Cone" msgstr "Kon" #: ../data/functions.xml.in.h:103 msgid "Cone Volume" msgstr "Konvolym" #: ../data/functions.xml.in.h:104 msgid "Construct Matrix" msgstr "Skapa matris" #: ../data/functions.xml.in.h:105 msgid "Construct Vector" msgstr "Skapa vektor" #: ../data/functions.xml.in.h:106 msgid "Consumer Surplus" msgstr "Konsumentöverskott" #: ../data/functions.xml.in.h:107 msgid "Content Part" msgstr "Innehållsdel" #: ../data/functions.xml.in.h:108 msgid "Convert Matrix to Vector" msgstr "Omvandla matris till vektor" #: ../data/functions.xml.in.h:109 msgid "" "Converts a decimal dollar price into a dollar price expressed as a fraction." msgstr "" #: ../data/functions.xml.in.h:110 msgid "" "Converts a dollar price expressed as a fraction into a dollar price " "expressed as a decimal number." msgstr "" #: ../data/functions.xml.in.h:111 msgid "" "Corresponds to the product symbol. Multiplies factors for each x ranging " "from the lower to the upper limit." msgstr "" "Motsvarar produktsymbolen. Multiplicerar faktorer för varje x från den undre " "till den övre gränsen." #: ../data/functions.xml.in.h:112 msgid "" "Corresponds to the sum symbol. Adds terms for each x ranging from the lower " "to the upper limit." msgstr "" "Motsvarar summasymbolen. Adderar termer för varje x från den undre till den " "övre gränsen." #: ../data/functions.xml.in.h:113 msgid "Cosecant" msgstr "Cosekant" #: ../data/functions.xml.in.h:114 msgid "Cosine" msgstr "Cosinus" #: ../data/functions.xml.in.h:115 msgid "Cost" msgstr "Kostnad" #: ../data/functions.xml.in.h:116 msgid "Cotangent" msgstr "Cotangens" #: ../data/functions.xml.in.h:117 msgid "Counter update function" msgstr "Funktion för uppdatering av räknare" #: ../data/functions.xml.in.h:118 msgid "Counter variable" msgstr "Räknarvariabel" #: ../data/functions.xml.in.h:119 msgid "Coupon rate" msgstr "Kupongränta" #: ../data/functions.xml.in.h:120 msgid "Coupons per year" msgstr "Antal kuponger per år" #: ../data/functions.xml.in.h:121 msgid "Covariance" msgstr "Kovarians" #: ../data/functions.xml.in.h:122 msgid "Cross Product" msgstr "Vektoriell produkt" #: ../data/functions.xml.in.h:123 msgid "Cube" msgstr "Kub" #: ../data/functions.xml.in.h:124 msgid "Cube Root" msgstr "Kubikrot" #: ../data/functions.xml.in.h:125 msgid "Cube Volume" msgstr "Kubvolym" #: ../data/functions.xml.in.h:126 msgid "Current Time" msgstr "Nuvarande tid" #: ../data/functions.xml.in.h:127 msgid "Custom Sum of Elements" msgstr "Anpassad elementsumma" #: ../data/functions.xml.in.h:128 msgid "Cylinder" msgstr "Cylinder" #: ../data/functions.xml.in.h:129 msgid "Cylinder Volume" msgstr "Cylindervolym" #: ../data/functions.xml.in.h:130 msgid "Data" msgstr "Data" #: ../data/functions.xml.in.h:131 msgid "Data 1" msgstr "Data 1" #: ../data/functions.xml.in.h:132 msgid "Data 2" msgstr "Data 2" #: ../data/functions.xml.in.h:133 msgid "Date" msgstr "Datum" #: ../data/functions.xml.in.h:134 msgid "Date & Time" msgstr "Datum & Tid" #: ../data/functions.xml.in.h:135 msgid "Date to Unix Timestamp" msgstr "" #: ../data/functions.xml.in.h:136 msgid "Day counting basis" msgstr "Dagsräkningssystem" #: ../data/functions.xml.in.h:137 msgid "Day of Month" msgstr "Månadsdag" #: ../data/functions.xml.in.h:138 msgid "Day of Week" msgstr "Veckodag" #: ../data/functions.xml.in.h:139 msgid "Day of Year" msgstr "Dag på året" #: ../data/functions.xml.in.h:140 msgid "Days" msgstr "Dagar" #: ../data/functions.xml.in.h:141 msgid "Days between two dates" msgstr "Antal dagar mellan två datum" #: ../data/functions.xml.in.h:142 msgid "Decile" msgstr "Decil" #: ../data/functions.xml.in.h:143 msgid "Decimal dollar" msgstr "Decimala dollar" #: ../data/functions.xml.in.h:144 msgid "Demand function" msgstr "Efterfrågefunktion" #: ../data/functions.xml.in.h:145 msgid "Demand function or price" msgstr "Efterfrågefunktion eller pris" #: ../data/functions.xml.in.h:146 msgid "Denominator" msgstr "Nämnare" #: ../data/functions.xml.in.h:147 msgid "Denominator of fraction" msgstr "Bråktalets nämnare " #: ../data/functions.xml.in.h:148 msgid "Derangements" msgstr "" #: ../data/functions.xml.in.h:149 msgid "Derive" msgstr "Derivera" #: ../data/functions.xml.in.h:150 msgid "Descriptive Statistics" msgstr "Beskrivande statistik" #: ../data/functions.xml.in.h:151 msgid "Desired future value" msgstr "Önskat framtida värde" #: ../data/functions.xml.in.h:152 msgid "Determinant" msgstr "Determinanten" #: ../data/functions.xml.in.h:153 msgid "" "Determines the straight line depreciation of an asset for a single period." " Cost is the amount you paid for the asset. Salvage is the value of " "the asset at the end of the period. Life is the number of periods over which " "the asset is depreciated. SLN divides the cost evenly over the life of an " "asset." msgstr "" #: ../data/functions.xml.in.h:154 msgid "Dimension" msgstr "Dimension" #: ../data/functions.xml.in.h:155 msgid "Dimension / Step size" msgstr "Dimension / stegstorlek" #: ../data/functions.xml.in.h:156 msgid "" "Discontinuous function also known as \"unit step function\". Returns 0 if x " "< 0, 1 if x > 0, and 1/2 if x = 0." msgstr "" #: ../data/functions.xml.in.h:157 msgid "Discount" msgstr "Diskonto" #: ../data/functions.xml.in.h:158 msgid "Discount rate" msgstr "Diskonto" #: ../data/functions.xml.in.h:159 msgid "Discount rate for a security" msgstr "Reduceringshastighet för säkerhet" #: ../data/functions.xml.in.h:160 msgid "Display Error" msgstr "Visa felmeddelande" #: ../data/functions.xml.in.h:161 msgid "Display Message" msgstr "Visa meddelande" #: ../data/functions.xml.in.h:162 msgid "Display Warning" msgstr "Visa varning" #: ../data/functions.xml.in.h:163 msgid "Distribution" msgstr "Distribution" #: ../data/functions.xml.in.h:164 msgid "Divide" msgstr "Dela" #: ../data/functions.xml.in.h:165 msgid "Do function" msgstr "Funktion" #: ../data/functions.xml.in.h:166 msgid "Dollar Decimal" msgstr "Dollar decimal" #: ../data/functions.xml.in.h:167 msgid "Dollar Fraction" msgstr "Dollar bråktal" #: ../data/functions.xml.in.h:168 msgid "Double Factorial" msgstr "Dubbelfakultet" #: ../data/functions.xml.in.h:169 msgid "Duration" msgstr "Duration" #: ../data/functions.xml.in.h:170 msgid "Durbin-Watson" msgstr "Durbin-Watson" #: ../data/functions.xml.in.h:171 msgid "Economics" msgstr "Ekonomi" #: ../data/functions.xml.in.h:172 msgid "Effective Interest Rate" msgstr "Effektiv räntesats" #: ../data/functions.xml.in.h:173 msgid "Effective interest rate" msgstr "Effektiv räntesats" #: ../data/functions.xml.in.h:174 msgid "Elasticity" msgstr "Elasticitet" #. Vector/matrix element #: ../data/functions.xml.in.h:176 msgid "Element" msgstr "Element" #: ../data/functions.xml.in.h:177 msgid "Element variable" msgstr "Elementvariabel" #. Vector/matrix elements #: ../data/functions.xml.in.h:179 msgid "Elements" msgstr "Element" #: ../data/functions.xml.in.h:180 msgid "End column" msgstr "Slutkolumn" #: ../data/functions.xml.in.h:181 msgid "End row" msgstr "Slutrad" #: ../data/functions.xml.in.h:182 msgid "Equation" msgstr "Ekvation" #: ../data/functions.xml.in.h:183 msgid "Equation 1" msgstr "Ekvation 1" #: ../data/functions.xml.in.h:184 msgid "Equation 2" msgstr "Ekvation 2" #: ../data/functions.xml.in.h:185 msgid "Equation vector" msgstr "Ekvationsvektor" #: ../data/functions.xml.in.h:186 msgid "Even" msgstr "Jämnt" #: ../data/functions.xml.in.h:187 msgid "Exponent" msgstr "Exponent" #: ../data/functions.xml.in.h:188 msgid "Exponential (e^x)" msgstr "Exponentialfunktion (e^x)" #: ../data/functions.xml.in.h:189 msgid "Exponents & Logarithms" msgstr "Exponenter & Logaritmer" #: ../data/functions.xml.in.h:190 msgid "Export To CSV File" msgstr "Exportera till CSV-fil" #: ../data/functions.xml.in.h:191 msgid "Exports a matrix to a CSV data file." msgstr "Exporterar en matris till en CSV-datafil" #: ../data/functions.xml.in.h:192 msgid "Expression" msgstr "Uttryck" #: ../data/functions.xml.in.h:193 msgid "Expression if condition is NOT met" msgstr "Uttryck om villkoret INTE uppfylls" #: ../data/functions.xml.in.h:194 msgid "Expression if condition is met" msgstr "Uttryck om villkoret uppfylls" #: ../data/functions.xml.in.h:195 msgid "Extract Column as Vector" msgstr "Extrahera kolumn som vektor" #: ../data/functions.xml.in.h:196 msgid "Extract Fractional Part" msgstr "Extrahera bråkdel" #: ../data/functions.xml.in.h:197 msgid "Extract Integer Part" msgstr "Extrahera heltal" #: ../data/functions.xml.in.h:198 msgid "Extract row as vector" msgstr "Skapa vektor från rad" #: ../data/functions.xml.in.h:199 msgid "Extreme Values" msgstr "Extremvärden" #: ../data/functions.xml.in.h:200 msgid "Face value" msgstr "Nominellt värde" #: ../data/functions.xml.in.h:201 msgid "Factor expression" msgstr "Faktoruttryck" #: ../data/functions.xml.in.h:202 msgid "Factorial" msgstr "Fakultet" #: ../data/functions.xml.in.h:203 msgid "Factors" msgstr "Faktorer" #: ../data/functions.xml.in.h:204 msgid "Filename" msgstr "Filnamn" #: ../data/functions.xml.in.h:205 msgid "Finance" msgstr "Finans" #: ../data/functions.xml.in.h:206 msgid "Financial function mode" msgstr "Läge för financiella funktioner" #: ../data/functions.xml.in.h:207 msgid "Find Linear Function" msgstr "Finn linjär funktion" #: ../data/functions.xml.in.h:208 msgid "" "Finds the linear function for the straight line between two distinct points." msgstr "" "Finner den linjära funktionen för den räta linjen mellan två distinkta " "punkter." #: ../data/functions.xml.in.h:209 msgid "First data row" msgstr "Första raden med data" #: ../data/functions.xml.in.h:210 msgid "First date" msgstr "Första datumet" #: ../data/functions.xml.in.h:211 msgid "First element" msgstr "Första elementet" #: ../data/functions.xml.in.h:212 msgid "First interest" msgstr "Första ränteinbetalning" #: ../data/functions.xml.in.h:213 msgid "For condition" msgstr "Medans-villkor" #: ../data/functions.xml.in.h:214 msgid "For...Do" msgstr "För...utför" #: ../data/functions.xml.in.h:215 msgid "Fractional dollar" msgstr "Bråktalsdollar" #. Reccurance #: ../data/functions.xml.in.h:217 msgid "Frequency" msgstr "Frekvens" #: ../data/functions.xml.in.h:218 msgid "Function" msgstr "Funktion" #: ../data/functions.xml.in.h:219 msgid "Future Value" msgstr "Framtida värde" #: ../data/functions.xml.in.h:220 msgid "Future value" msgstr "Framtida värde" #: ../data/functions.xml.in.h:221 msgid "Gamma Function" msgstr "Gammafunktion" #: ../data/functions.xml.in.h:222 msgid "Generate Vector" msgstr "Skapa vektor" #: ../data/functions.xml.in.h:223 msgid "" "Generates a pseudo-random number. Returns a real number between 0 and 1, if " "ceil is zero (default), or an integer between 1 and (including) ceil." msgstr "" "Generar ett pseudo-slumpmässigt nummer. Returnerar ett reealt tal mellan 0 " "och 1, om taket är noll (förval), eller ett heltal mellan 1 och (inklusive) " "taket." #: ../data/functions.xml.in.h:224 msgid "Geometric Mean" msgstr "Geometriskt medelvärde" #: ../data/functions.xml.in.h:225 msgid "Geometry" msgstr "Geometri" #: ../data/functions.xml.in.h:226 msgid "Greatest Common Divisor" msgstr "Största gemensamma divisor" #: ../data/functions.xml.in.h:227 msgid "Harmonic Mean" msgstr "Harmoniskt medelvärde" #: ../data/functions.xml.in.h:228 msgid "Heaviside Step Function" msgstr "Enhetssprångfunktion" #: ../data/functions.xml.in.h:229 msgid "Height" msgstr "Höjd" #: ../data/functions.xml.in.h:230 msgid "Height of Regular Tetrahedron" msgstr "Höjden på en liksidig tetrahedron" #: ../data/functions.xml.in.h:231 msgid "Height of Square Pyramid" msgstr "Höjden på en kvadratisk pyramid" #: ../data/functions.xml.in.h:232 msgid "Hexadecimal" msgstr "Hexadecimal" #: ../data/functions.xml.in.h:233 msgid "Hexadecimal number" msgstr "Hexadecimalt nummer" #: ../data/functions.xml.in.h:234 msgid "Hyperbolic Cosecant" msgstr "Cosekant hyperbolicus" #: ../data/functions.xml.in.h:235 msgid "Hyperbolic Cosine" msgstr "Cosinus hyperbolicus" #: ../data/functions.xml.in.h:236 msgid "Hyperbolic Cotangent" msgstr "Cotangens hyperbolicus" #: ../data/functions.xml.in.h:237 msgid "Hyperbolic Secant" msgstr "Sekant hyperbolicus" #: ../data/functions.xml.in.h:238 msgid "Hyperbolic Sine" msgstr "Sinus hyperbolicus" #: ../data/functions.xml.in.h:239 msgid "Hyperbolic Tangent" msgstr "Tangens hyperbolicus" #: ../data/functions.xml.in.h:240 msgid "Hyperfactorial" msgstr "Hyperfakultet" #: ../data/functions.xml.in.h:241 msgid "Hypotenuse" msgstr "Hypotenusa" #: ../data/functions.xml.in.h:242 msgid "Identity" msgstr "Identitetsmatris" #: ../data/functions.xml.in.h:243 msgid "If...Then...Else" msgstr "Om...då...annars" #: ../data/functions.xml.in.h:244 msgid "Imaginary Part" msgstr "Imaginär del" #: ../data/functions.xml.in.h:245 msgid "Index" msgstr "Index" #: ../data/functions.xml.in.h:246 msgid "Index variable" msgstr "Indexvariabel" #: ../data/functions.xml.in.h:247 msgid "Initial value" msgstr "Initialt värde" #: ../data/functions.xml.in.h:248 msgid "Initial value of counter" msgstr "Initialt värde för räknare" #: ../data/functions.xml.in.h:249 msgid "Integers" msgstr "Heltal" #: ../data/functions.xml.in.h:250 msgid "Integral point" msgstr "Integralpunkt" #: ../data/functions.xml.in.h:251 msgid "Integrate" msgstr "Integrera" #: ../data/functions.xml.in.h:252 msgid "Interest paid on a given period of an investment (ISPMT)" msgstr "" #: ../data/functions.xml.in.h:253 msgid "Interest rate" msgstr "Räntesats" #: ../data/functions.xml.in.h:254 msgid "Interest rate for a fully invested security" msgstr "" #: ../data/functions.xml.in.h:255 msgid "Interquartile Range" msgstr "Kvartilavstånd" #: ../data/functions.xml.in.h:256 msgid "Inverse Cosecant" msgstr "Invers cosekant" #: ../data/functions.xml.in.h:257 msgid "Inverse Cosine" msgstr "Invers cosinus" #: ../data/functions.xml.in.h:258 msgid "Inverse Cotangent" msgstr "Invers cotangens" #: ../data/functions.xml.in.h:259 msgid "Inverse Hyperbolic Cosecant" msgstr "Invers cosekant hyperbolicus" #: ../data/functions.xml.in.h:260 msgid "Inverse Hyperbolic Cosine" msgstr "Invers cosinus hyperbolicus" #: ../data/functions.xml.in.h:261 msgid "Inverse Hyperbolic Cotangent" msgstr "Invers cotangens hyperbolicus" #: ../data/functions.xml.in.h:262 msgid "Inverse Hyperbolic Secant" msgstr "Invers sekant hyperbolicus" #: ../data/functions.xml.in.h:263 msgid "Inverse Hyperbolic Sine" msgstr "Invers sinus hyperbolicus" #: ../data/functions.xml.in.h:264 msgid "Inverse Hyperbolic Tangent" msgstr "Invers tangens hyperbolicus" #: ../data/functions.xml.in.h:265 msgid "Inverse Secant" msgstr "Invers sekant" #: ../data/functions.xml.in.h:266 msgid "Inverse Sine" msgstr "Invers sinus" #: ../data/functions.xml.in.h:267 msgid "Inverse Tangent" msgstr "Invers tangens" #: ../data/functions.xml.in.h:268 msgid "Investment" msgstr "Investering" #: ../data/functions.xml.in.h:269 msgid "Is Integer" msgstr "Är heltal" #: ../data/functions.xml.in.h:270 msgid "Is Number" msgstr "Är nummer" #: ../data/functions.xml.in.h:271 msgid "Is Rational" msgstr "Är rationellt" #: ../data/functions.xml.in.h:272 msgid "Is Real" msgstr "Är reellt" #: ../data/functions.xml.in.h:273 msgid "Issue date" msgstr "Startdatum" #: ../data/functions.xml.in.h:274 msgid "Kronecker Delta" msgstr "" #: ../data/functions.xml.in.h:275 msgid "Lambert W Function (Omega Function, Product Log)" msgstr "Lambers W-funktion (Omegafunktionen)" #: ../data/functions.xml.in.h:276 msgid "Last element" msgstr "Sista elementet" #: ../data/functions.xml.in.h:277 msgid "Leading Coefficient" msgstr "Ledande koefficient" #: ../data/functions.xml.in.h:278 msgid "Least Common Multiplier" msgstr "Minsta gemensamma multiplikator" #: ../data/functions.xml.in.h:279 msgid "Length" msgstr "Längd" #: ../data/functions.xml.in.h:280 msgid "Length of base" msgstr "Basens längd" #: ../data/functions.xml.in.h:281 msgid "Length of side" msgstr "Sidans längd" #: ../data/functions.xml.in.h:282 msgid "Length of string" msgstr "Textsträngslängd" #: ../data/functions.xml.in.h:283 msgid "Level-Coupon Bond" msgstr "" #: ../data/functions.xml.in.h:284 msgid "Life" msgstr "Livslängd" #: ../data/functions.xml.in.h:285 msgid "Load CSV File" msgstr "Ladda CSV-fil" #: ../data/functions.xml.in.h:286 msgid "Local Date Format" msgstr "Lokalt datumformat" #: ../data/functions.xml.in.h:287 msgid "Logical" msgstr "Logik" #: ../data/functions.xml.in.h:288 msgid "Logical Exclusive OR" msgstr "" #: ../data/functions.xml.in.h:289 msgid "Logistic Distribution" msgstr "Logistisk distribution" #: ../data/functions.xml.in.h:290 msgid "Logit Transformation" msgstr "Logit transformation" #: ../data/functions.xml.in.h:291 msgid "Lower limit" msgstr "Undre gräns" #: ../data/functions.xml.in.h:292 msgid "Lower limit (i)" msgstr "Undre gräns (i)" #: ../data/functions.xml.in.h:293 msgid "Lowest Degree (Valuation)" msgstr "Lägsta grad (valuering)" #: ../data/functions.xml.in.h:294 msgid "Market interest rate" msgstr "Marknadsränta" #: ../data/functions.xml.in.h:295 msgid "Matrices & Vectors" msgstr "Matriser & Vektorer" #: ../data/functions.xml.in.h:296 msgid "Matrix" msgstr "Matris" #: ../data/functions.xml.in.h:297 msgid "Matrix Area" msgstr "Matrisarea" #: ../data/functions.xml.in.h:298 msgid "Matrix Inverse" msgstr "Matrisinvers" #: ../data/functions.xml.in.h:299 msgid "Matrix or rows/columns" msgstr "Matris eller rader/kolumner" #: ../data/functions.xml.in.h:300 msgid "Matrix or vector" msgstr "Matris eller vektor" #: ../data/functions.xml.in.h:301 msgid "Matrix variable" msgstr "Matrisvariabel" #: ../data/functions.xml.in.h:302 msgid "Matrix/vector" msgstr "Matris/vektor" #: ../data/functions.xml.in.h:303 msgid "Maturity date" msgstr "Mognadsdatum" #: ../data/functions.xml.in.h:304 msgid "Max" msgstr "Max" #: ../data/functions.xml.in.h:305 msgid "Mean" msgstr "Medelvärde" #: ../data/functions.xml.in.h:306 msgid "Mean Deviation" msgstr "Medelavvikelse" #: ../data/functions.xml.in.h:307 msgid "Means" msgstr "Medelvärde" #: ../data/functions.xml.in.h:308 msgid "Median" msgstr "Median" #: ../data/functions.xml.in.h:309 msgid "Merge Vectors" msgstr "Sammanslå vektorer" #: ../data/functions.xml.in.h:310 msgid "Message" msgstr "Meddelande" #: ../data/functions.xml.in.h:311 msgid "Microeconomics" msgstr "Mikroekonomi" #: ../data/functions.xml.in.h:312 msgid "Min" msgstr "Min" #: ../data/functions.xml.in.h:313 msgid "Miscellaneous" msgstr "Diverse" #: ../data/functions.xml.in.h:314 msgid "Mode" msgstr "Typvärde" #: ../data/functions.xml.in.h:315 msgid "Modulus" msgstr "Modulus" #: ../data/functions.xml.in.h:316 msgid "Moments" msgstr "Moment" #: ../data/functions.xml.in.h:317 msgid "Month" msgstr "Månad" #: ../data/functions.xml.in.h:318 msgid "Months" msgstr "Månader" #: ../data/functions.xml.in.h:319 msgid "Multifactorial" msgstr "Multifakultet" #: ../data/functions.xml.in.h:320 msgid "Multiply" msgstr "Multiplicera" #: ../data/functions.xml.in.h:322 msgid "Natural Logarithm" msgstr "Naturlig logaritm" #: ../data/functions.xml.in.h:323 msgid "Negate" msgstr "Negera" #: ../data/functions.xml.in.h:324 msgid "New value" msgstr "Nytt värde" #: ../data/functions.xml.in.h:325 msgid "Nominal Interest Rate" msgstr "Nominell räntesats" #: ../data/functions.xml.in.h:326 msgid "Nominal interest rate" msgstr "Nominell räntesats" #: ../data/functions.xml.in.h:327 msgid "Non-negative value" msgstr "Icke-negativt nummer" #: ../data/functions.xml.in.h:328 msgid "Norm (length)" msgstr "Normal" #: ../data/functions.xml.in.h:329 msgid "Nth root" msgstr "N:te roten" #. A numerical value #: ../data/functions.xml.in.h:331 msgid "Number" msgstr "Nummer" #: ../data/functions.xml.in.h:332 msgid "Number Base" msgstr "Nummerbas" #: ../data/functions.xml.in.h:333 msgid "Number Bases" msgstr "Nummerbaser" #: ../data/functions.xml.in.h:334 msgid "Number Theory" msgstr "Nummerteori" #: ../data/functions.xml.in.h:335 msgid "Number of Samples" msgstr "Antal" #: ../data/functions.xml.in.h:336 msgid "Number of coupons to be paid" msgstr "" #: ../data/functions.xml.in.h:337 msgid "Number of elements" msgstr "Antal element" #: ../data/functions.xml.in.h:338 msgid "Number of periods" msgstr "Antal perioder" #: ../data/functions.xml.in.h:339 msgid "Numerator" msgstr "Täljare" #: ../data/functions.xml.in.h:340 msgid "Objects" msgstr "Objekt" #: ../data/functions.xml.in.h:341 msgid "Octal" msgstr "Oktal" #: ../data/functions.xml.in.h:342 msgid "Octal number" msgstr "Oktalt nummer" #: ../data/functions.xml.in.h:343 msgid "Odd" msgstr "Ojämnt" #: ../data/functions.xml.in.h:344 msgid "Order" msgstr "Ordning" #: ../data/functions.xml.in.h:345 msgid "Original value" msgstr "Ursprungligt värde" #: ../data/functions.xml.in.h:346 msgid "Paired T-Test" msgstr "Parvist t-test" #: ../data/functions.xml.in.h:347 msgid "Par value" msgstr "Nominellt värde" #: ../data/functions.xml.in.h:348 msgid "Parallelogram" msgstr "Parallelogram" #: ../data/functions.xml.in.h:349 msgid "Parallelogram Area" msgstr "Parallelogramarea" #: ../data/functions.xml.in.h:350 msgid "Parallelogram Perimeter" msgstr "Parallelogramomkrets" #: ../data/functions.xml.in.h:351 msgid "Pareto Distribution" msgstr "Paretofördelning" #: ../data/functions.xml.in.h:352 msgid "Payment for a loan" msgstr "Betalning för ett lån" #: ../data/functions.xml.in.h:353 msgid "Payment made each period" msgstr "Periodisk avbetalning " #: ../data/functions.xml.in.h:354 msgid "Payment of an annuity going towards interest (IPMT)" msgstr "Betalning för livränta som går mot ränta (IPMT)" #: ../data/functions.xml.in.h:355 msgid "Payment of an annuity going towards principal (PPMT)" msgstr "Betalning för livränta som går mot kapital (PPMT)" #: ../data/functions.xml.in.h:356 msgid "Pearson's Correlation Coefficient" msgstr "Pearsons korrelationskoefficient" #: ../data/functions.xml.in.h:357 msgid "Percentile" msgstr "Percentil" #: ../data/functions.xml.in.h:359 #, no-c-format msgid "Percentile (%)" msgstr "Percentil (%)" #: ../data/functions.xml.in.h:360 msgid "Period" msgstr "Period" #: ../data/functions.xml.in.h:361 msgid "Periodic interest rate" msgstr "Periodisk räntesats" #: ../data/functions.xml.in.h:362 msgid "Periods" msgstr "Antal perioder" #: ../data/functions.xml.in.h:363 msgid "Periods for investment to attain desired value" msgstr "Perioder för investering att uppnå önskat värde" #: ../data/functions.xml.in.h:364 msgid "Periods of an investment" msgstr "Perioder för en investering" #: ../data/functions.xml.in.h:365 msgid "Periods per year" msgstr "Perioder per år" #: ../data/functions.xml.in.h:366 msgid "Permanent" msgstr "Permanent" #: ../data/functions.xml.in.h:367 msgid "Permutations (Variations)" msgstr "Permutationer (Variationer)" #: ../data/functions.xml.in.h:368 msgid "Polynomial" msgstr "Polynom" #: ../data/functions.xml.in.h:369 msgid "Polynomial Degree" msgstr "Polynomgrad" #: ../data/functions.xml.in.h:370 msgid "Polynomials" msgstr "Polynomer" #: ../data/functions.xml.in.h:371 msgid "Pooled Variance" msgstr "Gemensam varians" #: ../data/functions.xml.in.h:372 msgid "Precalculate expression" msgstr "Beräkna uttrycket först" #: ../data/functions.xml.in.h:373 msgid "Present Value" msgstr "Nuvärde" #: ../data/functions.xml.in.h:374 msgid "Present value" msgstr "Nuvärde" #: ../data/functions.xml.in.h:375 msgid "Price" msgstr "Pris" #: ../data/functions.xml.in.h:376 msgid "Price per $100 face value" msgstr "" #: ../data/functions.xml.in.h:377 msgid "Price per $100 face value of a security" msgstr "Pris per $100 värde av en säkerhet" #: ../data/functions.xml.in.h:378 msgid "Price per $100 face value of a security bond" msgstr "Pris per $100 värde av en säkerhet (ränta vid mognad)" #: ../data/functions.xml.in.h:379 msgid "Price variable" msgstr "Prisvariabel" #: ../data/functions.xml.in.h:380 msgid "Primitive Part" msgstr "Primitiv del" #: ../data/functions.xml.in.h:381 msgid "Principal" msgstr "" #: ../data/functions.xml.in.h:382 msgid "Prism" msgstr "Prism" #: ../data/functions.xml.in.h:383 msgid "Process Matrix Elements" msgstr "Modifiera matriselement" #: ../data/functions.xml.in.h:384 msgid "Process Vector Elements" msgstr "Modifiera vektorelement" #: ../data/functions.xml.in.h:385 msgid "Producer Surplus" msgstr "Producentöverskott" #: ../data/functions.xml.in.h:386 msgid "Product" msgstr "Produkt" #: ../data/functions.xml.in.h:387 msgid "Puts each element of a matrix in vertical order in a vector." msgstr "Placerar varje element i en matris i vertikal ordning i en vektor." #: ../data/functions.xml.in.h:388 msgid "Pyramid" msgstr "Pyramid" #: ../data/functions.xml.in.h:389 msgid "Pyramid Volume" msgstr "Pyramidvolym" #: ../data/functions.xml.in.h:390 msgid "Quadratic Mean (RMS)" msgstr "Kvadratiskt medelvärde" #: ../data/functions.xml.in.h:391 msgid "Quantity variabel" msgstr "Kvantitetsvariabel" #: ../data/functions.xml.in.h:392 msgid "Quartile" msgstr "Kvartil" #: ../data/functions.xml.in.h:393 msgid "RPN Stack Register" msgstr "RPN-stackregister" #: ../data/functions.xml.in.h:394 msgid "RPN Stack Vector" msgstr "RPN-stackvektor" #: ../data/functions.xml.in.h:395 msgid "Radians" msgstr "Radianer" #: ../data/functions.xml.in.h:396 msgid "Radians to Default Angle Unit" msgstr "Radians till färvald vinkelenhet" #: ../data/functions.xml.in.h:397 msgid "Radius" msgstr "Radie" #: ../data/functions.xml.in.h:398 msgid "Raise" msgstr "Upphöj" #: ../data/functions.xml.in.h:399 msgid "Ramp Function" msgstr "Rampfunktion" #: ../data/functions.xml.in.h:400 msgid "Random Number" msgstr "Slumptal" #: ../data/functions.xml.in.h:401 msgid "Random Number Between Limits" msgstr "Slumptal mellan gräser" #: ../data/functions.xml.in.h:402 msgid "Range" msgstr "Omfång" #: ../data/functions.xml.in.h:403 msgid "Rank" msgstr "Rangordna" #: ../data/functions.xml.in.h:404 msgid "Rate" msgstr "Räntesats" #: ../data/functions.xml.in.h:405 msgid "Rayleigh Distribution" msgstr "Rayleighfördelning" #: ../data/functions.xml.in.h:406 msgid "Rayleigh Tail Distribution" msgstr "Rayleighsvansfördelning" #: ../data/functions.xml.in.h:407 msgid "Real Part" msgstr "Reell del" #: ../data/functions.xml.in.h:408 msgid "Reciprocal" msgstr "Reciprok" #: ../data/functions.xml.in.h:409 msgid "Rectangle" msgstr "Rektangel" #: ../data/functions.xml.in.h:410 msgid "Rectangle Area" msgstr "Rektangelarea" #: ../data/functions.xml.in.h:411 msgid "Rectangle Perimeter" msgstr "Rektangelomkrets" #: ../data/functions.xml.in.h:412 msgid "Rectangular Function" msgstr "Rektangulär funktion" #: ../data/functions.xml.in.h:413 msgid "Redemption" msgstr "Utlösande summa" #: ../data/functions.xml.in.h:414 msgid "Regression" msgstr "Regression" #: ../data/functions.xml.in.h:415 msgid "Remainder" msgstr "Rest" #: ../data/functions.xml.in.h:416 msgid "" "Removes all units from an expression. The expression is calculated before " "the removal." msgstr "" "Tar bort alla enheter från ett uttryck. Uttrycket beräknas innan " "borttagandet." #: ../data/functions.xml.in.h:417 msgid "Replace" msgstr "Ersätt" #: ../data/functions.xml.in.h:418 msgid "" "Replaces a certain value in an expression with a new value. The expression " "is calculated before the replacement if the fourth argument is true." msgstr "" "Ersätt ett visst värde i ett uttryck med ett nytt värde. Uttrycket beräknas " "innan ersättandet om den parametern är satt till sant." #: ../data/functions.xml.in.h:419 msgid "Represents Integer" msgstr "Representerar ett heltal" #: ../data/functions.xml.in.h:420 msgid "Represents Number" msgstr "Representar nummer" #: ../data/functions.xml.in.h:421 msgid "Represents Rational" msgstr "Representerar rationellt tal" #: ../data/functions.xml.in.h:422 msgid "Represents Real" msgstr "Representerar reellt tal" #: ../data/functions.xml.in.h:423 msgid "Return on continuously compounded interest" msgstr "" #: ../data/functions.xml.in.h:424 msgid "Returns 0 if i != j and 1 if i = j." msgstr "Returnerar 0 om i != j och 1 if i = j." #: ../data/functions.xml.in.h:425 msgid "Returns a column in a matrix as a vector." msgstr "Returnerar en kolumn i en matris som en vektor." #: ../data/functions.xml.in.h:426 msgid "Returns a matrix imported from a CSV data file." msgstr "Returnerar en matris importerad från en CSV-datafil." #: ../data/functions.xml.in.h:427 msgid "" "Returns a matrix with specified dimensions and listed elements. Omitted " "elements are set to zero." msgstr "" "Returnerar en matris med specifierat antal rader och kolumner, och angivna " "element. Utelämnade element sätts till noll." #: ../data/functions.xml.in.h:428 msgid "Returns a part of a matrix." msgstr "Returnerar en del av en matris." #: ../data/functions.xml.in.h:429 msgid "Returns a part of a vector between two positions." msgstr "Returnerar en del av en vektor mellan två positioner." #: ../data/functions.xml.in.h:430 msgid "Returns a row in a matrix as a vector." msgstr "Returnerar en rad i en matris som en vektor." #: ../data/functions.xml.in.h:431 msgid "Returns a sorted vector. ex. sort([6, 1, 4])=[1, 4, 6]" msgstr "Returnerar en sorterad vektor. t ex sort([6, 1, 4])=[1, 4, 6]" #: ../data/functions.xml.in.h:432 msgid "Returns a value from a hexadecimal number" msgstr "Returnerar ett värde från ett hexadecimalt tal" #: ../data/functions.xml.in.h:433 msgid "" "Returns a vector generated from a function with a variable (default x) " "running from min to max. The fourth argument is either the requested number " "of elements if the sixth argument is false (default) or the step between " "each value of the variable." msgstr "" "Returnerar en vektor skapad från en funktion med en variabel (förvald: x) " "som går från min till max. Den fjärde parametern är antingen det " "efterfrågade antalet element, om det sjätte argumentet är falskt (förvalt), " "eller steget mellan varje värde för variabeln." #: ../data/functions.xml.in.h:434 msgid "Returns a vector with listed elements." msgstr "Returnerar en vektor med listade element." #: ../data/functions.xml.in.h:435 msgid "Returns a vector with the elements from two vectors." msgstr "Returnerar en vektor med element från två vektorer." #: ../data/functions.xml.in.h:436 msgid "" "Returns a vector with values of elements replaced with their mutual ranks." " ex. rank([6, 1, 4]) = [3, 1, 2]" msgstr "" "Returnerar en vektor med elementens värden ersatta av deras inbördes " "rangordning. t ex rank([6, 1, 4]) = [3, 1, 2]" #: ../data/functions.xml.in.h:437 msgid "" "Returns accrued interest for a security which pays periodic interest. " " Allowed frequencies are 1 - annual, 2 - semi-annual or 4 - quarterly. " "Basis is the type of day counting you want to use: 0: US 30/360 (default), " "1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" #: ../data/functions.xml.in.h:438 msgid "Returns an integer between (including) bottom and top." msgstr "Returnerar ett heltal mellan (inklusive) nedre och övre gräns" #: ../data/functions.xml.in.h:439 msgid "Returns an integer from a binary number" msgstr "Returnerar ett heltal från ett binärt tal" #: ../data/functions.xml.in.h:440 msgid "Returns an integer from a number of specified base between 2 and 36" msgstr "Returnerar ett heltal från ett tal med en angiven bas mellan 2 och 36." #: ../data/functions.xml.in.h:441 msgid "Returns an integer from an octal number" msgstr "Returnerar ett heltal från ett oktalt tal" #: ../data/functions.xml.in.h:442 msgid "Returns the RPN stack as a vector." msgstr "Returnerar RPN-stacken som en vektor." #: ../data/functions.xml.in.h:443 msgid "" "Returns the accrued interest for a security which pays interest at maturity " "date. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" #: ../data/functions.xml.in.h:444 msgid "" "Returns the amount of payment for a loan based on a constant interest rate " "and constant payments (each payment is equal amount). If type = 1 " "then the payment is made at the beginning of the period, If type = 0 (or " "omitted) it is made at the end of each period." msgstr "" #: ../data/functions.xml.in.h:445 msgid "" "Returns the amount received at the maturity date for an invested security." " Basis is the type of day counting you want to use: 0: US 30/360 " "(default), 1: real days, 2: real days/360, 3: real days/365 or 4: European " "30/360. The settlement date must be before maturity date." msgstr "" #: ../data/functions.xml.in.h:446 msgid "Returns the base n logarithm." msgstr "Returnerar logaritmen för bas n." #: ../data/functions.xml.in.h:447 msgid "Returns the bond equivalent for a treasury bill." msgstr "" #: ../data/functions.xml.in.h:448 msgid "" "Returns the discount rate for a security. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" #: ../data/functions.xml.in.h:449 msgid "" "Returns the element at specified position in a matrix (row and column) or " "vector (index)." msgstr "" "Returnerar elementet på angiven position i en matris (rad och kolumn) eller " "en vektor (index)." #: ../data/functions.xml.in.h:450 msgid "Returns the highest value." msgstr "Returnerar det högsta värdet." #: ../data/functions.xml.in.h:451 msgid "" "Returns the identity matrix of a matrix or with specified number of rows/" "columns." msgstr "" "Returnerar identitetsmatrisen för en matris eller med angivet antal rader/" "kolumner." #: ../data/functions.xml.in.h:452 msgid "" "Returns the interest rate for a fully invested security. Basis is " "the type of day counting you want to use: 0: US 30/360 (default), 1: real " "days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" #: ../data/functions.xml.in.h:453 msgid "Returns the inverse function for mx*e^x as ln() does for e^x." msgstr "" #: ../data/functions.xml.in.h:454 msgid "Returns the lowest value." msgstr "Returnerar det lägsta värdet." #: ../data/functions.xml.in.h:455 msgid "Returns the most frequently occuring value." msgstr "Returnerar det mest förekommande värdet." #: ../data/functions.xml.in.h:456 msgid "Returns the non-negative square root of x * pi" msgstr "Returnerar icke-negativa kvadratroten av x * pi" #: ../data/functions.xml.in.h:457 msgid "Returns the number of columns in a matrix." msgstr "Returner antalet kolumner i en matris." #: ../data/functions.xml.in.h:458 msgid "" "Returns the number of coupons to be paid between the settlement and the " "maturity. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" #: ../data/functions.xml.in.h:459 msgid "" "Returns the number of days between two dates. Basis is the type of " "day counting you want to use: 0: US 30/360, 1: real days (default), 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Returnerar antalet dagar mellan två datum. Dagsräkningssystem kan " "vara: 0: Amerikanskt 30/360 (förvald), 1: verkliga dagar, 2: verkliga " "dagar/360, 3: verkliga dagar/365, eller 4: Europeiskt 30/360" #: ../data/functions.xml.in.h:460 msgid "Returns the number of elements in a matrix or vector." msgstr "Returnerar antalet element i en matris eller vektor." #: ../data/functions.xml.in.h:461 msgid "Returns the number of elements in a vector." msgstr "Returnerar antalet element i en vektor." #: ../data/functions.xml.in.h:462 msgid "" "Returns the number of periods needed for an investment to attain a desired " "value." msgstr "" "Returnerar antalet perioder som krävs för en investering att uppnå ett " "önskat värde." #: ../data/functions.xml.in.h:463 msgid "" "Returns the number of possible arrangements of an ordered list with a number " "of objects to choose from and a list size. If there are three objects (1, 2 " "and 3) that is put in a list with two positions, the alternatives are [1, " "2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2], and thus the number of " "permutations is 6." msgstr "" "Returnerar antalet möjliga arrangemang av en ordnad lista med ett antal " "objekt att välja mellan och en liststorlek. Om det finns tre olika objekt " "(1, 2 och 3) som sätts i en lista med två positioner, då är möjliga " "alternativ [1, 2], [2, 1], [1, 3], [3, 1], [2, 3] och [3, 2], och därmed är " "antalet permutationer 6." #: ../data/functions.xml.in.h:464 msgid "" "Returns the number of possible arrangements of an unordered list with a " "number of objects to choose from and a list size. If there are three objects " "(1, 2 and 3) that is put in a list with place for two, the alternatives are " "[1, 2], [1, 3], and [2, 3], and thus the number of combinations is 3." msgstr "" "Returnerar antalet möjliga arrangemang av en oordnad lista med ett antal " "objekt att välja mellan och en liststorlek. Om det finns tre olika objekt " "(1, 2 och 3) som sätts i en lista med plats för två, då är möjliga " "alternativ [1, 2], [1, 3], och [2, 3], och därmed är antalet kombinationer 3." #: ../data/functions.xml.in.h:465 msgid "" "Returns the number of possible rearrangements of an ordered list, of a " "certain size, where none of the objects are on their original position. If " "the original list is [1, 2, 3], the possible derangements is [2, 3, 1] and " "[3, 1, 2], and thus the number of derangements is 2." msgstr "" "Returnerar antalet möjliga omarrangemang av en ordnad lista, med en viss " "storlek, där inget av objekten är på sin ursprungliga position. Om den " "ursprungliga listan är [1, 2, 3], då är de möjliga omarrangemangent [2, 3, " "1] och [3, 1, 2], och därmed returneras 2." #: ../data/functions.xml.in.h:466 msgid "Returns the number of rows in a matrix." msgstr "Returnerar antalet rader i en matris." #: ../data/functions.xml.in.h:467 msgid "Returns the number of samples." msgstr "Returnerar antalet prov." #: ../data/functions.xml.in.h:468 msgid "" "Returns the number of years (fractional) between two dates. Basis " "is the type of day counting you want to use: 0: US 30/360, 1: real days " "(default), 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Returnerar antalet år (decimala) mellan två datum. " "Dagsräkningssystem kan vara: 0: Amerikanskt 30/360, 1: verkliga dagar " "(förvald), 2: verkliga dagar/360, 3: verkliga dagar/365, eller 4: Europeiskt " "30/360" #: ../data/functions.xml.in.h:469 msgid "" "Returns the present value of an investment. If type = 1 then the " "payment is made at the beginning of the period, If type = 0 (or omitted) it " "is made at the end of each period." msgstr "" #: ../data/functions.xml.in.h:470 msgid "Returns the price per $100 value for a treasury bill." msgstr "" #: ../data/functions.xml.in.h:471 msgid "" "Returns the probability density p(x) at x for a Pareto distribution with " "exponent and scale. (from Gnumeric)" msgstr "" #: ../data/functions.xml.in.h:472 msgid "" "Returns the probability density p(x) at x for a Rayleigh distribution with " "scale parameter sigma. (from Gnumeric)" msgstr "" #: ../data/functions.xml.in.h:473 msgid "" "Returns the probability density p(x) at x for a Rayleigh tail distribution " "with scale parameter sigma and a lower limit. (from Gnumeric)" msgstr "" #: ../data/functions.xml.in.h:474 msgid "" "Returns the probability density p(x) at x for a logistic distribution with " "scale parameter. (from Gnumeric)" msgstr "" #: ../data/functions.xml.in.h:475 msgid "Returns the transpose of a matrix." msgstr "Returnerar transponeringen av en matris." #: ../data/functions.xml.in.h:476 msgid "Returns the value of a RPN stack register." msgstr "Returnerar värdet för ett register på RPN-stacken." #: ../data/functions.xml.in.h:477 msgid "Returns the value of a roman number." msgstr "Returnerar värdet för romerska siffror." #: ../data/functions.xml.in.h:478 msgid "" "Returns the value of an investment, given the principal, nominal interest " "rate, compounding frequency and time." msgstr "" #: ../data/functions.xml.in.h:479 msgid "Returns the yield for a treasury bill." msgstr "" #: ../data/functions.xml.in.h:480 msgid "Riemann Zeta" msgstr "Riemanns Zeta" #: ../data/functions.xml.in.h:481 msgid "Roman Number" msgstr "Romerskt tal" #: ../data/functions.xml.in.h:482 msgid "Roman number" msgstr "Romerskt tal" #: ../data/functions.xml.in.h:483 msgid "Round" msgstr "Avrunda" #: ../data/functions.xml.in.h:484 msgid "Round Downwards" msgstr "Avrunda neråt" #: ../data/functions.xml.in.h:485 msgid "Round Towards Zero" msgstr "Avrunda mot noll" #: ../data/functions.xml.in.h:486 msgid "Round Upwards" msgstr "Avrunda uppåt" #: ../data/functions.xml.in.h:487 msgid "Rounding" msgstr "Avrundning" #: ../data/functions.xml.in.h:488 msgid "Row" msgstr "Rad" #: ../data/functions.xml.in.h:489 msgid "Row variable" msgstr "Radvariabel" #: ../data/functions.xml.in.h:490 msgid "Row/index" msgstr "Rad/index" #: ../data/functions.xml.in.h:491 msgid "Rows" msgstr "Rader" #: ../data/functions.xml.in.h:492 msgid "Salvage value" msgstr "Slutvärde" #: ../data/functions.xml.in.h:493 msgid "Save as Variable" msgstr "Spara som variabel" #: ../data/functions.xml.in.h:494 msgid "Scale" msgstr "Skala" #: ../data/functions.xml.in.h:495 msgid "Secant" msgstr "Sekant" #: ../data/functions.xml.in.h:496 msgid "Second date" msgstr "Andra datumet" #: ../data/functions.xml.in.h:497 msgid "Select Vector Elements" msgstr "Utvälj vektorelement" #: ../data/functions.xml.in.h:498 msgid "Select first match" msgstr "Välj första matchande element" #: ../data/functions.xml.in.h:499 msgid "Separator" msgstr "Avskiljare" #: ../data/functions.xml.in.h:500 msgid "Settlement date" msgstr "Avräkningsdatum" #: ../data/functions.xml.in.h:501 msgid "Side A" msgstr "Sida A" #: ../data/functions.xml.in.h:502 msgid "Side B" msgstr "Sida B" #: ../data/functions.xml.in.h:503 msgid "Sigma" msgstr "Sigma" #: ../data/functions.xml.in.h:504 msgid "Sigmoid Function" msgstr "Sigmoidfunktion" #: ../data/functions.xml.in.h:505 msgid "Signum" msgstr "Sigma" #: ../data/functions.xml.in.h:506 msgid "Sine" msgstr "Sinus" #: ../data/functions.xml.in.h:507 msgid "Size" msgstr "Storlek" #: ../data/functions.xml.in.h:508 msgid "Solve equation" msgstr "Lös ekvation" #: ../data/functions.xml.in.h:509 msgid "Solve for multiple variables" msgstr "Lös för flera variabler" #: ../data/functions.xml.in.h:510 msgid "Solve for two variables" msgstr "Lös för två variabler" #: ../data/functions.xml.in.h:511 msgid "" "Solves two equations with two unknown variables. Returns the value of the " "first variable." msgstr "" "Lös två ekvationer med två okända variabler. Returnerar värdet på den första " "variabeln." #: ../data/functions.xml.in.h:512 msgid "Sort" msgstr "Sortera" #: ../data/functions.xml.in.h:513 msgid "Spearman's Rho" msgstr "Spearmans Rho" #: ../data/functions.xml.in.h:514 msgid "Sphere" msgstr "Sfär" #: ../data/functions.xml.in.h:515 msgid "Sphere Volume" msgstr "Sfärvolym" #: ../data/functions.xml.in.h:516 msgid "Square" msgstr "Kvadrat" #: ../data/functions.xml.in.h:517 msgid "Square Area" msgstr "Kvadratarea" #: ../data/functions.xml.in.h:518 msgid "Square Perimeter" msgstr "Kvadratomkrets" #: ../data/functions.xml.in.h:519 msgid "Square Root" msgstr "Kvadratrot" #: ../data/functions.xml.in.h:520 msgid "Square root (x * pi)" msgstr "Kvadratrot (x * pi)" #: ../data/functions.xml.in.h:521 msgid "Standard Date Format" msgstr "Standard-datumformat" #: ../data/functions.xml.in.h:522 msgid "Standard Deviation (entire population)" msgstr "Standardavvikelse (komplett population)" #: ../data/functions.xml.in.h:523 msgid "Standard Deviation (random sampling)" msgstr "Standardavvikelse (slumpmässigt urval)" #: ../data/functions.xml.in.h:524 msgid "Standard Error" msgstr "Standardfel" #: ../data/functions.xml.in.h:525 msgid "Start column" msgstr "Startkolumn" #: ../data/functions.xml.in.h:526 msgid "Start row" msgstr "Startrad" #: ../data/functions.xml.in.h:527 msgid "Statistical Correlation" msgstr "Statistisk korrelation" #: ../data/functions.xml.in.h:528 msgid "Statistical Tests" msgstr "Statistika tester" #: ../data/functions.xml.in.h:529 msgid "Statistics" msgstr "Statistik" #: ../data/functions.xml.in.h:530 msgid "Step Functions" msgstr "Språngfunktioner" #: ../data/functions.xml.in.h:531 msgid "Straight Line Depreciation" msgstr "" #: ../data/functions.xml.in.h:532 msgid "Strip Units" msgstr "Ta bort enheter" #: ../data/functions.xml.in.h:533 msgid "Subtract" msgstr "Subtrahera" #: ../data/functions.xml.in.h:534 msgid "Sum" msgstr "Summa" #: ../data/functions.xml.in.h:535 msgid "Sum (total)" msgstr "Summa (total)" #: ../data/functions.xml.in.h:536 msgid "Sum-of-Years Digits Depreciation" msgstr "" #: ../data/functions.xml.in.h:537 msgid "Superfactorial" msgstr "Superfakultet" #: ../data/functions.xml.in.h:538 msgid "Supply function" msgstr "Tillgångsfunktion" #: ../data/functions.xml.in.h:539 msgid "Supply function or price" msgstr "Tillgångsfunktion eller pris" #: ../data/functions.xml.in.h:540 msgid "Surface Area of Cone" msgstr "Ytarea för en kon" #: ../data/functions.xml.in.h:541 msgid "Surface Area of Cube" msgstr "Ytarea för en kub" #: ../data/functions.xml.in.h:542 msgid "Surface Area of Cylinder" msgstr "Ytarea för en cylinder" #: ../data/functions.xml.in.h:543 msgid "Surface Area of Rectangular Prism" msgstr "Ytarea för en rektangulär prism" #: ../data/functions.xml.in.h:544 msgid "Surface Area of Regular Tetrahedron" msgstr "Ytarea för en liksidig tetrahedron" #: ../data/functions.xml.in.h:545 msgid "Surface Area of Sphere" msgstr "Ytarea för en sfär" #: ../data/functions.xml.in.h:546 msgid "Surface Area of Square Pyramid" msgstr "Ytarea för en kvadratisk pyramid" #: ../data/functions.xml.in.h:547 msgid "Tangent" msgstr "Tangens" #: ../data/functions.xml.in.h:548 msgid "Term expression" msgstr "Termuttryck" #: ../data/functions.xml.in.h:549 msgid "Terms" msgstr "Termer" #: ../data/functions.xml.in.h:550 msgid "Tests a condition and returns a value depending on the result." msgstr "Testar ett villkor och returnerar ett värde beroende av result." #: ../data/functions.xml.in.h:551 msgid "Text" msgstr "Text" #: ../data/functions.xml.in.h:552 msgid "Text string 1" msgstr "Textsträng 1" #: ../data/functions.xml.in.h:553 msgid "Text string 2" msgstr "Textsträng 2" #: ../data/functions.xml.in.h:554 ../data/units.xml.in.h:311 msgid "Time" msgstr "Tid" #: ../data/functions.xml.in.h:555 msgid "Timestamp" msgstr "" #: ../data/functions.xml.in.h:556 msgid "Title" msgstr "Titel" #: ../data/functions.xml.in.h:557 msgid "Top" msgstr "Övre gräns" #: ../data/functions.xml.in.h:558 msgid "Trailing Coefficient" msgstr "Avslutande koefficient" #: ../data/functions.xml.in.h:559 msgid "Transpose" msgstr "Transponera" #: ../data/functions.xml.in.h:560 msgid "Trapezoid" msgstr "Trapetsoid" #: ../data/functions.xml.in.h:561 msgid "Trapezoid Area" msgstr "Trapetsoidarea" #: ../data/functions.xml.in.h:562 msgid "Treasury Bill Equivalent" msgstr "" #: ../data/functions.xml.in.h:563 msgid "Treasury Bill Price" msgstr "" #: ../data/functions.xml.in.h:564 msgid "Treasury Bill Yield" msgstr "" #: ../data/functions.xml.in.h:565 msgid "Triangle" msgstr "Triangel" #: ../data/functions.xml.in.h:566 msgid "Triangle Area" msgstr "Triangelarea" #: ../data/functions.xml.in.h:567 msgid "Triangle Perimeter" msgstr "Triangelomkrets" #: ../data/functions.xml.in.h:568 msgid "Triangular Function" msgstr "Triangulär funktion" #: ../data/functions.xml.in.h:569 msgid "Trigonometry" msgstr "Trigonometri" #: ../data/functions.xml.in.h:570 msgid "Trimmed Mean" msgstr "Trimmat medelvärde" #: ../data/functions.xml.in.h:571 msgid "Trimmed percentage (at each end)" msgstr "Trimmad procent (i båda ändarna)" #: ../data/functions.xml.in.h:572 msgid "Type" msgstr "Typ" #: ../data/functions.xml.in.h:573 msgid "Unit Part" msgstr "Enhetsdel" #: ../data/functions.xml.in.h:574 msgid "Unix Timestamp to Date" msgstr "Unit Timestamp till datum" #: ../data/functions.xml.in.h:575 msgid "Unpaired T-Test" msgstr "T-test" #: ../data/functions.xml.in.h:576 msgid "Upper limit" msgstr "Övre gräns" #: ../data/functions.xml.in.h:577 msgid "Upper limit (n)" msgstr "Övre gräns (n)" #: ../data/functions.xml.in.h:578 msgid "Use step size" msgstr "Använd stegstorlek" #: ../data/functions.xml.in.h:579 msgid "Utilities" msgstr "Verktyg" #: ../data/functions.xml.in.h:580 msgid "Value" msgstr "Värde" #: ../data/functions.xml.in.h:581 msgid "Value 1" msgstr "Värde 1" #: ../data/functions.xml.in.h:582 msgid "Value 1 (i)" msgstr "Värde 1 (i)" #: ../data/functions.xml.in.h:583 msgid "Value 2" msgstr "Värde 2" #: ../data/functions.xml.in.h:584 msgid "Value 2 (j)" msgstr "Värde 2 (j)" #: ../data/functions.xml.in.h:585 msgid "Value variable" msgstr "Värdevariabel" #: ../data/functions.xml.in.h:586 msgid "Variable" msgstr "Variabel" #: ../data/functions.xml.in.h:587 msgid "Variable 1" msgstr "Variabel 1" #: ../data/functions.xml.in.h:588 msgid "Variable 2" msgstr "Variabel 2" #: ../data/functions.xml.in.h:589 msgid "Variable of integration" msgstr "Variabel för integration" #: ../data/functions.xml.in.h:590 msgid "Variable vector" msgstr "Variabelvektor" #: ../data/functions.xml.in.h:591 msgid "Variance (entire population)" msgstr "Varians (komplett population)" #: ../data/functions.xml.in.h:592 msgid "Variance (random sampling)" msgstr "Varians (slumpmässigt urval)" #: ../data/functions.xml.in.h:593 msgid "Vector" msgstr "Vektor" #: ../data/functions.xml.in.h:594 msgid "Vector 1" msgstr "Vektor 1" #: ../data/functions.xml.in.h:595 msgid "Vector 2" msgstr "Vektor 2" #: ../data/functions.xml.in.h:596 msgid "Vector Limits" msgstr "Vektorgränser" #: ../data/functions.xml.in.h:597 msgid "Vector variable" msgstr "Vektorvariabel" #: ../data/functions.xml.in.h:598 msgid "Volume of Rectangular Prism" msgstr "Volym för en rektangulär prism" #: ../data/functions.xml.in.h:599 msgid "Volume of Regular Tetrahedron" msgstr "Volym för en liksidig tetrahedron" #: ../data/functions.xml.in.h:600 msgid "Volume of Square Pyramid" msgstr "Volym för en kvadratisk pyramid" #: ../data/functions.xml.in.h:601 msgid "Volume of Triangular Prism" msgstr "Volym för en triangulär prism" #: ../data/functions.xml.in.h:602 msgid "Week begins on Sunday" msgstr "Veckor börjar på söndag" #: ../data/functions.xml.in.h:603 msgid "Week of Year" msgstr "Vecka på året" #: ../data/functions.xml.in.h:605 msgid "Weighted Mean" msgstr "Viktat medelvärde" #: ../data/functions.xml.in.h:606 msgid "Weights" msgstr "Vikter" #: ../data/functions.xml.in.h:607 msgid "Width" msgstr "Bredd" #: ../data/functions.xml.in.h:608 msgid "Width of base" msgstr "Basens bredd" #: ../data/functions.xml.in.h:609 msgid "Winsorized Mean" msgstr "Winsor-medelvärde" #: ../data/functions.xml.in.h:610 msgid "Winsorized percentage (at each end)" msgstr "Winsorprocent (i båda ändarna)" #: ../data/functions.xml.in.h:611 msgid "With respect to" msgstr "Med avseende på" #: ../data/functions.xml.in.h:612 msgid "X" msgstr "X" #: ../data/functions.xml.in.h:613 msgid "X raised to the power Y" msgstr "X upphöjt med Y" #: ../data/functions.xml.in.h:614 msgid "Year" msgstr "År" #: ../data/functions.xml.in.h:615 msgid "Years" msgstr "Antal år" #: ../data/functions.xml.in.h:616 msgid "Years between two dates" msgstr "Antal är mellan två datum" #: ../data/functions.xml.in.h:617 msgid "Zero Coupon" msgstr "Nollkupong" #: ../data/functions.xml.in.h:618 msgid "au:√,r:sqrt" msgstr "" #: ../data/functions.xml.in.h:619 msgid "au:Π,r:product" msgstr "au:Π,produkt" #: ../data/functions.xml.in.h:620 msgid "au:Σ,r:sum" msgstr "au:Σ,summa" #: ../data/functions.xml.in.h:621 msgid "r:abs" msgstr "" #: ../data/functions.xml.in.h:622 msgid "r:accrint" msgstr "" #: ../data/functions.xml.in.h:623 msgid "r:accrintm" msgstr "" #: ../data/functions.xml.in.h:624 msgid "r:acos" msgstr "" #: ../data/functions.xml.in.h:625 msgid "r:acosh" msgstr "" #: ../data/functions.xml.in.h:626 msgid "r:acot" msgstr "" #: ../data/functions.xml.in.h:627 msgid "r:acoth" msgstr "" #: ../data/functions.xml.in.h:628 msgid "r:acsc" msgstr "" #: ../data/functions.xml.in.h:629 msgid "r:acsch" msgstr "" #: ../data/functions.xml.in.h:630 msgid "r:add" msgstr "addera" #: ../data/functions.xml.in.h:631 msgid "r:addDays" msgstr "adderaDagar" #: ../data/functions.xml.in.h:632 msgid "r:addMonths" msgstr "adderaMånader" #: ../data/functions.xml.in.h:633 msgid "r:addTime" msgstr "adderaTid" #: ../data/functions.xml.in.h:634 msgid "r:addYears" msgstr "adderaÅr" #: ../data/functions.xml.in.h:635 msgid "r:adj" msgstr "" #. Matrix area #: ../data/functions.xml.in.h:637 msgid "r:area" msgstr "" #: ../data/functions.xml.in.h:638 msgid "r:asec" msgstr "" #: ../data/functions.xml.in.h:639 msgid "r:asech" msgstr "" #: ../data/functions.xml.in.h:640 msgid "r:asin" msgstr "" #: ../data/functions.xml.in.h:641 msgid "r:asinh" msgstr "" #: ../data/functions.xml.in.h:642 msgid "r:atan" msgstr "" #: ../data/functions.xml.in.h:643 msgid "r:atanh" msgstr "" #: ../data/functions.xml.in.h:644 msgid "r:base" msgstr "bas" #: ../data/functions.xml.in.h:645 msgid "r:beta" msgstr "" #: ../data/functions.xml.in.h:646 msgid "r:bin" msgstr "" #: ../data/functions.xml.in.h:647 msgid "r:binomial" msgstr "" #: ../data/functions.xml.in.h:648 msgid "r:bitxor" msgstr "" #: ../data/functions.xml.in.h:649 msgid "r:cbrt" msgstr "" #: ../data/functions.xml.in.h:650 msgid "r:ceil" msgstr "tak" #: ../data/functions.xml.in.h:651 msgid "r:char" msgstr "tecken" #: ../data/functions.xml.in.h:652 msgid "r:circle" msgstr "cirkel" #: ../data/functions.xml.in.h:653 msgid "r:circumference" msgstr "omkrets" #: ../data/functions.xml.in.h:654 msgid "r:cis" msgstr "" #: ../data/functions.xml.in.h:655 msgid "r:code" msgstr "kod" #: ../data/functions.xml.in.h:656 msgid "r:coeff" msgstr "" #: ../data/functions.xml.in.h:657 msgid "r:cofactor" msgstr "kofaktor" #: ../data/functions.xml.in.h:658 msgid "r:column" msgstr "kolumn" #: ../data/functions.xml.in.h:659 msgid "r:columns" msgstr "kolumner" #: ../data/functions.xml.in.h:660 msgid "r:comb" msgstr "kombinationer" #: ../data/functions.xml.in.h:661 msgid "r:compound" msgstr "" #: ../data/functions.xml.in.h:662 msgid "r:concatenate" msgstr "sammanfoga" #: ../data/functions.xml.in.h:663 msgid "r:cone" msgstr "kon" #: ../data/functions.xml.in.h:664 msgid "r:cone_sa" msgstr "konyta" #: ../data/functions.xml.in.h:665 msgid "r:continuous" msgstr "" #: ../data/functions.xml.in.h:666 msgid "r:cor" msgstr "" #: ../data/functions.xml.in.h:667 msgid "r:cos" msgstr "" #: ../data/functions.xml.in.h:668 msgid "r:cosh" msgstr "" #: ../data/functions.xml.in.h:669 msgid "r:cot" msgstr "" #: ../data/functions.xml.in.h:670 msgid "r:coth" msgstr "" #: ../data/functions.xml.in.h:671 msgid "r:coupnum" msgstr "" #: ../data/functions.xml.in.h:672 msgid "r:cov,r:covar" msgstr "" #: ../data/functions.xml.in.h:673 msgid "r:cross" msgstr "vektoriell" #: ../data/functions.xml.in.h:674 msgid "r:csc" msgstr "" #: ../data/functions.xml.in.h:675 msgid "r:csch" msgstr "" #: ../data/functions.xml.in.h:676 msgid "r:csum" msgstr "" #: ../data/functions.xml.in.h:677 msgid "r:csurplus" msgstr "konsumentöverskott" #: ../data/functions.xml.in.h:678 msgid "r:cube" msgstr "kub" #: ../data/functions.xml.in.h:679 msgid "r:cube_sa" msgstr "kubyta" #: ../data/functions.xml.in.h:680 msgid "r:cylinder" msgstr "" #: ../data/functions.xml.in.h:681 msgid "r:cylinder_sa" msgstr "cylinderyta" #: ../data/functions.xml.in.h:682 msgid "r:day" msgstr "dag" #: ../data/functions.xml.in.h:683 msgid "r:days" msgstr "dagar" #: ../data/functions.xml.in.h:684 msgid "r:decile" msgstr "decil" #: ../data/functions.xml.in.h:685 msgid "r:degree" msgstr "grad" #: ../data/functions.xml.in.h:686 msgid "r:denominator" msgstr "nämnare" #: ../data/functions.xml.in.h:687 msgid "r:derangements" msgstr "" #: ../data/functions.xml.in.h:688 msgid "r:det" msgstr "" #: ../data/functions.xml.in.h:689 msgid "r:diff" msgstr "" #: ../data/functions.xml.in.h:690 msgid "r:dimension" msgstr "" #: ../data/functions.xml.in.h:691 msgid "r:disc" msgstr "" #: ../data/functions.xml.in.h:692 msgid "r:divide" msgstr "dela" #: ../data/functions.xml.in.h:693 msgid "r:dollarde" msgstr "" #: ../data/functions.xml.in.h:694 msgid "r:dollarfr" msgstr "" #: ../data/functions.xml.in.h:695 msgid "r:duration" msgstr "" #: ../data/functions.xml.in.h:696 msgid "r:durbinwatson" msgstr "" #: ../data/functions.xml.in.h:697 msgid "r:effect" msgstr "" #: ../data/functions.xml.in.h:698 msgid "r:elasticity" msgstr "elasticitet" #: ../data/functions.xml.in.h:699 msgid "r:element" msgstr "" #: ../data/functions.xml.in.h:700 msgid "r:elements" msgstr "" #: ../data/functions.xml.in.h:701 msgid "r:error" msgstr "fel" #: ../data/functions.xml.in.h:702 msgid "r:even" msgstr "jämn" #: ../data/functions.xml.in.h:703 msgid "r:exp" msgstr "" #: ../data/functions.xml.in.h:704 msgid "r:export" msgstr "exportera" #: ../data/functions.xml.in.h:705 msgid "r:extremum" msgstr "" #: ../data/functions.xml.in.h:706 msgid "r:factorial" msgstr "fakultet" #: ../data/functions.xml.in.h:707 msgid "r:factorial2" msgstr "fakultet2" #: ../data/functions.xml.in.h:708 msgid "r:floor" msgstr "golv" #: ../data/functions.xml.in.h:709 msgid "r:for" msgstr "för" #: ../data/functions.xml.in.h:710 msgid "r:frac" msgstr "" #: ../data/functions.xml.in.h:711 msgid "r:function" msgstr "funktion" #: ../data/functions.xml.in.h:712 msgid "r:fv" msgstr "" #: ../data/functions.xml.in.h:713 msgid "r:g_duration" msgstr "" #: ../data/functions.xml.in.h:714 msgid "r:gamma" msgstr "" #: ../data/functions.xml.in.h:715 msgid "r:gcd" msgstr "" #: ../data/functions.xml.in.h:716 msgid "r:genvector" msgstr "" #: ../data/functions.xml.in.h:717 msgid "r:geomean" msgstr "geomedel" #: ../data/functions.xml.in.h:718 msgid "r:harmmean" msgstr "harmmedel" #: ../data/functions.xml.in.h:719 msgid "r:heaviside" msgstr "enhetssprång" #: ../data/functions.xml.in.h:720 msgid "r:hex" msgstr "" #: ../data/functions.xml.in.h:721 msgid "r:hyperfactorial" msgstr "hyperfakultet" #: ../data/functions.xml.in.h:722 msgid "r:hypot" msgstr "" #: ../data/functions.xml.in.h:723 msgid "r:identity" msgstr "identitetsmatris" #: ../data/functions.xml.in.h:724 msgid "r:if" msgstr "om" #: ../data/functions.xml.in.h:725 msgid "r:im" msgstr "" #: ../data/functions.xml.in.h:726 msgid "r:int" msgstr "" #: ../data/functions.xml.in.h:727 msgid "r:integrate" msgstr "integrera" #: ../data/functions.xml.in.h:728 msgid "r:intrate" msgstr "" #: ../data/functions.xml.in.h:729 msgid "r:inv" msgstr "" #: ../data/functions.xml.in.h:730 msgid "r:inverse" msgstr "invers" #: ../data/functions.xml.in.h:731 msgid "r:ipmt" msgstr "" #: ../data/functions.xml.in.h:732 msgid "r:iqr" msgstr "" #: ../data/functions.xml.in.h:733 msgid "r:isInteger" msgstr "ärHeltal" #: ../data/functions.xml.in.h:734 msgid "r:isNumber" msgstr "ärNummer" #: ../data/functions.xml.in.h:735 msgid "r:isRational" msgstr "ärRationellt" #: ../data/functions.xml.in.h:736 msgid "r:isReal" msgstr "ärReellt" #: ../data/functions.xml.in.h:737 msgid "r:isodate" msgstr "isodatum" #: ../data/functions.xml.in.h:738 msgid "r:ispmt" msgstr "" #: ../data/functions.xml.in.h:739 msgid "r:kronecker" msgstr "" #: ../data/functions.xml.in.h:740 msgid "r:lambertw,productlog" msgstr "" #: ../data/functions.xml.in.h:741 msgid "r:lcm" msgstr "" #: ../data/functions.xml.in.h:742 msgid "r:lcoeff" msgstr "" #: ../data/functions.xml.in.h:743 msgid "r:ldegree" msgstr "" #: ../data/functions.xml.in.h:744 msgid "r:len" msgstr "längd" #: ../data/functions.xml.in.h:745 msgid "r:level_coupon" msgstr "" #: ../data/functions.xml.in.h:746 msgid "r:limits" msgstr "gränser" #: ../data/functions.xml.in.h:747 msgid "r:linearfunction" msgstr "linjär_funktion" #: ../data/functions.xml.in.h:748 msgid "r:ln" msgstr "" #: ../data/functions.xml.in.h:749 msgid "r:load" msgstr "ladda" #: ../data/functions.xml.in.h:750 msgid "r:localdate" msgstr "lokalt_datum" #: ../data/functions.xml.in.h:751 msgid "r:log" msgstr "" #: ../data/functions.xml.in.h:752 msgid "r:logistic" msgstr "" #: ../data/functions.xml.in.h:753 msgid "r:logit" msgstr "" #: ../data/functions.xml.in.h:754 msgid "r:matrix" msgstr "matris" #: ../data/functions.xml.in.h:755 msgid "r:matrix2vector" msgstr "" #: ../data/functions.xml.in.h:756 msgid "r:max" msgstr "" #: ../data/functions.xml.in.h:757 msgid "r:mean,average" msgstr "medel" #: ../data/functions.xml.in.h:758 msgid "r:meandev" msgstr "medelavvikelse" #: ../data/functions.xml.in.h:759 msgid "r:median" msgstr "" #: ../data/functions.xml.in.h:760 msgid "r:mergevectors" msgstr "" #: ../data/functions.xml.in.h:761 msgid "r:message" msgstr "meddelande" #: ../data/functions.xml.in.h:762 msgid "r:min" msgstr "" #: ../data/functions.xml.in.h:763 msgid "r:mod" msgstr "" #: ../data/functions.xml.in.h:764 msgid "r:mode" msgstr "typvärde" #: ../data/functions.xml.in.h:765 msgid "r:month" msgstr "månad" #: ../data/functions.xml.in.h:766 msgid "r:multifactorial" msgstr "multifakultet" #: ../data/functions.xml.in.h:767 msgid "r:multiply" msgstr "multiplicera" #: ../data/functions.xml.in.h:768 msgid "r:multisolve" msgstr "" #: ../data/functions.xml.in.h:769 msgid "r:neg" msgstr "" #: ../data/functions.xml.in.h:770 msgid "r:nominal" msgstr "" #: ../data/functions.xml.in.h:771 msgid "r:norm" msgstr "" #: ../data/functions.xml.in.h:772 msgid "r:nounit,strip_units" msgstr "" #: ../data/functions.xml.in.h:773 msgid "r:nper" msgstr "" #. Number of samples #: ../data/functions.xml.in.h:775 msgid "r:number" msgstr "antal" #: ../data/functions.xml.in.h:776 msgid "r:numerator" msgstr "täljare" #: ../data/functions.xml.in.h:777 msgid "r:oct" msgstr "okt" #: ../data/functions.xml.in.h:778 msgid "r:odd" msgstr "udda" #: ../data/functions.xml.in.h:779 msgid "r:parallelogram" msgstr "parallellogram" #: ../data/functions.xml.in.h:780 msgid "r:parallelogram_perimeter" msgstr "parallellogramomkrets" #: ../data/functions.xml.in.h:781 msgid "r:pareto" msgstr "" #: ../data/functions.xml.in.h:782 msgid "r:pcontent" msgstr "" #: ../data/functions.xml.in.h:783 msgid "r:pearson,r:correl" msgstr "korrelation" #: ../data/functions.xml.in.h:784 msgid "r:percentile" msgstr "percentil" #: ../data/functions.xml.in.h:785 msgid "r:perm,variations" msgstr "variationer" #: ../data/functions.xml.in.h:786 msgid "r:permanent" msgstr "" #: ../data/functions.xml.in.h:787 msgid "r:pmt" msgstr "" #: ../data/functions.xml.in.h:788 msgid "r:poolvar" msgstr "" #: ../data/functions.xml.in.h:789 msgid "r:pow" msgstr "upphöj" #: ../data/functions.xml.in.h:790 msgid "r:ppmt" msgstr "" #: ../data/functions.xml.in.h:791 msgid "r:pricedisc" msgstr "" #: ../data/functions.xml.in.h:792 msgid "r:pricemat" msgstr "" #: ../data/functions.xml.in.h:793 msgid "r:primpart" msgstr "" #: ../data/functions.xml.in.h:794 msgid "r:process" msgstr "" #: ../data/functions.xml.in.h:795 msgid "r:processm" msgstr "" #: ../data/functions.xml.in.h:796 msgid "r:psurplus" msgstr "producentöverskott" #: ../data/functions.xml.in.h:797 msgid "r:pttest" msgstr "" #: ../data/functions.xml.in.h:798 msgid "r:punit" msgstr "" #: ../data/functions.xml.in.h:799 msgid "r:pv" msgstr "" #: ../data/functions.xml.in.h:800 msgid "r:pyramid" msgstr "" #: ../data/functions.xml.in.h:801 msgid "r:quartile" msgstr "kvartil" #: ../data/functions.xml.in.h:802 msgid "r:radtodef" msgstr "" #: ../data/functions.xml.in.h:803 msgid "r:raise" msgstr "upphöj" #: ../data/functions.xml.in.h:804 msgid "r:ramp" msgstr "" #: ../data/functions.xml.in.h:805 msgid "r:rand" msgstr "slumptal" #: ../data/functions.xml.in.h:806 msgid "r:randbetween" msgstr "" #: ../data/functions.xml.in.h:807 msgid "r:range" msgstr "omfång" #: ../data/functions.xml.in.h:808 msgid "r:rank" msgstr "rangordna" #: ../data/functions.xml.in.h:809 msgid "r:rayleigh" msgstr "" #: ../data/functions.xml.in.h:810 msgid "r:rayleightail" msgstr "" #: ../data/functions.xml.in.h:811 msgid "r:re" msgstr "" #: ../data/functions.xml.in.h:812 msgid "r:received" msgstr "" #: ../data/functions.xml.in.h:813 msgid "r:rect" msgstr "rektangel" #: ../data/functions.xml.in.h:814 msgid "r:rect_perimeter" msgstr "rektangelomkrets" #: ../data/functions.xml.in.h:815 msgid "r:rectangular" msgstr "rektangulär" #: ../data/functions.xml.in.h:816 msgid "r:rectprism" msgstr "rektangelprism" #: ../data/functions.xml.in.h:817 msgid "r:rectprism_sa" msgstr "rektangelprismyta" #: ../data/functions.xml.in.h:818 msgid "r:register" msgstr "" #: ../data/functions.xml.in.h:819 msgid "r:rem" msgstr "" #: ../data/functions.xml.in.h:820 msgid "r:replace" msgstr "ersätt" #: ../data/functions.xml.in.h:821 msgid "r:representsInteger" msgstr "representarHeltal" #: ../data/functions.xml.in.h:822 msgid "r:representsNumber" msgstr "representerarNummer" #: ../data/functions.xml.in.h:823 msgid "r:representsRational" msgstr "representerarRationellt" #: ../data/functions.xml.in.h:824 msgid "r:representsReal" msgstr "representerarReelt" #: ../data/functions.xml.in.h:825 msgid "r:rms" msgstr "" #: ../data/functions.xml.in.h:826 msgid "r:roman" msgstr "" #: ../data/functions.xml.in.h:827 msgid "r:root" msgstr "rot" #: ../data/functions.xml.in.h:828 msgid "r:round" msgstr "avrunda" #: ../data/functions.xml.in.h:829 msgid "r:row" msgstr "rad" #: ../data/functions.xml.in.h:830 msgid "r:rows" msgstr "rader" #: ../data/functions.xml.in.h:831 msgid "r:save" msgstr "spara" #: ../data/functions.xml.in.h:832 msgid "r:sec" msgstr "" #: ../data/functions.xml.in.h:833 msgid "r:sech" msgstr "" #: ../data/functions.xml.in.h:834 msgid "r:select" msgstr "" #: ../data/functions.xml.in.h:835 msgid "r:sgn" msgstr "" #: ../data/functions.xml.in.h:836 msgid "r:shift" msgstr "" #: ../data/functions.xml.in.h:837 msgid "r:sigmoid" msgstr "" #: ../data/functions.xml.in.h:838 msgid "r:sin" msgstr "" #: ../data/functions.xml.in.h:839 msgid "r:sinh" msgstr "" #: ../data/functions.xml.in.h:840 msgid "r:sln" msgstr "" #: ../data/functions.xml.in.h:841 msgid "r:solve" msgstr "lös" #: ../data/functions.xml.in.h:842 msgid "r:solve2" msgstr "lös2" #: ../data/functions.xml.in.h:843 msgid "r:sort" msgstr "sortera" #: ../data/functions.xml.in.h:844 msgid "r:spearman" msgstr "" #: ../data/functions.xml.in.h:845 msgid "r:sphere" msgstr "sfär" #: ../data/functions.xml.in.h:846 msgid "r:sphere_sa" msgstr "sfäryta" #: ../data/functions.xml.in.h:847 msgid "r:sq" msgstr "" #: ../data/functions.xml.in.h:848 msgid "r:sqpyramid" msgstr "kvpyramid" #: ../data/functions.xml.in.h:849 msgid "r:sqpyramid_height" msgstr "kvpyramidhöjd" #: ../data/functions.xml.in.h:850 msgid "r:sqpyramid_sa" msgstr "kvpyramidyta" #: ../data/functions.xml.in.h:851 msgid "r:sqrtpi" msgstr "" #: ../data/functions.xml.in.h:852 msgid "r:square" msgstr "kvadrat" #: ../data/functions.xml.in.h:853 msgid "r:square_perimeter" msgstr "kvadratomkrets" #: ../data/functions.xml.in.h:854 msgid "r:stack" msgstr "" #: ../data/functions.xml.in.h:855 msgid "r:stamptodate" msgstr "" #: ../data/functions.xml.in.h:856 msgid "r:stderr" msgstr "standardfel" #: ../data/functions.xml.in.h:857 msgid "r:stdev" msgstr "standardavvikelse" #: ../data/functions.xml.in.h:858 msgid "r:stdevp" msgstr "" #: ../data/functions.xml.in.h:859 msgid "r:subtract" msgstr "subtrahera" #: ../data/functions.xml.in.h:860 msgid "r:superfactorial" msgstr "superfakultet" #: ../data/functions.xml.in.h:861 msgid "r:syd" msgstr "" #: ../data/functions.xml.in.h:862 msgid "r:tan" msgstr "" #: ../data/functions.xml.in.h:863 msgid "r:tanh" msgstr "" #: ../data/functions.xml.in.h:864 msgid "r:tbilleq" msgstr "" #: ../data/functions.xml.in.h:865 msgid "r:tbillprice" msgstr "" #: ../data/functions.xml.in.h:866 msgid "r:tbillyield" msgstr "" #: ../data/functions.xml.in.h:867 msgid "r:tcoeff" msgstr "" #: ../data/functions.xml.in.h:868 msgid "r:tetrahedron" msgstr "" #: ../data/functions.xml.in.h:869 msgid "r:tetrahedron_height" msgstr "tetrahedronhöjd" #: ../data/functions.xml.in.h:870 msgid "r:tetrahedron_sa" msgstr "tetrahedronyta" #: ../data/functions.xml.in.h:871 msgid "r:time" msgstr "tid" #: ../data/functions.xml.in.h:872 msgid "r:timestamp" msgstr "" #: ../data/functions.xml.in.h:873 msgid "r:title" msgstr "titel" #: ../data/functions.xml.in.h:874 msgid "r:total" msgstr "totalt" #: ../data/functions.xml.in.h:875 msgid "r:transpose" msgstr "transponera" #: ../data/functions.xml.in.h:876 msgid "r:trapezoid" msgstr "trapetsoid" #: ../data/functions.xml.in.h:877 msgid "r:triangle" msgstr "triangel" #: ../data/functions.xml.in.h:878 msgid "r:triangle_perimeter" msgstr "triangelomkrets" #: ../data/functions.xml.in.h:879 msgid "r:triangleprism" msgstr "triangelprism" #: ../data/functions.xml.in.h:880 msgid "r:triangular" msgstr "triangulär" #: ../data/functions.xml.in.h:881 msgid "r:trimmean" msgstr "" #: ../data/functions.xml.in.h:882 msgid "r:trunc" msgstr "" #: ../data/functions.xml.in.h:883 msgid "r:ttest" msgstr "" #: ../data/functions.xml.in.h:884 msgid "r:var" msgstr "" #: ../data/functions.xml.in.h:885 msgid "r:varp" msgstr "" #: ../data/functions.xml.in.h:886 msgid "r:vector" msgstr "vektor" #: ../data/functions.xml.in.h:887 msgid "r:warning" msgstr "varning" #: ../data/functions.xml.in.h:888 msgid "r:week" msgstr "vecka" #: ../data/functions.xml.in.h:889 msgid "r:weekday" msgstr "veckodag" #: ../data/functions.xml.in.h:890 msgid "r:weighmean" msgstr "" #: ../data/functions.xml.in.h:891 msgid "r:winsormean" msgstr "" #: ../data/functions.xml.in.h:892 msgid "r:xor" msgstr "" #: ../data/functions.xml.in.h:893 msgid "r:year" msgstr "år" #: ../data/functions.xml.in.h:894 msgid "r:yearday" msgstr "årsdag" #: ../data/functions.xml.in.h:895 msgid "r:yearfrac" msgstr "" #: ../data/functions.xml.in.h:896 msgid "r:zero_coupon" msgstr "" #: ../data/functions.xml.in.h:897 msgid "r:zeta" msgstr "" #: ../data/functions.xml.in.h:898 msgid "rs:exp10" msgstr "" #: ../data/functions.xml.in.h:899 msgid "rs:exp2" msgstr "" #: ../data/functions.xml.in.h:900 msgid "rs:log10" msgstr "" #: ../data/functions.xml.in.h:901 msgid "rs:log2" msgstr "" #: ../data/functions.xml.in.h:902 msgid "x1" msgstr "" #: ../data/functions.xml.in.h:903 msgid "x2" msgstr "" #: ../data/functions.xml.in.h:904 msgid "y1" msgstr "" #: ../data/functions.xml.in.h:905 msgid "y2" msgstr "" #. Planet #: ../data/planets.xml.in.h:2 msgid "!planets!Mercury" msgstr "Merkurius" #: ../data/planets.xml.in.h:3 msgid "Earth" msgstr "Jorden" #: ../data/planets.xml.in.h:4 msgid "Jupiter" msgstr "" #: ../data/planets.xml.in.h:5 msgid "Mars" msgstr "" #: ../data/planets.xml.in.h:6 msgid "Neptune" msgstr "Neptunus" #: ../data/planets.xml.in.h:7 msgid "Pluto" msgstr "" #: ../data/planets.xml.in.h:8 msgid "Saturn" msgstr "Saturnus" #: ../data/planets.xml.in.h:9 msgid "Uranus" msgstr "" #: ../data/planets.xml.in.h:10 msgid "Venus" msgstr "" #. Unit category #: ../data/units.xml.in.h:2 msgid "!units!Angle" msgstr "Vinkel" #. Unit category #: ../data/units.xml.in.h:4 msgid "!units!Frequency" msgstr "Frekvens" #. Unit category #: ../data/units.xml.in.h:6 msgid "!units!Length" msgstr "Längd" #. Unit category #: ../data/units.xml.in.h:8 msgid "!units!Mass" msgstr "Massa" #: ../data/units.xml.in.h:9 msgid "Ångström" msgstr "Ångström" #: ../data/units.xml.in.h:10 msgid "ATA Pica" msgstr "" #: ../data/units.xml.in.h:11 msgid "ATA Point" msgstr "" #: ../data/units.xml.in.h:12 msgid "Abampere" msgstr "Abampere" #: ../data/units.xml.in.h:13 msgid "Abcoulomb" msgstr "Abcoulomb" #: ../data/units.xml.in.h:14 msgid "Abohm" msgstr "Abohm" #: ../data/units.xml.in.h:15 msgid "Absorbed Dose" msgstr "Absorberad dos" #: ../data/units.xml.in.h:16 msgid "Absorbed Dose Rate" msgstr "Absorberad dosrat" #: ../data/units.xml.in.h:17 msgid "Abvolt" msgstr "Abvolt" #: ../data/units.xml.in.h:18 msgid "Acceleration" msgstr "Acceleration" #: ../data/units.xml.in.h:19 msgid "Acre" msgstr "" #: ../data/units.xml.in.h:20 msgid "Ampere" msgstr "Ampere" #: ../data/units.xml.in.h:21 msgid "Ampere per Meter" msgstr "Ampere per meter" #: ../data/units.xml.in.h:22 msgid "Ampere per Meter Squared" msgstr "Ampere per kvadratmeter" #: ../data/units.xml.in.h:23 msgid "Ampere per Volt" msgstr "Ampere per volt" #: ../data/units.xml.in.h:24 msgid "Angular Acceleration" msgstr "Vinkelacceleration" #: ../data/units.xml.in.h:25 msgid "Angular Velocity" msgstr "Vinkelhastighet" #: ../data/units.xml.in.h:26 msgid "Arcminute" msgstr "" #: ../data/units.xml.in.h:27 msgid "Arcsecond" msgstr "" #: ../data/units.xml.in.h:28 msgid "Are" msgstr "" #: ../data/units.xml.in.h:29 msgid "Area" msgstr "" #: ../data/units.xml.in.h:30 msgid "Astronomical Unit" msgstr "Astronomisk enhet" #: ../data/units.xml.in.h:31 msgid "Atmosphere" msgstr "Atmosfär" #: ../data/units.xml.in.h:32 msgid "Atomic Mass Unit" msgstr "Atomisk massenhet" #: ../data/units.xml.in.h:33 msgid "Bar" msgstr "Bar" #: ../data/units.xml.in.h:34 msgid "Barn" msgstr "" #: ../data/units.xml.in.h:35 msgid "Becquerel" msgstr "Becquerel" #: ../data/units.xml.in.h:36 msgid "Bel" msgstr "" #: ../data/units.xml.in.h:37 msgid "Bit" msgstr "Bit" #: ../data/units.xml.in.h:38 msgid "British Thermal Unit (IT)" msgstr "" #: ../data/units.xml.in.h:39 msgid "Byte (8-bit)" msgstr "Byte (8-bit)" #: ../data/units.xml.in.h:40 msgid "Calorie (15 degrees Celcius)" msgstr "Kalorier (15 grader Celcius)" #: ../data/units.xml.in.h:41 msgid "Calorie (capital C)" msgstr "Kalorier (med stort K)" #: ../data/units.xml.in.h:42 msgid "Calorie (international table)" msgstr "Kalorier (international table)" #: ../data/units.xml.in.h:43 msgid "Calorie (mean)" msgstr "Kalorier (medel)" #: ../data/units.xml.in.h:44 msgid "Calorie (thermochemical)" msgstr "Kalorier (termokemiska)" #: ../data/units.xml.in.h:45 msgid "Candela" msgstr "Candela" #: ../data/units.xml.in.h:46 msgid "Candela Steradian" msgstr "Candelasteradian" #: ../data/units.xml.in.h:47 msgid "Candela per Meter Squared" msgstr "Candela per kvadratmeter" #: ../data/units.xml.in.h:48 msgid "Capacitance" msgstr "Kapasitans" #: ../data/units.xml.in.h:49 msgid "Carat" msgstr "Karat" #: ../data/units.xml.in.h:50 msgid "Catalytic Activity" msgstr "Katalytisk aktivitet" #: ../data/units.xml.in.h:51 msgid "Catalytic Concentration" msgstr "Katalytisk koncentration" #: ../data/units.xml.in.h:52 msgid "Cental" msgstr "" #: ../data/units.xml.in.h:53 msgid "Centiliter" msgstr "Centiliter" #: ../data/units.xml.in.h:54 msgid "Centimeter" msgstr "Centimeter" #: ../data/units.xml.in.h:55 msgid "Chain" msgstr "" #: ../data/units.xml.in.h:56 msgid "Cicero" msgstr "" #: ../data/units.xml.in.h:57 msgid "Cooking" msgstr "Matlagning" #: ../data/units.xml.in.h:58 msgid "Coulomb" msgstr "Coulomb" #: ../data/units.xml.in.h:59 msgid "Coulomb per Cubic Meter" msgstr "Coulomb per kubikmeter" #: ../data/units.xml.in.h:60 msgid "Coulomb per Kilogram" msgstr "Coloumb per kilogram" #: ../data/units.xml.in.h:61 msgid "Coulomb per Meter Squared" msgstr "Coulomb per kvadratmeter" #: ../data/units.xml.in.h:62 msgid "Coulomb per Volt" msgstr "Coloumb per volt" #: ../data/units.xml.in.h:63 msgid "Cubic Inch" msgstr "Kubiktum" #: ../data/units.xml.in.h:64 msgid "Cubic Meter" msgstr "Kubikmeter" #: ../data/units.xml.in.h:65 msgid "Cubic Meter per Kilogram" msgstr "Kubikmeter per kilogram" #: ../data/units.xml.in.h:66 msgid "Cup" msgstr "" #: ../data/units.xml.in.h:67 msgid "Curie" msgstr "" #: ../data/units.xml.in.h:68 msgid "Current Density" msgstr "Strömtäthet" #: ../data/units.xml.in.h:69 msgid "Day" msgstr "Dag" #: ../data/units.xml.in.h:70 msgid "Decibel" msgstr "" #: ../data/units.xml.in.h:71 msgid "Deciliter" msgstr "" #: ../data/units.xml.in.h:72 msgid "Decimeter" msgstr "" #: ../data/units.xml.in.h:73 msgid "Degree" msgstr "Grad" #: ../data/units.xml.in.h:74 msgid "Degree Celcius" msgstr "Grader Celcius" #: ../data/units.xml.in.h:75 msgid "Degrees Fahrenheit" msgstr "Grader Fahrenheit" #: ../data/units.xml.in.h:76 msgid "Degrees Rankine" msgstr "Grader Rankine" #: ../data/units.xml.in.h:78 msgid "Dessertspoon" msgstr "Dessertsked" #: ../data/units.xml.in.h:79 msgid "Didot Point" msgstr "" #: ../data/units.xml.in.h:80 msgid "Dose Equivalent" msgstr "Dosekvivalent" #: ../data/units.xml.in.h:81 msgid "Dram" msgstr "" #: ../data/units.xml.in.h:82 msgid "Dynamic Viscosity" msgstr "Dynamisk viskositet" #: ../data/units.xml.in.h:83 msgid "Dyne" msgstr "" #: ../data/units.xml.in.h:84 msgid "Einstein" msgstr "" #: ../data/units.xml.in.h:85 msgid "Einstein per Meter Squared per Second" msgstr "Einsteins per kvadratmeter per sekund" #: ../data/units.xml.in.h:86 msgid "Electric Charge" msgstr "Elektrisk laddning" #: ../data/units.xml.in.h:87 msgid "Electric Charge Density" msgstr "Laddningstäthet" #: ../data/units.xml.in.h:88 msgid "Electric Conductance" msgstr "Induktion" #: ../data/units.xml.in.h:89 msgid "Electric Current" msgstr "Elektrisk ström" #: ../data/units.xml.in.h:90 msgid "Electric Field Strength" msgstr "Elektrisk fältstyrka" #: ../data/units.xml.in.h:91 msgid "Electric Flux Density" msgstr "Elektrisk flödestäthet" #: ../data/units.xml.in.h:92 msgid "Electric Potential" msgstr "Elektrisk potential" #: ../data/units.xml.in.h:93 msgid "Electric Resistance" msgstr "Resistans" #: ../data/units.xml.in.h:94 msgid "Electricity" msgstr "Elektricitet" #: ../data/units.xml.in.h:95 msgid "Electron Volt" msgstr "Elektronvolt" #: ../data/units.xml.in.h:96 msgid "Energy" msgstr "Energi" #: ../data/units.xml.in.h:97 msgid "Energy Density" msgstr "Energitäthet" #: ../data/units.xml.in.h:98 msgid "Entropy" msgstr "Entropi" #: ../data/units.xml.in.h:99 msgid "Erg" msgstr "" #: ../data/units.xml.in.h:100 msgid "Exposure" msgstr "Exponering" #: ../data/units.xml.in.h:101 msgid "Farad" msgstr "" #: ../data/units.xml.in.h:102 msgid "Farad per Meter" msgstr "Farad per meter" #: ../data/units.xml.in.h:103 msgid "Fathom" msgstr "Famn" #: ../data/units.xml.in.h:104 msgid "Foe" msgstr "" #: ../data/units.xml.in.h:105 msgid "Foot" msgstr "Engelsk Fot" #: ../data/units.xml.in.h:106 msgid "Foot-Candle" msgstr "" #: ../data/units.xml.in.h:107 msgid "Foot-Pound Force" msgstr "" #: ../data/units.xml.in.h:108 msgid "Force" msgstr "Kraft" #: ../data/units.xml.in.h:109 msgid "Fortnight" msgstr "" #: ../data/units.xml.in.h:110 msgid "Fuel Economy" msgstr "Bränsleförbrukning" #: ../data/units.xml.in.h:111 msgid "Furlong" msgstr "" #: ../data/units.xml.in.h:112 msgid "Galileo" msgstr "" #: ../data/units.xml.in.h:113 msgid "Gauss" msgstr "" #: ../data/units.xml.in.h:114 msgid "Gee" msgstr "" #: ../data/units.xml.in.h:115 msgid "Gibibit" msgstr "" #: ../data/units.xml.in.h:116 msgid "Gibibyte" msgstr "" #: ../data/units.xml.in.h:117 msgid "Gigabit" msgstr "" #: ../data/units.xml.in.h:118 msgid "Gigabyte" msgstr "" #: ../data/units.xml.in.h:119 msgid "Gradian (Gon)" msgstr "Gradient (Gon)" #: ../data/units.xml.in.h:120 msgid "Grain" msgstr "" #: ../data/units.xml.in.h:121 msgid "Gram" msgstr "" #: ../data/units.xml.in.h:122 msgid "Gram of TNT" msgstr "Gram TNT" #: ../data/units.xml.in.h:123 msgid "Gram per Cubic Centimeter" msgstr "Gram per kubikcentimeter" #: ../data/units.xml.in.h:124 msgid "Gram per Cubic Decimeter" msgstr "Gram per kubikdecimeter" #: ../data/units.xml.in.h:125 msgid "Gram per Mole" msgstr "Gram per mol" #: ../data/units.xml.in.h:126 msgid "Gray" msgstr "" #: ../data/units.xml.in.h:127 msgid "Gray per Second" msgstr "Gray per sekund" #: ../data/units.xml.in.h:128 msgid "Hand" msgstr "" #: ../data/units.xml.in.h:129 msgid "Hectare" msgstr "Hektar" #: ../data/units.xml.in.h:130 msgid "Hektogram" msgstr "" #: ../data/units.xml.in.h:131 msgid "Henry" msgstr "" #: ../data/units.xml.in.h:132 msgid "Henry per Meter" msgstr "Henry per meter" #: ../data/units.xml.in.h:133 msgid "Hertz" msgstr "" #: ../data/units.xml.in.h:134 msgid "Horse Power" msgstr "Hästkraft" #: ../data/units.xml.in.h:135 msgid "Hour" msgstr "Timme" #: ../data/units.xml.in.h:136 msgid "Illuminance" msgstr "Illuminans" #: ../data/units.xml.in.h:137 msgid "Imperial Bushel" msgstr "" #: ../data/units.xml.in.h:138 msgid "Imperial Capacity" msgstr "" #: ../data/units.xml.in.h:139 msgid "Imperial Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:140 msgid "Imperial Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:141 msgid "Imperial Fluid Scuple" msgstr "" #: ../data/units.xml.in.h:142 msgid "Imperial Gallon" msgstr "" #: ../data/units.xml.in.h:143 msgid "Imperial Gill" msgstr "" #: ../data/units.xml.in.h:144 msgid "Imperial Minim" msgstr "" #: ../data/units.xml.in.h:145 msgid "Imperial Pint" msgstr "" #: ../data/units.xml.in.h:146 msgid "Imperial Quart" msgstr "" #: ../data/units.xml.in.h:147 msgid "Inch" msgstr "Tum" #: ../data/units.xml.in.h:148 msgid "Inch of Mercury" msgstr "Fot kvicksilver" #: ../data/units.xml.in.h:149 msgid "Inductance" msgstr "Induktans" #: ../data/units.xml.in.h:150 msgid "Information" msgstr "" #: ../data/units.xml.in.h:151 msgid "Irradiance" msgstr "Irradians" #: ../data/units.xml.in.h:152 msgid "Joule" msgstr "" #: ../data/units.xml.in.h:153 msgid "Joule per Cubic Meter" msgstr "Joule per kubikmeter" #: ../data/units.xml.in.h:154 msgid "Joule per Kelvin" msgstr "Joule per Kelvin" #: ../data/units.xml.in.h:155 msgid "Joule per Kilogram" msgstr "Joule per kilogram" #: ../data/units.xml.in.h:156 msgid "Joule per Kilogram Kelvin" msgstr "Joule per kilogram kelvin" #: ../data/units.xml.in.h:157 msgid "Joule per Mole" msgstr "Joule per mol" #: ../data/units.xml.in.h:158 msgid "Joule per Mole Kelvin" msgstr "Joule per mol kelvin" #: ../data/units.xml.in.h:159 msgid "Joule per Second" msgstr "Joule per sekund" #: ../data/units.xml.in.h:160 msgid "Julian Year" msgstr "Julianskt år" #: ../data/units.xml.in.h:161 msgid "Katal" msgstr "" #: ../data/units.xml.in.h:162 msgid "Katal per Cubic Meter" msgstr "Katal per kubikmeter" #: ../data/units.xml.in.h:163 msgid "Kelvin" msgstr "" #: ../data/units.xml.in.h:164 msgid "Kibibit" msgstr "" #: ../data/units.xml.in.h:165 msgid "Kibibyte" msgstr "" #: ../data/units.xml.in.h:166 msgid "Kilobit" msgstr "" #: ../data/units.xml.in.h:167 msgid "Kilobyte" msgstr "" #: ../data/units.xml.in.h:168 msgid "Kilogram" msgstr "" #: ../data/units.xml.in.h:169 msgid "Kilogram per Cubic Meter" msgstr "Kilogram per kubikmeter" #: ../data/units.xml.in.h:170 msgid "Kilogram per Kilogram" msgstr "Kilogram per kilogram" #: ../data/units.xml.in.h:171 msgid "Kilometer" msgstr "" #: ../data/units.xml.in.h:172 msgid "Kilometer per Hour" msgstr "Kilometer per timme" #: ../data/units.xml.in.h:173 msgid "Kilometer per Liter" msgstr "Kilometer per liter" #: ../data/units.xml.in.h:174 msgid "Kilopond (Kilogram-Force)" msgstr "" #: ../data/units.xml.in.h:175 msgid "Kilowatt Hour" msgstr "Kilowatttimme" #: ../data/units.xml.in.h:176 msgid "Kinematic Viscosity" msgstr "Kinematisk viskositet" #: ../data/units.xml.in.h:177 msgid "Knot" msgstr "Knop" #: ../data/units.xml.in.h:178 msgid "Light" msgstr "Ljus" #: ../data/units.xml.in.h:179 msgid "Light Year" msgstr "Ljusår" #: ../data/units.xml.in.h:180 msgid "Ligne" msgstr "" #: ../data/units.xml.in.h:181 msgid "Link" msgstr "Länk" #: ../data/units.xml.in.h:182 msgid "Liter" msgstr "" #: ../data/units.xml.in.h:183 msgid "Liter per Kilometer" msgstr "Liter per kilometer" #: ../data/units.xml.in.h:184 msgid "Long Hundredweight" msgstr "" #: ../data/units.xml.in.h:185 msgid "Long Ton" msgstr "" #: ../data/units.xml.in.h:186 msgid "Lumen" msgstr "" #: ../data/units.xml.in.h:187 msgid "Lumen per Foot Squared" msgstr "Lumen per kvadratfor" #: ../data/units.xml.in.h:188 msgid "Lumen per Meter Squared" msgstr "Lumen per kvadratmeter" #: ../data/units.xml.in.h:189 msgid "Luminance" msgstr "Luminans" #: ../data/units.xml.in.h:190 msgid "Luminous Flux" msgstr "Luminansflöde" #: ../data/units.xml.in.h:191 msgid "Luminous Intensity" msgstr "Luminansintensitet" #: ../data/units.xml.in.h:192 msgid "Lux" msgstr "" #: ../data/units.xml.in.h:193 msgid "Magnetic Field Strength" msgstr "Magnetisk fältstyrka" #: ../data/units.xml.in.h:194 msgid "Magnetic Flux" msgstr "Magnetiskt flöde" #: ../data/units.xml.in.h:195 msgid "Magnetic Flux Density" msgstr "Magnetisk flödestäthet" #: ../data/units.xml.in.h:196 msgid "Magnetism" msgstr "Magnetism" #: ../data/units.xml.in.h:197 msgid "Mass Fraction" msgstr "" #: ../data/units.xml.in.h:198 msgid "Maxwell" msgstr "" #: ../data/units.xml.in.h:199 msgid "Mebibit" msgstr "" #: ../data/units.xml.in.h:200 msgid "Mebibyte" msgstr "" #: ../data/units.xml.in.h:201 msgid "Megabit" msgstr "" #: ../data/units.xml.in.h:202 msgid "Megabyte" msgstr "" #: ../data/units.xml.in.h:203 msgid "Meter" msgstr "" #: ../data/units.xml.in.h:204 msgid "Meter Kilogram per Second Squared" msgstr "Meterkilogram per kvadratsekund" #: ../data/units.xml.in.h:205 msgid "Meter per Meter" msgstr "Meter per meter" #: ../data/units.xml.in.h:206 msgid "Meter per Second" msgstr "Meter per sekund" #: ../data/units.xml.in.h:207 msgid "Meter per Second Squared" msgstr "Meter per kvadratsekund" #: ../data/units.xml.in.h:208 msgid "Metric Ton (Tonne)" msgstr "Ton" #: ../data/units.xml.in.h:209 msgid "Microeinstein per Meter Squared per Second" msgstr "Kikroeinstein per kvadratmeter per sekund" #: ../data/units.xml.in.h:210 msgid "Mil (1/1000 in)" msgstr "" #: ../data/units.xml.in.h:211 msgid "Mile" msgstr "" #: ../data/units.xml.in.h:212 msgid "Miles per Gallon" msgstr "" #: ../data/units.xml.in.h:213 msgid "Miles per Hour" msgstr "Miles per timme" #: ../data/units.xml.in.h:214 msgid "Milliliter" msgstr "" #: ../data/units.xml.in.h:215 msgid "Millimeter" msgstr "" #: ../data/units.xml.in.h:216 msgid "Millimeter of Mercury" msgstr "Millimeter kvicksilver" #: ../data/units.xml.in.h:217 msgid "Minute" msgstr "Minut" #: ../data/units.xml.in.h:218 msgid "Molar Energy" msgstr "Molarenergi" #: ../data/units.xml.in.h:219 msgid "Molar Entropy" msgstr "Molarentropi" #: ../data/units.xml.in.h:220 msgid "Mole" msgstr "Mol" #: ../data/units.xml.in.h:221 msgid "Mole per Cubic Meter" msgstr "Mol per kubikmeter" #: ../data/units.xml.in.h:222 msgid "Moment of Force" msgstr "Kraftmoment" #: ../data/units.xml.in.h:223 msgid "Nautical Mile" msgstr "Sjömil" #: ../data/units.xml.in.h:224 msgid "Nautical Mile per Hour" msgstr "Sjömil per timme" #: ../data/units.xml.in.h:225 msgid "Neper" msgstr "" #: ../data/units.xml.in.h:226 msgid "New Didot Point" msgstr "" #: ../data/units.xml.in.h:227 msgid "Newton" msgstr "" #: ../data/units.xml.in.h:228 msgid "Newton Meter" msgstr "Newtonmeter" #: ../data/units.xml.in.h:229 msgid "Newton per Meter" msgstr "Newton per meter" #: ../data/units.xml.in.h:230 msgid "Newton per Meter Squared" msgstr "Newton per kvadratmeter" #: ../data/units.xml.in.h:231 msgid "Nibble" msgstr "" #: ../data/units.xml.in.h:232 msgid "Oersted" msgstr "" #: ../data/units.xml.in.h:233 msgid "Ohm" msgstr "" #: ../data/units.xml.in.h:234 msgid "Ounce" msgstr "" #: ../data/units.xml.in.h:235 msgid "Ounce (troy)" msgstr "" #: ../data/units.xml.in.h:236 msgid "Parsec" msgstr "" #: ../data/units.xml.in.h:237 msgid "Pascal" msgstr "" #: ../data/units.xml.in.h:238 msgid "Pascal Second" msgstr "Pascalsekund" #: ../data/units.xml.in.h:239 msgid "Pennyweight" msgstr "" #: ../data/units.xml.in.h:240 msgid "Permeability" msgstr "Permeabilitet" #: ../data/units.xml.in.h:241 msgid "Permittivity" msgstr "Permitivitet" #: ../data/units.xml.in.h:242 msgid "Pferdestärke" msgstr "" #: ../data/units.xml.in.h:243 msgid "Pfund" msgstr "" #: ../data/units.xml.in.h:244 msgid "Phot" msgstr "" #: ../data/units.xml.in.h:245 msgid "Pied du roi (French Royal Foot)" msgstr "" #: ../data/units.xml.in.h:246 msgid "Plane Angle" msgstr "Planvinkel" #: ../data/units.xml.in.h:247 msgid "Poise" msgstr "" #: ../data/units.xml.in.h:248 msgid "Pond (Gram-Force)" msgstr "" #: ../data/units.xml.in.h:249 msgid "PostScript Pica" msgstr "" #: ../data/units.xml.in.h:250 msgid "PostScript Point" msgstr "" #: ../data/units.xml.in.h:251 msgid "Pouce (French Royal Inch)" msgstr "" #: ../data/units.xml.in.h:252 msgid "Pound" msgstr "Pund" #: ../data/units.xml.in.h:253 msgid "Pound (troy)" msgstr "Pund (troy)" #: ../data/units.xml.in.h:254 msgid "Pound Foot per Second Squared" msgstr "Pundfot per kvadratsekund" #: ../data/units.xml.in.h:255 msgid "Pound-force" msgstr "" #: ../data/units.xml.in.h:256 msgid "Pound-force per Square Inch" msgstr "Pound-force per kvadrattum" #: ../data/units.xml.in.h:257 msgid "Pound-force per Square Inch (psi)" msgstr "Pound-force per kvadrattum (psi)" #: ../data/units.xml.in.h:258 msgid "Poundal" msgstr "" #: ../data/units.xml.in.h:259 msgid "Power" msgstr "Effekt" #: ../data/units.xml.in.h:260 msgid "Pressure" msgstr "Tryck" #: ../data/units.xml.in.h:261 msgid "Rad" msgstr "Rad" #: ../data/units.xml.in.h:262 msgid "Radian" msgstr "Radian" #: ../data/units.xml.in.h:263 msgid "Radiance" msgstr "Radians" #: ../data/units.xml.in.h:264 msgid "Radians per Second" msgstr "Radianter per sekund" #: ../data/units.xml.in.h:265 msgid "Radians per Second Squared" msgstr "Radianter per kvadratsekund" #: ../data/units.xml.in.h:266 msgid "Radiant Intensity" msgstr "Strålningsstyrka" #: ../data/units.xml.in.h:267 msgid "Radioactivity" msgstr "Radioaktivitet" #: ../data/units.xml.in.h:268 msgid "Ratio" msgstr "" #: ../data/units.xml.in.h:269 msgid "Reciprocal Meter" msgstr "Reciproka meter" #: ../data/units.xml.in.h:270 msgid "Reciprocal Seconds Mole" msgstr "Reciproka sekundmol" #: ../data/units.xml.in.h:271 msgid "Rem" msgstr "" #: ../data/units.xml.in.h:272 msgid "Rod (pole/perch)" msgstr "" #: ../data/units.xml.in.h:273 msgid "Roentgen" msgstr "Röntgen" #: ../data/units.xml.in.h:274 msgid "Rood" msgstr "" #: ../data/units.xml.in.h:275 msgid "Second" msgstr "Sekund" #: ../data/units.xml.in.h:276 msgid "Second Ampere" msgstr "Sekundampere" #: ../data/units.xml.in.h:277 msgid "Section" msgstr "" #: ../data/units.xml.in.h:278 msgid "Short Hundredweight" msgstr "" #: ../data/units.xml.in.h:279 msgid "Short Ton" msgstr "" #: ../data/units.xml.in.h:280 msgid "Siemens" msgstr "" #: ../data/units.xml.in.h:281 msgid "Sievert" msgstr "" #: ../data/units.xml.in.h:282 msgid "Solid Angle" msgstr "Rymdvinkel" #: ../data/units.xml.in.h:283 msgid "Specific Energy" msgstr "Specifik energi" #: ../data/units.xml.in.h:284 msgid "Specific Entropy" msgstr "Specifik entropi" #: ../data/units.xml.in.h:285 msgid "Specific Volume" msgstr "Specifik volym" #: ../data/units.xml.in.h:286 msgid "Speed" msgstr "Hastighet" #: ../data/units.xml.in.h:287 msgid "Square Foot" msgstr "Kvadratfot" #: ../data/units.xml.in.h:288 msgid "Square Inch" msgstr "Kvadrattum" #: ../data/units.xml.in.h:289 msgid "Square Kilometer" msgstr "Kvadratkilometer" #: ../data/units.xml.in.h:290 msgid "Square Meter" msgstr "Kvadratmeter" #: ../data/units.xml.in.h:291 msgid "Square Meter per Second" msgstr "Kvadratmeter per sekund" #: ../data/units.xml.in.h:292 msgid "Square Meter per Square Meter" msgstr "Kvadratmeter per kvadratmeter" #: ../data/units.xml.in.h:293 msgid "Square Mile" msgstr "Kvadratmile" #: ../data/units.xml.in.h:294 msgid "Statcoloumb (Franklin)" msgstr "" #: ../data/units.xml.in.h:295 msgid "Statohm" msgstr "" #: ../data/units.xml.in.h:296 msgid "Statvolt" msgstr "" #: ../data/units.xml.in.h:297 msgid "Steradian" msgstr "Steradian" #: ../data/units.xml.in.h:298 msgid "Stilb" msgstr "" #: ../data/units.xml.in.h:299 msgid "Stokes" msgstr "" #: ../data/units.xml.in.h:300 msgid "Stone" msgstr "" #: ../data/units.xml.in.h:301 msgid "Substance" msgstr "Substans" #: ../data/units.xml.in.h:302 msgid "Substance Concentration" msgstr "Substanskoncentration" #: ../data/units.xml.in.h:303 msgid "Surface Tension" msgstr "Ytspänning" #: ../data/units.xml.in.h:304 msgid "Tablespoon" msgstr "" #: ../data/units.xml.in.h:305 msgid "Teaspoon" msgstr "" #: ../data/units.xml.in.h:306 msgid "Temperature" msgstr "Temperatur" #: ../data/units.xml.in.h:307 msgid "Terabit" msgstr "" #: ../data/units.xml.in.h:308 msgid "Terabyte" msgstr "" #: ../data/units.xml.in.h:309 msgid "Tesla" msgstr "" #: ../data/units.xml.in.h:310 msgid "Thermal Conductivity" msgstr "Termisk konduktivitet" #: ../data/units.xml.in.h:312 msgid "Toise" msgstr "" #: ../data/units.xml.in.h:313 msgid "Ton of TNT" msgstr "Ton TNT" #: ../data/units.xml.in.h:314 msgid "Torr" msgstr "" #: ../data/units.xml.in.h:315 msgid "Township" msgstr "" #: ../data/units.xml.in.h:316 msgid "Tribble" msgstr "" #: ../data/units.xml.in.h:317 msgid "Turn" msgstr "" #: ../data/units.xml.in.h:318 msgid "Typography" msgstr "Typografi" #: ../data/units.xml.in.h:319 msgid "U.S. Barrell (oil)" msgstr "" #: ../data/units.xml.in.h:320 msgid "U.S. Bushel" msgstr "" #: ../data/units.xml.in.h:321 msgid "U.S. Capacity" msgstr "" #: ../data/units.xml.in.h:322 msgid "U.S. Dry Pint" msgstr "" #: ../data/units.xml.in.h:323 msgid "U.S. Dry Quart" msgstr "" #: ../data/units.xml.in.h:324 msgid "U.S. Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:325 msgid "U.S. Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:326 msgid "U.S. Gallon" msgstr "" #: ../data/units.xml.in.h:327 msgid "U.S. Gill" msgstr "" #: ../data/units.xml.in.h:328 msgid "U.S. Liquid Pints" msgstr "" #: ../data/units.xml.in.h:329 msgid "U.S. Liquid Quarts" msgstr "" #: ../data/units.xml.in.h:330 msgid "U.S. Minim" msgstr "" #: ../data/units.xml.in.h:331 msgid "U.S. Peck" msgstr "" #: ../data/units.xml.in.h:332 msgid "U.S. Survey Foot" msgstr "" #: ../data/units.xml.in.h:333 msgid "U.S. Survey Inch" msgstr "" #: ../data/units.xml.in.h:334 msgid "U.S. Survey Mile" msgstr "" #: ../data/units.xml.in.h:335 msgid "Volt" msgstr "" #: ../data/units.xml.in.h:336 msgid "Volt Seconds" msgstr "Voltsekund" #: ../data/units.xml.in.h:337 msgid "Volt per Ampere" msgstr "Volt per ampere" #: ../data/units.xml.in.h:338 msgid "Volt per Meter" msgstr "Volt per meter" #: ../data/units.xml.in.h:339 msgid "Volume" msgstr "Volym" #: ../data/units.xml.in.h:340 msgid "Watt" msgstr "" #: ../data/units.xml.in.h:341 msgid "Watt Hour" msgstr "Watttimme" #: ../data/units.xml.in.h:342 msgid "Watt per Ampere" msgstr "Watt per ampere" #: ../data/units.xml.in.h:343 msgid "Watt per Meter Kelvin" msgstr "Watt per meter kelvin" #: ../data/units.xml.in.h:344 msgid "Watt per Meter Squared" msgstr "Watt per kvadratmeter" #: ../data/units.xml.in.h:345 msgid "Watt per Square Meter Steradian" msgstr "Watt per steradiankvadratmeter" #: ../data/units.xml.in.h:346 msgid "Watt per Steradian" msgstr "Watt per steradian" #: ../data/units.xml.in.h:347 msgid "Wave Number" msgstr "Vågtal" #: ../data/units.xml.in.h:348 msgid "Weber" msgstr "" #: ../data/units.xml.in.h:349 msgid "Weber per Ampere" msgstr "Weber per ampere" #: ../data/units.xml.in.h:350 msgid "Weber per Meter Squared" msgstr "Weber per kvadratmeter" #: ../data/units.xml.in.h:351 msgid "Week" msgstr "Vecka" #: ../data/units.xml.in.h:352 msgid "Word (16-bit)" msgstr "" #: ../data/units.xml.in.h:353 msgid "Yard" msgstr "" #: ../data/units.xml.in.h:354 msgid "Zentner" msgstr "" #: ../data/units.xml.in.h:355 msgid "a-cr:gTNT,gramTNT" msgstr "" #: ../data/units.xml.in.h:356 msgid "a-cr:mpg" msgstr "" #: ../data/units.xml.in.h:357 msgid "a-cr:mph" msgstr "" #: ../data/units.xml.in.h:358 msgid "a-cr:psi" msgstr "" #: ../data/units.xml.in.h:359 msgid "a-cr:tTNT,tonTNT" msgstr "" #: ../data/units.xml.in.h:360 msgid "ais:cal_IT,ar:cal,c:calorie,cp:calories" msgstr "ais:cal_IT,a:cal,c:kalori,cp:kalorier" #: ../data/units.xml.in.h:361 msgid "ar:A,ampere,p:amperes" msgstr "a:A,ampere" #: ../data/units.xml.in.h:362 msgid "ar:AU,astronomical_unit,p:astronomical_units" msgstr "a:AU,astronomisk_enhet,p:astronomiska_enheter" #: ../data/units.xml.in.h:363 msgid "ar:B,bel,p:bels" msgstr "a:B,bel" #: ../data/units.xml.in.h:364 msgid "ar:Bq,becquerel,p:becquerels" msgstr "a:Bq,becquerel" #: ../data/units.xml.in.h:365 msgid "ar:Btu" msgstr "" #: ../data/units.xml.in.h:366 msgid "ar:C,coulomb,p:coulombs" msgstr "a:C,coulomb" #: ../data/units.xml.in.h:367 msgid "ar:Ci,curie,p:curies" msgstr "a:Ci,curie" #: ../data/units.xml.in.h:368 msgid "ar:F,farad,p:farads" msgstr "a:F,farad" #: ../data/units.xml.in.h:369 msgid "ar:Gal,galileo,p:galileos" msgstr "a:Gal,galileo" #: ../data/units.xml.in.h:370 msgid "ar:Gy,gray,p:grays" msgstr "a:Gy,gray" #: ../data/units.xml.in.h:371 msgid "ar:H,henry,p:henrys" msgstr "a:H,henry" #: ../data/units.xml.in.h:372 msgid "ar:Hz,hertz" msgstr "" #: ../data/units.xml.in.h:373 msgid "ar:J,joule,p:joules" msgstr "a:J,joule" #: ../data/units.xml.in.h:374 msgid "ar:K,kelvin,p:kelvins" msgstr "a:K,kelvin" #: ../data/units.xml.in.h:375 msgid "ar:L,a:l,liter,p:liters,litre,p:litres" msgstr "a:L,a:l,liter" #: ../data/units.xml.in.h:376 msgid "ar:Mx,maxwell,p:maxwells" msgstr "a:Mx,maxwell" #: ../data/units.xml.in.h:377 msgid "ar:N,newton,p:newtons" msgstr "a:N,newton" #: ../data/units.xml.in.h:378 msgid "ar:Np,neper,p:nepers" msgstr "a:Np,neper" #: ../data/units.xml.in.h:379 msgid "ar:Oe,oersted,p:oersteds" msgstr "a:Oe,oersted" #: ../data/units.xml.in.h:380 msgid "ar:P,poise,p:poises" msgstr "a:P,poise" #: ../data/units.xml.in.h:381 msgid "ar:PS,u:pferdestärke" msgstr "" #: ../data/units.xml.in.h:382 msgid "ar:Pa,pascal,p:pascals" msgstr "a:Pa,pascal" #: ../data/units.xml.in.h:383 msgid "ar:R,roentgen,p:roentgens" msgstr "a:R,roentgen" #: ../data/units.xml.in.h:384 msgid "ar:S,siemens" msgstr "" #: ../data/units.xml.in.h:385 msgid "ar:St,stokes" msgstr "" #: ../data/units.xml.in.h:386 msgid "ar:Sv,sievert,p:sieverts" msgstr "a:Sv,sievert" #: ../data/units.xml.in.h:387 msgid "ar:T,tesla,p:teslas" msgstr "a:T,tesla" #: ../data/units.xml.in.h:388 msgid "ar:UK_bu,imperial_bushel,p:imperial_bushels" msgstr "" #: ../data/units.xml.in.h:389 msgid "ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms" msgstr "" #: ../data/units.xml.in.h:390 msgid "ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces" msgstr "" #: ../data/units.xml.in.h:391 msgid "ar:UK_gal,imperial_gallon,p:imperial_gallons" msgstr "" #: ../data/units.xml.in.h:392 msgid "ar:UK_gi,imperial_gill,p:imperial_gills" msgstr "" #: ../data/units.xml.in.h:393 msgid "ar:UK_pt,imperial_pint,p:imperial_pints" msgstr "" #: ../data/units.xml.in.h:394 msgid "ar:UK_qt,imperial_quart,p:imperial_quarts" msgstr "" #: ../data/units.xml.in.h:395 msgid "ar:US_ft,US_foot,p:US_feet" msgstr "" #: ../data/units.xml.in.h:396 msgid "ar:US_in,US_inch,p:US_inches" msgstr "" #: ../data/units.xml.in.h:397 msgid "ar:US_mi,US_mile,p:US_miles" msgstr "" #: ../data/units.xml.in.h:398 msgid "ar:V,volt,p:volts" msgstr "a:V,volt" #: ../data/units.xml.in.h:399 msgid "ar:W,watt,p:watts" msgstr "a:W,watt" #: ../data/units.xml.in.h:400 msgid "ar:Wb,weber,p:webers" msgstr "a:Wb,weber" #: ../data/units.xml.in.h:401 msgid "ar:a,are,p:ares" msgstr "" #: ../data/units.xml.in.h:402 msgid "ar:atm,atmosphere,p:atmospheres" msgstr "a:atm,atmosfär,p:atmosfärer" #: ../data/units.xml.in.h:403 msgid "ar:b,barn,p:barns" msgstr "" #: ../data/units.xml.in.h:404 msgid "ar:bbl,barrell,p:barrells" msgstr "" #: ../data/units.xml.in.h:405 msgid "ar:bu,bushel,p:bushels" msgstr "" #: ../data/units.xml.in.h:406 msgid "ar:cd,candela,p:candelas" msgstr "a:cd,candela" #: ../data/units.xml.in.h:407 msgid "ar:ch,chain,p:chains" msgstr "" #: ../data/units.xml.in.h:408 msgid "ar:cwt,hundredweight,p:hundredweights" msgstr "" #: ../data/units.xml.in.h:409 msgid "ar:d,day,p:days" msgstr "a:d,dag,p:dagar" #: ../data/units.xml.in.h:410 msgid "ar:deg,au:°,degree,p:degrees" msgstr "a:deg,au:°,grad,p:grader" #: ../data/units.xml.in.h:411 msgid "ar:dr,dram,p:drams" msgstr "" #: ../data/units.xml.in.h:412 msgid "ar:dry_pt,dry_pint,p:dry_pints" msgstr "" #: ../data/units.xml.in.h:413 msgid "ar:dry_qt,dry_quart,p:dry_quarts" msgstr "" #: ../data/units.xml.in.h:414 msgid "ar:dyn,dyne,p:dynes" msgstr "" #: ../data/units.xml.in.h:415 msgid "ar:eV,electron_volt,p:electron_volts" msgstr "a:eV,elektronvolt" #: ../data/units.xml.in.h:416 msgid "ar:fc,footcandle,p:footcandles" msgstr "" #: ../data/units.xml.in.h:417 msgid "ar:fl_dr,fluid_drachm,p:fluid_drachms" msgstr "" #: ../data/units.xml.in.h:418 msgid "ar:fl_oz,fluid_ounce,p:fluid_ounces" msgstr "" #: ../data/units.xml.in.h:419 msgid "ar:ft,foot,p:feet" msgstr "" #: ../data/units.xml.in.h:420 msgid "ar:fur,furlong,p:furlongs" msgstr "" #: ../data/units.xml.in.h:421 msgid "ar:g,gram,p:grams" msgstr "a:g,gram" #: ../data/units.xml.in.h:422 msgid "ar:gal,gallon,p:gallons" msgstr "" #: ../data/units.xml.in.h:423 msgid "ar:gi,gill,p:gills" msgstr "" #: ../data/units.xml.in.h:424 msgid "ar:gr,grain,p:grains" msgstr "" #: ../data/units.xml.in.h:425 msgid "ar:gra,gradian,p:gradians,gon,p:gons" msgstr "" #: ../data/units.xml.in.h:426 msgid "ar:h,hour,p:hours" msgstr "a:h,timme,p:timmar" #: ../data/units.xml.in.h:427 msgid "ar:hp,horsepower,p:horsepowers" msgstr "a:hp,hästkraft,p:hästkrafter" #: ../data/units.xml.in.h:428 msgid "ar:in,inch,p:inches" msgstr "tum,a:in,inch" #: ../data/units.xml.in.h:429 msgid "ar:inHg" msgstr "" #: ../data/units.xml.in.h:430 msgid "ar:kat,katal,p:katals" msgstr "a:kat,katal" #: ../data/units.xml.in.h:431 msgid "ar:l_cwt,long_hundredweight,p:long_hundredweights" msgstr "" #: ../data/units.xml.in.h:432 msgid "ar:l_ton,long_ton,p:long_tons" msgstr "" #: ../data/units.xml.in.h:433 msgid "ar:lb,pound,p:pounds" msgstr "" #: ../data/units.xml.in.h:434 msgid "ar:lb_t,troy_pound,p:troy_pounds" msgstr "" #: ../data/units.xml.in.h:435 msgid "ar:lbf,pound_force" msgstr "" #: ../data/units.xml.in.h:436 msgid "ar:li,link,p:links" msgstr "" #: ../data/units.xml.in.h:437 msgid "ar:liq_pt,liquid_pint,p:liquid_pints" msgstr "" #: ../data/units.xml.in.h:438 msgid "ar:liq_qt,liquid_quart,p:liquid_quarts" msgstr "" #: ../data/units.xml.in.h:439 msgid "ar:lm,lumen,p:lumens" msgstr "a:lm,lumen" #: ../data/units.xml.in.h:440 msgid "ar:lx,lux" msgstr "" #: ../data/units.xml.in.h:441 msgid "ar:ly,lightyear,p:lightyears" msgstr "a:ly,ljusår" #: ../data/units.xml.in.h:442 msgid "ar:m,meter,p:meters,metre,p:metres" msgstr "a:m,meter" #: ../data/units.xml.in.h:443 msgid "ar:mi,mile,p:miles" msgstr "" #: ../data/units.xml.in.h:444 msgid "ar:min,minute,p:minutes" msgstr "a:min,minut,p:minuter" #: ../data/units.xml.in.h:445 msgid "ar:mmHg" msgstr "" #: ../data/units.xml.in.h:446 msgid "ar:mol,mole,p:moles" msgstr "mol" #: ../data/units.xml.in.h:447 msgid "ar:oC,au:°C,r:celcius" msgstr "" #: ../data/units.xml.in.h:448 msgid "ar:oF,au:°F,r:fahrenheit" msgstr "" #: ../data/units.xml.in.h:449 msgid "ar:oR,au:°R,r:rankine" msgstr "" #: ../data/units.xml.in.h:450 msgid "ar:oz,ounce,p:ounces" msgstr "" #: ../data/units.xml.in.h:451 msgid "ar:oz_t,troy_ounce,p:troy_ounces" msgstr "" #: ../data/units.xml.in.h:452 msgid "ar:pc,parsec,p:parsecs" msgstr "a:pc,parsek,p:parseks" #: ../data/units.xml.in.h:453 msgid "ar:ph,phot,p:phots" msgstr "" #: ../data/units.xml.in.h:454 msgid "ar:pk,peck,p:pecks" msgstr "" #: ../data/units.xml.in.h:455 msgid "ar:pt,a:pts,point,p:points" msgstr "punkt,point,p:punkter,p:points" #: ../data/units.xml.in.h:456 msgid "ar:pwt,pennyweight,p:pennyweights" msgstr "" #: ../data/units.xml.in.h:457 msgid "ar:rad,radian,p:radians" msgstr "" #: ../data/units.xml.in.h:458 msgid "ar:rd,rod,p:rods" msgstr "" #: ../data/units.xml.in.h:459 msgid "ar:s,second,p:seconds" msgstr "a:s,sekund,p:sekunder" #: ../data/units.xml.in.h:460 msgid "ar:s_ton,short_ton,p:short_tons" msgstr "" #: ../data/units.xml.in.h:461 msgid "ar:sb,stilb,p:stilbs" msgstr "" #: ../data/units.xml.in.h:462 msgid "ar:sr,steradian,p:steradians" msgstr "" #: ../data/units.xml.in.h:463 msgid "ar:t,tonne,p:tonnes,ton,p:tons" msgstr "a:t,ton" #: ../data/units.xml.in.h:464 msgid "ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units" msgstr "a:u,a:AMU,atomisk_mass_enhet,p:atomiska_mass_enheter" #: ../data/units.xml.in.h:465 msgid "ar:yd,yard,p:yards" msgstr "" #: ../data/units.xml.in.h:466 msgid "ars:cal_fifteen" msgstr "as:cal_femton" #: ../data/units.xml.in.h:467 msgid "ars:cal_mean" msgstr "as:cal_medel" #: ../data/units.xml.in.h:468 msgid "ars:cal_th" msgstr "" #: ../data/units.xml.in.h:469 msgid "aru:Å,u:ångström,angstrom" msgstr "" #: ../data/units.xml.in.h:470 msgid "au:Ω,r:ohm,p:ohms" msgstr "au:Ω,ohm" #: ../data/units.xml.in.h:471 msgid "cr:Calorie,cp:Calories" msgstr "" #: ../data/units.xml.in.h:472 msgid "r:abampere,a:abA,a:aA,p:abamperes" msgstr "" #: ../data/units.xml.in.h:473 msgid "r:abcoulomb,p:abcoulombs,a:abC,a:aC" msgstr "" #: ../data/units.xml.in.h:474 msgid "r:abohm,p:abohms,au:abΩ" msgstr "" #: ../data/units.xml.in.h:475 msgid "r:abvolt,p:abvolts,a:abV" msgstr "" #: ../data/units.xml.in.h:476 msgid "r:acre,p:acres" msgstr "" #: ../data/units.xml.in.h:477 msgid "r:arcminute,p:arcminutes" msgstr "" #: ../data/units.xml.in.h:478 msgid "r:arcsecond,p:arcseconds" msgstr "" #: ../data/units.xml.in.h:479 msgid "r:ata_pica,p:ata_picas" msgstr "" #: ../data/units.xml.in.h:480 msgid "r:ata_point,a:ata_pt,p:ata_points" msgstr "" #: ../data/units.xml.in.h:481 msgid "r:bar,p:bars" msgstr "" #: ../data/units.xml.in.h:482 msgid "r:bit,p:bits" msgstr "bit,p:bitar" #: ../data/units.xml.in.h:483 msgid "r:byte,p:bytes,octet,p:octets" msgstr "byte,oktet" #: ../data/units.xml.in.h:484 msgid "r:carat,p:carats" msgstr "karat" #: ../data/units.xml.in.h:485 msgid "r:cental,p:centals" msgstr "" #: ../data/units.xml.in.h:486 msgid "r:cicero" msgstr "" #: ../data/units.xml.in.h:487 msgid "r:cup,p:cups" msgstr "kopp,p:koppar" #: ../data/units.xml.in.h:488 msgid "r:dessertspoon,p:dessertspoons" msgstr "dessertsked,p:dessertskedar" #: ../data/units.xml.in.h:489 msgid "r:didot,a:dd" msgstr "" #: ../data/units.xml.in.h:490 msgid "r:einstein,p:einsteins" msgstr "einstein" #: ../data/units.xml.in.h:491 msgid "r:erg,p:ergs" msgstr "" #: ../data/units.xml.in.h:492 msgid "r:fathom,p:fathoms" msgstr "" #: ../data/units.xml.in.h:493 msgid "r:foe,p:foes" msgstr "" #: ../data/units.xml.in.h:494 msgid "r:fortnight,p:fortnights" msgstr "" #: ../data/units.xml.in.h:495 msgid "r:gauss" msgstr "" #: ../data/units.xml.in.h:496 msgid "r:gee,p:gees" msgstr "" #: ../data/units.xml.in.h:497 msgid "r:hand,p:hands" msgstr "" #: ../data/units.xml.in.h:498 msgid "r:imperial_fluid_scuple,p:imperial_fluid_scuples" msgstr "" #: ../data/units.xml.in.h:499 msgid "r:imperial_minim,p:imperial_minims" msgstr "" #: ../data/units.xml.in.h:500 msgid "r:knot,p:knots" msgstr "knop" #: ../data/units.xml.in.h:501 msgid "r:ligne" msgstr "" #: ../data/units.xml.in.h:502 msgid "r:mil,p:mils" msgstr "" #: ../data/units.xml.in.h:503 msgid "r:minim,p:minims" msgstr "" #: ../data/units.xml.in.h:504 msgid "r:nautical_mile,p:nautical_miles" msgstr "sjömil" #: ../data/units.xml.in.h:505 msgid "r:new_didot" msgstr "" #: ../data/units.xml.in.h:506 msgid "r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets" msgstr "" #: ../data/units.xml.in.h:507 msgid "r:pfund" msgstr "" #: ../data/units.xml.in.h:508 msgid "r:pica,p:picas" msgstr "" #: ../data/units.xml.in.h:509 msgid "r:pied_du_roi" msgstr "" #: ../data/units.xml.in.h:510 msgid "r:pond,p:ponds,a:gf" msgstr "" #: ../data/units.xml.in.h:511 msgid "r:pouce" msgstr "" #: ../data/units.xml.in.h:512 msgid "r:poundal,p:poundals,a:pdl" msgstr "" #: ../data/units.xml.in.h:513 msgid "r:rad_radioactivity" msgstr "rad_radioaktivitet" #: ../data/units.xml.in.h:514 msgid "r:rem_radioactivity" msgstr "rem_radioaktivitet" #: ../data/units.xml.in.h:515 msgid "r:rood,p:roods" msgstr "" #: ../data/units.xml.in.h:516 msgid "r:section,p:sections" msgstr "" #: ../data/units.xml.in.h:517 msgid "r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins" msgstr "" #: ../data/units.xml.in.h:518 msgid "r:statohm,p:statohms,au:statΩ" msgstr "" #: ../data/units.xml.in.h:519 msgid "r:statvolt,p:statvolts,a:statV" msgstr "" #: ../data/units.xml.in.h:520 msgid "r:stone,p:stones" msgstr "" #: ../data/units.xml.in.h:521 msgid "r:tablespoon,p:tablespoons" msgstr "matsked,p:matskedar" #: ../data/units.xml.in.h:522 msgid "r:teaspoon,p:teaspoons" msgstr "tesked,p:teskedar" #: ../data/units.xml.in.h:523 msgid "r:toise" msgstr "" #: ../data/units.xml.in.h:524 msgid "r:torr,p:torrs" msgstr "" #: ../data/units.xml.in.h:525 msgid "r:township,p:townships" msgstr "" #: ../data/units.xml.in.h:526 msgid "r:tribble,p:tribbles" msgstr "" #: ../data/units.xml.in.h:527 msgid "r:turn,p:turns" msgstr "" #: ../data/units.xml.in.h:528 msgid "r:week,p:weeks" msgstr "vecka,p:veckor" #: ../data/units.xml.in.h:529 msgid "r:word,p:words" msgstr "" #: ../data/units.xml.in.h:530 msgid "r:year,p:years" msgstr "år" #: ../data/units.xml.in.h:531 msgid "r:zentner" msgstr "" #: ../data/variables.xml.in.h:1 msgid "-r:billion" msgstr "miljard,p:miljarder" #: ../data/variables.xml.in.h:2 msgid "-r:centillion" msgstr "" #: ../data/variables.xml.in.h:3 msgid "-r:decillion" msgstr "kvintiljard,p:kvintiljarder" #: ../data/variables.xml.in.h:4 msgid "-r:duodecillion" msgstr "sextiljard,p:sextiljarder" #: ../data/variables.xml.in.h:5 msgid "-r:hundred" msgstr "hundra" #: ../data/variables.xml.in.h:6 msgid "-r:million" msgstr "miljon,p:miljoner" #: ../data/variables.xml.in.h:7 msgid "-r:nonillion" msgstr "kvintiljon,p:kvintiljoner" #: ../data/variables.xml.in.h:8 msgid "-r:novemdecillion" msgstr "deciljon,p:deciljoner" #: ../data/variables.xml.in.h:9 msgid "-r:octillion" msgstr "kvadriljard,p:kvadriljarder" #: ../data/variables.xml.in.h:10 msgid "-r:octodecillion" msgstr "noniljard,p:noniljarder" #: ../data/variables.xml.in.h:11 msgid "-r:quadrillion" msgstr "biljard,p:biljarder" #: ../data/variables.xml.in.h:12 msgid "-r:quattuordecillion" msgstr "septiljard,p:septiljarder" #: ../data/variables.xml.in.h:13 msgid "-r:quindecillion" msgstr "oktiljon,p:oktiljoner" #: ../data/variables.xml.in.h:14 msgid "-r:quintillion" msgstr "triljon,p:triljoner" #: ../data/variables.xml.in.h:15 msgid "-r:septendecillion" msgstr "noniljon,p:noniljoner" #: ../data/variables.xml.in.h:16 msgid "-r:septillion" msgstr "kvadriljon,p:kvadriljoner" #: ../data/variables.xml.in.h:17 msgid "-r:sexdecillion" msgstr "oktiljard,p:oktiljarder" #: ../data/variables.xml.in.h:18 msgid "-r:sextillion" msgstr "triljard,p:triljarder" #: ../data/variables.xml.in.h:19 msgid "-r:thousand" msgstr "tusen" #: ../data/variables.xml.in.h:20 msgid "-r:tredecillion" msgstr "septiljon,p:septiljoner" #: ../data/variables.xml.in.h:21 msgid "-r:trillion" msgstr "biljon,p:biljoner" #: ../data/variables.xml.in.h:22 msgid "-r:undecillion" msgstr "sextiljon,p:sextiljoner" #: ../data/variables.xml.in.h:23 msgid "-r:vigintillion" msgstr "deciljard,p:deciljarder" #: ../data/variables.xml.in.h:24 msgid "Alpha Particle Mass" msgstr "Alfapartikelmassa" #: ../data/variables.xml.in.h:25 msgid "Apery's Constant" msgstr "Aperys konstant" #: ../data/variables.xml.in.h:26 msgid "Archimede's Constant (pi)" msgstr "Archimedes konstant (pi)" #: ../data/variables.xml.in.h:27 msgid "Atomic Mass Constant" msgstr "Atommassenhet" #: ../data/variables.xml.in.h:28 msgid "Atomic and Nuclear Constants" msgstr "Atomära och nukleära konstanter" #: ../data/variables.xml.in.h:29 msgid "Avogadro Constant" msgstr "Avogadros konstant" #: ../data/variables.xml.in.h:30 msgid "Base of Natural Logarithms (e)" msgstr "Basen för naturliga logaritmer (e)" #: ../data/variables.xml.in.h:31 msgid "Basic Constants" msgstr "Grundläggande konstanter" #: ../data/variables.xml.in.h:32 msgid "Billion" msgstr "Miljard" #: ../data/variables.xml.in.h:33 msgid "Bohr Radius" msgstr "Bohr-radie" #: ../data/variables.xml.in.h:34 msgid "Boltzmann Constant" msgstr "Boltzmanns konstant" #: ../data/variables.xml.in.h:35 msgid "Borh Magneton" msgstr "Bohrs magneton" #: ../data/variables.xml.in.h:36 msgid "Catalan's Constant" msgstr "Catalans konstant" #: ../data/variables.xml.in.h:37 msgid "Centillion" msgstr "" #: ../data/variables.xml.in.h:38 msgid "Characteristic Impedance of Vacuum" msgstr "Karaktäristisk impedans för vakuum" #: ../data/variables.xml.in.h:39 msgid "Classical Electron Radius" msgstr "Klassisk elektron-radie" #: ../data/variables.xml.in.h:40 msgid "Compton Wavelength" msgstr "Compton-våglängd" #: ../data/variables.xml.in.h:41 msgid "Conductance Quantum" msgstr "Konduktanskvantum" #: ../data/variables.xml.in.h:42 msgid "Decillion" msgstr "Kvintiljard" #: ../data/variables.xml.in.h:43 msgid "Duodecillion" msgstr "Sextiljard" #: ../data/variables.xml.in.h:44 msgid "Electric Constant (Permittivity of Free Space)" msgstr "Elektriska konstanten" #: ../data/variables.xml.in.h:45 msgid "Electromagnetic Constants" msgstr "Elektromagnetiska konstanter" #: ../data/variables.xml.in.h:46 msgid "Electron Mass" msgstr "Elektronmassa" #: ../data/variables.xml.in.h:47 msgid "Elementary Charge" msgstr "Elementarladdning" #: ../data/variables.xml.in.h:48 msgid "Euler's Constant" msgstr "Eulers konstant" #: ../data/variables.xml.in.h:49 msgid "False" msgstr "Falskt" #: ../data/variables.xml.in.h:50 msgid "Faraday Constant" msgstr "Faradays konstant" #: ../data/variables.xml.in.h:51 msgid "First Radiation Constant" msgstr "Första strålningskonstanten" #: ../data/variables.xml.in.h:52 msgid "Golden Ratio" msgstr "Golden ratio" #: ../data/variables.xml.in.h:53 msgid "Googol" msgstr "" #: ../data/variables.xml.in.h:54 msgid "Googolplex" msgstr "" #: ../data/variables.xml.in.h:55 msgid "Helion Mass" msgstr "Helion-massa" #: ../data/variables.xml.in.h:56 msgid "Hundred" msgstr "Hundra" #: ../data/variables.xml.in.h:57 msgid "Ideal Gas Constant" msgstr "Gaskonstant" #: ../data/variables.xml.in.h:58 msgid "Imaginary i (sqrt -1)" msgstr "Imaginärt i (sqrt -1)" #: ../data/variables.xml.in.h:59 msgid "Infinity" msgstr "Oändlighet" #: ../data/variables.xml.in.h:60 msgid "Josephson Constant" msgstr "Josephsons konstant" #: ../data/variables.xml.in.h:61 msgid "Large Numbers" msgstr "Stora tal" #: ../data/variables.xml.in.h:62 msgid "Magnetic Constant (Permeability of Free Space)" msgstr "Magnetiska konstanten" #: ../data/variables.xml.in.h:63 msgid "Magnetic Flux Quantum" msgstr "Magnetflödeskonstanten" #: ../data/variables.xml.in.h:64 msgid "Million" msgstr "Miljon" #: ../data/variables.xml.in.h:65 msgid "Negative Infinity" msgstr "Negativ oändlighet" #: ../data/variables.xml.in.h:66 msgid "Neutron Mass" msgstr "Neutronmassa" #: ../data/variables.xml.in.h:67 msgid "Newtonian Constant of Gravitation" msgstr "Newtonska gravitationskonstanten" #: ../data/variables.xml.in.h:68 msgid "Nonillion" msgstr "Kvintiljon" #: ../data/variables.xml.in.h:69 msgid "Novemdecillion" msgstr "Deciljon" #: ../data/variables.xml.in.h:70 msgid "Nuclear Magneton" msgstr "Kärnmagneton" #: ../data/variables.xml.in.h:71 msgid "Octillion" msgstr "Kvadriljard" #: ../data/variables.xml.in.h:72 msgid "Octodecillion" msgstr "Noniljard" #: ../data/variables.xml.in.h:73 msgid "Omega Constant" msgstr "Omegakonstanten" #: ../data/variables.xml.in.h:74 msgid "Per Mille" msgstr "Promille" #: ../data/variables.xml.in.h:75 msgid "Per Myriad" msgstr "" #: ../data/variables.xml.in.h:76 msgid "Physical Constants" msgstr "Fysiska konstanter" #: ../data/variables.xml.in.h:77 msgid "Physico-Chemical Constants" msgstr "Fysikalisk-kemiska konstanter" #: ../data/variables.xml.in.h:78 msgid "Planck Constant" msgstr "Plancks konstant" #: ../data/variables.xml.in.h:79 msgid "Planck Constant over 2 pi" msgstr "Plancks konstant över 2 pi" #: ../data/variables.xml.in.h:80 msgid "Planck Length" msgstr "Planck-längd" #: ../data/variables.xml.in.h:81 msgid "Planck Mass" msgstr "Planck-massa" #: ../data/variables.xml.in.h:82 msgid "Planck Temperature" msgstr "Planck-temperatur" #: ../data/variables.xml.in.h:83 msgid "Planck Time" msgstr "Planck-tid" #: ../data/variables.xml.in.h:84 msgid "Positive Infinity" msgstr "Positiv oändlighet" #: ../data/variables.xml.in.h:85 msgid "Procent" msgstr "" #: ../data/variables.xml.in.h:86 msgid "Proton Mass" msgstr "Protonmassa" #: ../data/variables.xml.in.h:87 msgid "Pythagora's Constant (sqrt 2)" msgstr "Pythagoras konstant (sqrt 2)" #: ../data/variables.xml.in.h:88 msgid "Quadrillion" msgstr "Biljard" #: ../data/variables.xml.in.h:89 msgid "Quattuordecillion" msgstr "Septiljard" #: ../data/variables.xml.in.h:90 msgid "Quindecillion" msgstr "Oktiljon" #: ../data/variables.xml.in.h:91 msgid "Quintillion" msgstr "Triljon" #: ../data/variables.xml.in.h:92 msgid "Rydberg Constant" msgstr "Rydbergs konstant" #: ../data/variables.xml.in.h:93 msgid "Second Radiation Constant" msgstr "Andra strålningskonstanten" #: ../data/variables.xml.in.h:94 msgid "Septendecillion" msgstr "Noniljon" #: ../data/variables.xml.in.h:95 msgid "Septillion" msgstr "Kvadriljon" #: ../data/variables.xml.in.h:96 msgid "Sexdecillion" msgstr "Oktiljard" #: ../data/variables.xml.in.h:97 msgid "Sextillion" msgstr "Triljard" #: ../data/variables.xml.in.h:98 msgid "Small Numbers" msgstr "Små tal" #: ../data/variables.xml.in.h:99 msgid "Special Numbers" msgstr "Speciella nummer" #: ../data/variables.xml.in.h:100 msgid "Speed of Light in Vacuum" msgstr "Ljusets hastighet i vakuum" #: ../data/variables.xml.in.h:101 msgid "Tau Mass" msgstr "Tau-massa" #: ../data/variables.xml.in.h:102 msgid "Thousand" msgstr "Tusen" #: ../data/variables.xml.in.h:103 msgid "Tredecillion" msgstr "Septiljon" #: ../data/variables.xml.in.h:104 msgid "Trillion" msgstr "Biljon" #: ../data/variables.xml.in.h:105 msgid "True" msgstr "Sant" #: ../data/variables.xml.in.h:106 msgid "Undecillion" msgstr "Sextiljon" #: ../data/variables.xml.in.h:107 msgid "Undefined" msgstr "Odefinierad" #: ../data/variables.xml.in.h:108 msgid "Universal Constants" msgstr "Universala konstanter" #: ../data/variables.xml.in.h:109 msgid "Unknowns" msgstr "Okända" #: ../data/variables.xml.in.h:110 msgid "Vigintillion" msgstr "Deciljard" #: ../data/variables.xml.in.h:112 #, no-c-format msgid "a:%,r:procent" msgstr "" #: ../data/variables.xml.in.h:113 msgid "ar:c,speed_of_light" msgstr "a:c,ljusets_hastighet" #: ../data/variables.xml.in.h:114 msgid "au:γ,r:euler" msgstr "" #: ../data/variables.xml.in.h:115 msgid "au:π,r:pi" msgstr "" #: ../data/variables.xml.in.h:116 msgid "r:alpha_particle_mass,aisu:m_α" msgstr "" #: ../data/variables.xml.in.h:117 msgid "r:apery" msgstr "" #: ../data/variables.xml.in.h:118 msgid "r:atomic_mass,ais:m_u" msgstr "atommassa,ais:m_u" #: ../data/variables.xml.in.h:119 msgid "r:avogadro,ais:N_A" msgstr "" #: ../data/variables.xml.in.h:120 msgid "r:bohr_magneton,aisu:μ_B" msgstr "" #: ../data/variables.xml.in.h:121 msgid "r:bohr_radius,ais:a_o" msgstr "" #: ../data/variables.xml.in.h:122 msgid "r:boltzmann" msgstr "" #: ../data/variables.xml.in.h:123 msgid "r:catalan" msgstr "" #: ../data/variables.xml.in.h:124 msgid "r:characteristic_impedance,ais:Z_0" msgstr "" #: ../data/variables.xml.in.h:125 msgid "r:classical_electron_radius,ais:r_e" msgstr "" #: ../data/variables.xml.in.h:126 msgid "r:compton_wavelength,aisu:λ_C" msgstr "" #: ../data/variables.xml.in.h:127 msgid "r:conductance_quantum,ais:G_0" msgstr "" #: ../data/variables.xml.in.h:128 msgid "r:e" msgstr "" #: ../data/variables.xml.in.h:129 msgid "r:electric_constant,aisu:ε_0" msgstr "" #: ../data/variables.xml.in.h:130 msgid "r:electron_mass,ais:m_e" msgstr "" #: ../data/variables.xml.in.h:131 msgid "r:elementary_charge,ais:e_charge" msgstr "" #: ../data/variables.xml.in.h:132 msgid "r:false,r:no" msgstr "falskt,nej" #: ../data/variables.xml.in.h:133 msgid "r:faraday" msgstr "" #: ../data/variables.xml.in.h:134 msgid "r:first_radiation,ais:c_1" msgstr "" #: ../data/variables.xml.in.h:135 msgid "r:golden,au:φ" msgstr "" #: ../data/variables.xml.in.h:136 msgid "r:googol" msgstr "" #: ../data/variables.xml.in.h:137 msgid "r:googolplex" msgstr "" #: ../data/variables.xml.in.h:138 msgid "r:helion_mass,ais:m_h" msgstr "" #: ../data/variables.xml.in.h:139 msgid "r:i" msgstr "" #: ../data/variables.xml.in.h:140 msgid "r:ideal_gas" msgstr "" #: ../data/variables.xml.in.h:141 msgid "r:infinity" msgstr "oändlighet" #: ../data/variables.xml.in.h:142 msgid "r:josephson,ais:K_J" msgstr "" #: ../data/variables.xml.in.h:143 msgid "r:klitzing,ais:R_K" msgstr "" #: ../data/variables.xml.in.h:144 msgid "r:magnetic_constant,aisu:μ_0" msgstr "" #: ../data/variables.xml.in.h:145 msgid "r:magnetic_flux_quantum,aisu:Φ_0" msgstr "" #: ../data/variables.xml.in.h:146 msgid "r:minus_infinity" msgstr "minus_oändlighet" #: ../data/variables.xml.in.h:147 msgid "r:neutron_mass,ais:m_n" msgstr "" #: ../data/variables.xml.in.h:148 msgid "r:newtonian_constant,a:G" msgstr "" #: ../data/variables.xml.in.h:149 msgid "r:nuclear_magneton,aisu:μ_N" msgstr "" #: ../data/variables.xml.in.h:150 msgid "r:omega" msgstr "" #: ../data/variables.xml.in.h:151 msgid "r:permille,au:‰" msgstr "" #: ../data/variables.xml.in.h:152 msgid "r:permyriad,au:‱" msgstr "" #: ../data/variables.xml.in.h:153 msgid "r:planck" msgstr "" #: ../data/variables.xml.in.h:154 msgid "r:planck2pi" msgstr "" #: ../data/variables.xml.in.h:155 msgid "r:planck_length,ais:l_P" msgstr "" #: ../data/variables.xml.in.h:156 msgid "r:planck_mass,ais:m_P" msgstr "" #: ../data/variables.xml.in.h:157 msgid "r:planck_temperature,ais:T_P" msgstr "" #: ../data/variables.xml.in.h:158 msgid "r:planck_time,ais:t_P" msgstr "" #: ../data/variables.xml.in.h:159 msgid "r:plus_infinity" msgstr "plus_oändlighet" #: ../data/variables.xml.in.h:160 msgid "r:proton_mass,ais:m_p" msgstr "" #: ../data/variables.xml.in.h:161 msgid "r:pythagoras" msgstr "" #: ../data/variables.xml.in.h:162 msgid "r:rydberg,aisu:R_∞" msgstr "" #: ../data/variables.xml.in.h:163 msgid "r:second_radiation,ais:c_2" msgstr "" #: ../data/variables.xml.in.h:164 msgid "r:tau_mass,aisu:m_τ" msgstr "" #: ../data/variables.xml.in.h:165 msgid "r:true,r:yes" msgstr "sant,ja" #: ../data/variables.xml.in.h:166 msgid "r:undefined" msgstr "odefinierad" #: ../data/variables.xml.in.h:167 msgid "r:x" msgstr "" #: ../data/variables.xml.in.h:168 msgid "r:y" msgstr "" #: ../data/variables.xml.in.h:169 msgid "r:z" msgstr "" #: ../data/variables.xml.in.h:170 msgid "von Klitzing Constant" msgstr "" #~ msgid "Calculates the area of a circle using the diameter" #~ msgstr "Beräknar omkretsen för en cirkel." #~ msgid "Diameter" #~ msgstr "Diameter" libqalculate-0.9.7/po-defs/Makefile.in0000644000175100017510000002501711320655032014520 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ # # po-defs/Makefile.am for qalculate # VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = po-defs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_CPPFLAGS = @CLN_CPPFLAGS@ CLN_LIBS = @CLN_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@ INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@ INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@ INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@ INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@ INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@ INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@ INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@ INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@ INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@ INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@ INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@ INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NMEDIT = @NMEDIT@ 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@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ POTFILES.in *.po all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 po-defs/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu po-defs/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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 dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .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-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am 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 # 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: libqalculate-0.9.7/Makefile.am0000644000175100017510000000053411305546371013157 00000000000000## Process this file with automake to produce Makefile.in SUBDIRS = libqalculate src data po po-defs docs EXTRA_DIST = \ autogen.sh \ TODO \ README.translate \ intltool-extract.in \ intltool-merge.in \ intltool-update.in \ omf.make \ xmldocs.make \ libqalculate.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libqalculate.pc libqalculate-0.9.7/COPYING0000644000175100017510000004311011305546371012153 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the 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 Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. libqalculate-0.9.7/intltool-update.in0000644000175100017510000007442611320655025014604 00000000000000#!@INTLTOOL_PERL@ -w # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*- # # The Intltool Message Updater # # Copyright (C) 2000-2003 Free Software Foundation. # # Intltool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # version 2 published by the Free Software Foundation. # # Intltool 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., 675 Mass Ave, Cambridge, MA 02139, 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. # # Authors: Kenneth Christiansen # Maciej Stachowiak # Darin Adler ## Release information my $PROGRAM = "intltool-update"; my $VERSION = "0.37.1"; my $PACKAGE = "intltool"; ## Loaded modules use strict; use Getopt::Long; use Cwd; use File::Copy; use File::Find; ## Scalars used by the option stuff my $HELP_ARG = 0; my $VERSION_ARG = 0; my $DIST_ARG = 0; my $POT_ARG = 0; my $HEADERS_ARG = 0; my $MAINTAIN_ARG = 0; my $REPORT_ARG = 0; my $VERBOSE = 0; my $GETTEXT_PACKAGE = ""; my $OUTPUT_FILE = ""; my @languages; my %varhash = (); my %po_files_by_lang = (); # Regular expressions to categorize file types. # FIXME: Please check if the following is correct my $xml_support = "xml(?:\\.in)*|". # http://www.w3.org/XML/ (Note: .in is not required) "ui|". # Bonobo specific - User Interface desc. files "lang|". # ? "glade2?(?:\\.in)*|". # Glade specific - User Interface desc. files (Note: .in is not required) "scm(?:\\.in)*|". # ? (Note: .in is not required) "oaf(?:\\.in)+|". # DEPRECATED: Replaces by Bonobo .server files "etspec|". # ? "server(?:\\.in)+|". # Bonobo specific "sheet(?:\\.in)+|". # ? "schemas(?:\\.in)+|". # GConf specific "pong(?:\\.in)+|". # DEPRECATED: PONG is not used [by GNOME] any longer. "kbd(?:\\.in)+|". # GOK specific. "policy(?:\\.in)+"; # PolicyKit files my $ini_support = "icon(?:\\.in)+|". # http://www.freedesktop.org/Standards/icon-theme-spec "desktop(?:\\.in)+|". # http://www.freedesktop.org/Standards/menu-spec "caves(?:\\.in)+|". # GNOME Games specific "directory(?:\\.in)+|". # http://www.freedesktop.org/Standards/menu-spec "soundlist(?:\\.in)+|". # GNOME specific "keys(?:\\.in)+|". # GNOME Mime database specific "theme(?:\\.in)+|". # http://www.freedesktop.org/Standards/icon-theme-spec "service(?:\\.in)+"; # DBus specific my $buildin_gettext_support = "c|y|cs|cc|cpp|c\\+\\+|h|hh|gob|py"; ## Always flush buffer when printing $| = 1; ## Sometimes the source tree will be rooted somewhere else. my $SRCDIR = $ENV{"srcdir"} || "."; my $POTFILES_in; $POTFILES_in = "<$SRCDIR/POTFILES.in"; my $devnull = ($^O eq 'MSWin32' ? 'NUL:' : '/dev/null'); ## Handle options GetOptions ( "help" => \$HELP_ARG, "version" => \$VERSION_ARG, "dist|d" => \$DIST_ARG, "pot|p" => \$POT_ARG, "headers|s" => \$HEADERS_ARG, "maintain|m" => \$MAINTAIN_ARG, "report|r" => \$REPORT_ARG, "verbose|x" => \$VERBOSE, "gettext-package|g=s" => \$GETTEXT_PACKAGE, "output-file|o=s" => \$OUTPUT_FILE, ) or &Console_WriteError_InvalidOption; &Console_Write_IntltoolHelp if $HELP_ARG; &Console_Write_IntltoolVersion if $VERSION_ARG; my $arg_count = ($DIST_ARG > 0) + ($POT_ARG > 0) + ($HEADERS_ARG > 0) + ($MAINTAIN_ARG > 0) + ($REPORT_ARG > 0); &Console_Write_IntltoolHelp if $arg_count > 1; my $PKGNAME = FindPackageName (); # --version and --help don't require a module name my $MODULE = $GETTEXT_PACKAGE || $PKGNAME || "unknown"; if ($POT_ARG) { &GenerateHeaders; &GeneratePOTemplate; } elsif ($HEADERS_ARG) { &GenerateHeaders; } elsif ($MAINTAIN_ARG) { &FindLeftoutFiles; } elsif ($REPORT_ARG) { &GenerateHeaders; &GeneratePOTemplate; &Console_Write_CoverageReport; } elsif ((defined $ARGV[0]) && $ARGV[0] =~ /^[a-z]/) { my $lang = $ARGV[0]; ## Report error if the language file supplied ## to the command line is non-existent &Console_WriteError_NotExisting("$SRCDIR/$lang.po") if ! -s "$SRCDIR/$lang.po"; if (!$DIST_ARG) { print "Working, please wait..." if $VERBOSE; &GenerateHeaders; &GeneratePOTemplate; } &POFile_Update ($lang, $OUTPUT_FILE); &Console_Write_TranslationStatus ($lang, $OUTPUT_FILE); } else { &Console_Write_IntltoolHelp; } exit; ######### sub Console_Write_IntltoolVersion { print <<_EOF_; ${PROGRAM} (${PACKAGE}) $VERSION Written by Kenneth Christiansen, Maciej Stachowiak, and Darin Adler. Copyright (C) 2000-2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. _EOF_ exit; } sub Console_Write_IntltoolHelp { print <<_EOF_; Usage: ${PROGRAM} [OPTION]... LANGCODE Updates PO template files and merge them with the translations. Mode of operation (only one is allowed): -p, --pot generate the PO template only -s, --headers generate the header files in POTFILES.in -m, --maintain search for left out files from POTFILES.in -r, --report display a status report for the module -d, --dist merge LANGCODE.po with existing PO template Extra options: -g, --gettext-package=NAME override PO template name, useful with --pot -o, --output-file=FILE write merged translation to FILE -x, --verbose display lots of feedback --help display this help and exit --version output version information and exit Examples of use: ${PROGRAM} --pot just create a new PO template ${PROGRAM} xy create new PO template and merge xy.po with it Report bugs to http://bugzilla.gnome.org/ (product name "$PACKAGE") or send email to . _EOF_ exit; } sub echo_n { my $str = shift; my $ret = `echo "$str"`; $ret =~ s/\n$//; # do we need the "s" flag? return $ret; } sub POFile_DetermineType ($) { my $type = $_; my $gettext_type; my $xml_regex = "(?:" . $xml_support . ")"; my $ini_regex = "(?:" . $ini_support . ")"; my $buildin_regex = "(?:" . $buildin_gettext_support . ")"; if ($type =~ /\[type: gettext\/([^\]].*)]/) { $gettext_type=$1; } elsif ($type =~ /schemas(\.in)+$/) { $gettext_type="schemas"; } elsif ($type =~ /glade2?(\.in)*$/) { $gettext_type="glade"; } elsif ($type =~ /scm(\.in)*$/) { $gettext_type="scheme"; } elsif ($type =~ /keys(\.in)+$/) { $gettext_type="keys"; } # bucket types elsif ($type =~ /$xml_regex$/) { $gettext_type="xml"; } elsif ($type =~ /$ini_regex$/) { $gettext_type="ini"; } elsif ($type =~ /$buildin_regex$/) { $gettext_type="buildin"; } else { $gettext_type="unknown"; } return "gettext\/$gettext_type"; } sub TextFile_DetermineEncoding ($) { my $gettext_code="ASCII"; # All files are ASCII by default my $filetype=`file $_ | cut -d ' ' -f 2`; if ($? eq "0") { if ($filetype =~ /^(ISO|UTF)/) { chomp ($gettext_code = $filetype); } elsif ($filetype =~ /^XML/) { $gettext_code="UTF-8"; # We asume that .glade and other .xml files are UTF-8 } } return $gettext_code; } sub isNotValidMissing { my ($file) = @_; return if $file =~ /^\{arch\}\/.*$/; return if $file =~ /^$varhash{"PACKAGE"}-$varhash{"VERSION"}\/.*$/; } sub FindLeftoutFiles { my (@buf_i18n_plain, @buf_i18n_xml, @buf_i18n_xml_unmarked, @buf_i18n_ini, @buf_potfiles, @buf_potfiles_ignore, @buf_allfiles, @buf_allfiles_sorted, @buf_potfiles_sorted, @buf_potfiles_ignore_sorted ); ## Search and find all translatable files find sub { push @buf_i18n_plain, "$File::Find::name" if /\.($buildin_gettext_support)$/; push @buf_i18n_xml, "$File::Find::name" if /\.($xml_support)$/; push @buf_i18n_ini, "$File::Find::name" if /\.($ini_support)$/; push @buf_i18n_xml_unmarked, "$File::Find::name" if /\.(schemas(\.in)+)$/; }, ".."; find sub { push @buf_i18n_plain, "$File::Find::name" if /\.($buildin_gettext_support)$/; push @buf_i18n_xml, "$File::Find::name" if /\.($xml_support)$/; push @buf_i18n_ini, "$File::Find::name" if /\.($ini_support)$/; push @buf_i18n_xml_unmarked, "$File::Find::name" if /\.(schemas(\.in)+)$/; }, "$SRCDIR/.." if "$SRCDIR" ne "."; open POTFILES, $POTFILES_in or die "$PROGRAM: there's no POTFILES.in!\n"; @buf_potfiles = grep !/^(#|\s*$)/, ; close POTFILES; foreach (@buf_potfiles) { s/^\[.*]\s*//; } print "Searching for missing translatable files...\n" if $VERBOSE; ## Check if we should ignore some found files, when ## comparing with POTFILES.in foreach my $ignore ("POTFILES.skip", "POTFILES.ignore") { (-s "$SRCDIR/$ignore") or next; if ("$ignore" eq "POTFILES.ignore") { print "The usage of POTFILES.ignore is deprecated. Please consider moving the\n". "content of this file to POTFILES.skip.\n"; } print "Found $ignore: Ignoring files...\n" if $VERBOSE; open FILE, "<$SRCDIR/$ignore" or die "ERROR: Failed to open $SRCDIR/$ignore!\n"; while () { push @buf_potfiles_ignore, $_ unless /^(#|\s*$)/; } close FILE; @buf_potfiles_ignore_sorted = sort (@buf_potfiles_ignore); } foreach my $file (@buf_i18n_plain) { my $in_comment = 0; my $in_macro = 0; open FILE, "<$file"; while () { # Handle continued multi-line comment. if ($in_comment) { next unless s-.*\*/--; $in_comment = 0; } # Handle continued macro. if ($in_macro) { $in_macro = 0 unless /\\$/; next; } # Handle start of macro (or any preprocessor directive). if (/^\s*\#/) { $in_macro = 1 if /^([^\\]|\\.)*\\$/; next; } # Handle comments and quoted text. while (m-(/\*|//|\'|\")-) # \' and \" keep emacs perl mode happy { my $match = $1; if ($match eq "/*") { if (!s-/\*.*?\*/--) { s-/\*.*--; $in_comment = 1; } } elsif ($match eq "//") { s-//.*--; } else # ' or " { if (!s-$match([^\\]|\\.)*?$match-QUOTEDTEXT-) { warn "mismatched quotes at line $. in $file\n"; s-$match.*--; } } } if (/\w\.GetString *\(QUOTEDTEXT/) { if (defined isNotValidMissing (unpack("x3 A*", $file))) { ## Remove the first 3 chars and add newline push @buf_allfiles, unpack("x3 A*", $file) . "\n"; } last; } ## C_ N_ Q_ and _ are the macros defined in gi8n.h if (/[CNQ]?_ *\(QUOTEDTEXT/) { if (defined isNotValidMissing (unpack("x3 A*", $file))) { ## Remove the first 3 chars and add newline push @buf_allfiles, unpack("x3 A*", $file) . "\n"; } last; } } close FILE; } foreach my $file (@buf_i18n_xml) { open FILE, "<$file"; while () { # FIXME: share the pattern matching code with intltool-extract if (/\s_[-A-Za-z0-9._:]+\s*=\s*\"([^"]+)\"/ || /<_[^>]+>/ || /translatable=\"yes\"/) { if (defined isNotValidMissing (unpack("x3 A*", $file))) { push @buf_allfiles, unpack("x3 A*", $file) . "\n"; } last; } } close FILE; } foreach my $file (@buf_i18n_ini) { open FILE, "<$file"; while () { if (/_(.*)=/) { if (defined isNotValidMissing (unpack("x3 A*", $file))) { push @buf_allfiles, unpack("x3 A*", $file) . "\n"; } last; } } close FILE; } foreach my $file (@buf_i18n_xml_unmarked) { if (defined isNotValidMissing (unpack("x3 A*", $file))) { push @buf_allfiles, unpack("x3 A*", $file) . "\n"; } } @buf_allfiles_sorted = sort (@buf_allfiles); @buf_potfiles_sorted = sort (@buf_potfiles); my %in2; foreach (@buf_potfiles_sorted) { s#^$SRCDIR/../##; s#^$SRCDIR/##; $in2{$_} = 1; } foreach (@buf_potfiles_ignore_sorted) { s#^$SRCDIR/../##; s#^$SRCDIR/##; $in2{$_} = 1; } my @result; foreach (@buf_allfiles_sorted) { my $dummy = $_; my $srcdir = $SRCDIR; $srcdir =~ s#^../##; $dummy =~ s#^$srcdir/../##; $dummy =~ s#^$srcdir/##; $dummy =~ s#_build/##; if (!exists($in2{$dummy})) { push @result, $dummy } } my @buf_potfiles_notexist; foreach (@buf_potfiles_sorted) { chomp (my $dummy = $_); if ("$dummy" ne "" and !(-f "$SRCDIR/../$dummy" or -f "../$dummy")) { push @buf_potfiles_notexist, $_; } } ## Save file with information about the files missing ## if any, and give information about this procedure. if (@result + @buf_potfiles_notexist > 0) { if (@result) { print "\n" if $VERBOSE; unlink "missing"; open OUT, ">missing"; print OUT @result; close OUT; warn "\e[1mThe following files contain translations and are currently not in use. Please\e[0m\n". "\e[1mconsider adding these to the POTFILES.in file, located in the po/ directory.\e[0m\n\n"; print STDERR @result, "\n"; warn "If some of these files are left out on purpose then please add them to\n". "POTFILES.skip instead of POTFILES.in. A file \e[1m'missing'\e[0m containing this list\n". "of left out files has been written in the current directory.\n"; } if (@buf_potfiles_notexist) { unlink "notexist"; open OUT, ">notexist"; print OUT @buf_potfiles_notexist; close OUT; warn "\n" if ($VERBOSE or @result); warn "\e[1mThe following files do not exist anymore:\e[0m\n\n"; warn @buf_potfiles_notexist, "\n"; warn "Please remove them from POTFILES.in. A file \e[1m'notexist'\e[0m\n". "containing this list of absent files has been written in the current directory.\n"; } } ## If there is nothing to complain about, notify the user else { print "\nAll files containing translations are present in POTFILES.in.\n" if $VERBOSE; } } sub Console_WriteError_InvalidOption { ## Handle invalid arguments print STDERR "Try `${PROGRAM} --help' for more information.\n"; exit 1; } sub isProgramInPath { my ($file) = @_; # If either a file exists, or when run it returns 0 exit status return 1 if ((-x $file) or (system("$file --version >$devnull") == 0)); return 0; } sub isGNUGettextTool { my ($file) = @_; # Check that we are using GNU gettext tools if (isProgramInPath ($file)) { my $version = `$file --version`; return 1 if ($version =~ m/.*\(GNU .*\).*/); } return 0; } sub GenerateHeaders { my $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} || "intltool-extract"; ## Generate the .h header files, so we can allow glade and ## xml translation support if (! isProgramInPath ("$EXTRACT")) { print STDERR "\n *** The intltool-extract script wasn't found!" ."\n *** Without it, intltool-update can not generate files.\n"; exit; } else { open (FILE, $POTFILES_in) or die "$PROGRAM: POTFILES.in not found.\n"; while () { chomp; next if /^\[\s*encoding/; ## Find xml files in POTFILES.in and generate the ## files with help from the extract script my $gettext_type= &POFile_DetermineType ($1); if (/\.($xml_support|$ini_support)$/ || /^\[/) { s/^\[[^\[].*]\s*//; my $filename = "../$_"; if ($VERBOSE) { system ($EXTRACT, "--update", "--srcdir=$SRCDIR", "--type=$gettext_type", $filename); } else { system ($EXTRACT, "--update", "--type=$gettext_type", "--srcdir=$SRCDIR", "--quiet", $filename); } } } close FILE; } } # # Generate .pot file from POTFILES.in # sub GeneratePOTemplate { my $XGETTEXT = $ENV{"XGETTEXT"} || "xgettext"; my $XGETTEXT_ARGS = $ENV{"XGETTEXT_ARGS"} || ''; chomp $XGETTEXT; if (! isGNUGettextTool ("$XGETTEXT")) { print STDERR " *** GNU xgettext is not found on this system!\n". " *** Without it, intltool-update can not extract strings.\n"; exit; } print "Building $MODULE.pot...\n" if $VERBOSE; open INFILE, $POTFILES_in; unlink "POTFILES.in.temp"; open OUTFILE, ">POTFILES.in.temp" or die("Cannot open POTFILES.in.temp for writing"); my $gettext_support_nonascii = 0; # checks for GNU gettext >= 0.12 my $dummy = `$XGETTEXT --version --from-code=UTF-8 >$devnull 2>$devnull`; if ($? == 0) { $gettext_support_nonascii = 1; } else { # urge everybody to upgrade gettext print STDERR "WARNING: This version of gettext does not support extracting non-ASCII\n". " strings. That means you should install a version of gettext\n". " that supports non-ASCII strings (such as GNU gettext >= 0.12),\n". " or have to let non-ASCII strings untranslated. (If there is any)\n"; } my $encoding = "ASCII"; my $forced_gettext_code; my @temp_headers; my $encoding_problem_is_reported = 0; while () { next if (/^#/ or /^\s*$/); chomp; my $gettext_code; if (/^\[\s*encoding:\s*(.*)\s*\]/) { $forced_gettext_code=$1; } elsif (/\.($xml_support|$ini_support)$/ || /^\[/) { s/^\[.*]\s*//; print OUTFILE "../$_.h\n"; push @temp_headers, "../$_.h"; $gettext_code = &TextFile_DetermineEncoding ("../$_.h") if ($gettext_support_nonascii and not defined $forced_gettext_code); } else { print OUTFILE "$SRCDIR/../$_\n"; $gettext_code = &TextFile_DetermineEncoding ("$SRCDIR/../$_") if ($gettext_support_nonascii and not defined $forced_gettext_code); } next if (! $gettext_support_nonascii); if (defined $forced_gettext_code) { $encoding=$forced_gettext_code; } elsif (defined $gettext_code and "$encoding" ne "$gettext_code") { if ($encoding eq "ASCII") { $encoding=$gettext_code; } elsif ($gettext_code ne "ASCII") { # Only report once because the message is quite long if (! $encoding_problem_is_reported) { print STDERR "WARNING: You should use the same file encoding for all your project files,\n". " but $PROGRAM thinks that most of the source files are in\n". " $encoding encoding, while \"$_\" is (likely) in\n". " $gettext_code encoding. If you are sure that all translatable strings\n". " are in same encoding (say UTF-8), please \e[1m*prepend*\e[0m the following\n". " line to POTFILES.in:\n\n". " [encoding: UTF-8]\n\n". " and make sure that configure.in/ac checks for $PACKAGE >= 0.27 .\n". "(such warning message will only be reported once.)\n"; $encoding_problem_is_reported = 1; } } } } close OUTFILE; close INFILE; unlink "$MODULE.pot"; my @xgettext_argument=("$XGETTEXT", "--add-comments", "--directory\=.", "--default-domain\=$MODULE", "--flag\=g_strdup_printf:1:c-format", "--flag\=g_string_printf:2:c-format", "--flag\=g_string_append_printf:2:c-format", "--flag\=g_error_new:3:c-format", "--flag\=g_set_error:4:c-format", "--flag\=g_markup_printf_escaped:1:c-format", "--flag\=g_log:3:c-format", "--flag\=g_print:1:c-format", "--flag\=g_printerr:1:c-format", "--flag\=g_printf:1:c-format", "--flag\=g_fprintf:2:c-format", "--flag\=g_sprintf:2:c-format", "--flag\=g_snprintf:3:c-format", "--flag\=g_scanner_error:2:c-format", "--flag\=g_scanner_warn:2:c-format", "--output\=$MODULE\.pot", "--files-from\=\.\/POTFILES\.in\.temp"); my $XGETTEXT_KEYWORDS = &FindPOTKeywords; push @xgettext_argument, $XGETTEXT_KEYWORDS; my $MSGID_BUGS_ADDRESS = &FindMakevarsBugAddress; push @xgettext_argument, "--msgid-bugs-address\=\"$MSGID_BUGS_ADDRESS\"" if $MSGID_BUGS_ADDRESS; push @xgettext_argument, "--from-code\=$encoding" if ($gettext_support_nonascii); push @xgettext_argument, $XGETTEXT_ARGS if $XGETTEXT_ARGS; my $xgettext_command = join ' ', @xgettext_argument; # intercept xgettext error message print "Running $xgettext_command\n" if $VERBOSE; my $xgettext_error_msg = `$xgettext_command 2>\&1`; my $command_failed = $?; unlink "POTFILES.in.temp"; print "Removing generated header (.h) files..." if $VERBOSE; unlink foreach (@temp_headers); print "done.\n" if $VERBOSE; if (! $command_failed) { if (! -e "$MODULE.pot") { print "None of the files in POTFILES.in contain strings marked for translation.\n" if $VERBOSE; } else { print "Wrote $MODULE.pot\n" if $VERBOSE; } } else { if ($xgettext_error_msg =~ /--from-code/) { # replace non-ASCII error message with a more useful one. print STDERR "ERROR: xgettext failed to generate PO template file because there is non-ASCII\n". " string marked for translation. Please make sure that all strings marked\n". " for translation are in uniform encoding (say UTF-8), then \e[1m*prepend*\e[0m the\n". " following line to POTFILES.in and rerun $PROGRAM:\n\n". " [encoding: UTF-8]\n\n"; } else { print STDERR "$xgettext_error_msg"; if (-e "$MODULE.pot") { # is this possible? print STDERR "ERROR: xgettext failed but still managed to generate PO template file.\n". " Please consult error message above if there is any.\n"; } else { print STDERR "ERROR: xgettext failed to generate PO template file. Please consult\n". " error message above if there is any.\n"; } } exit (1); } } sub POFile_Update { -f "$MODULE.pot" or die "$PROGRAM: $MODULE.pot does not exist.\n"; my $MSGMERGE = $ENV{"MSGMERGE"} || "msgmerge"; my ($lang, $outfile) = @_; if (! isGNUGettextTool ("$MSGMERGE")) { print STDERR " *** GNU msgmerge is not found on this system!\n". " *** Without it, intltool-update can not extract strings.\n"; exit; } print "Merging $SRCDIR/$lang.po with $MODULE.pot..." if $VERBOSE; my $infile = "$SRCDIR/$lang.po"; $outfile = "$SRCDIR/$lang.po" if ($outfile eq ""); # I think msgmerge won't overwrite old file if merge is not successful system ("$MSGMERGE", "-o", $outfile, $infile, "$MODULE.pot"); } sub Console_WriteError_NotExisting { my ($file) = @_; ## Report error if supplied language file is non-existing print STDERR "$PROGRAM: $file does not exist!\n"; print STDERR "Try '$PROGRAM --help' for more information.\n"; exit; } sub GatherPOFiles { my @po_files = glob ("./*.po"); @languages = map (&POFile_GetLanguage, @po_files); foreach my $lang (@languages) { $po_files_by_lang{$lang} = shift (@po_files); } } sub POFile_GetLanguage ($) { s/^(.*\/)?(.+)\.po$/$2/; return $_; } sub Console_Write_TranslationStatus { my ($lang, $output_file) = @_; my $MSGFMT = $ENV{"MSGFMT"} || "msgfmt"; if (! isGNUGettextTool ("$MSGFMT")) { print STDERR " *** GNU msgfmt is not found on this system!\n". " *** Without it, intltool-update can not extract strings.\n"; exit; } $output_file = "$SRCDIR/$lang.po" if ($output_file eq ""); system ("$MSGFMT", "-o", "$devnull", "--verbose", $output_file); } sub Console_Write_CoverageReport { my $MSGFMT = $ENV{"MSGFMT"} || "msgfmt"; if (! isGNUGettextTool ("$MSGFMT")) { print STDERR " *** GNU msgfmt is not found on this system!\n". " *** Without it, intltool-update can not extract strings.\n"; exit; } &GatherPOFiles; foreach my $lang (@languages) { print STDERR "$lang: "; &POFile_Update ($lang, ""); } print STDERR "\n\n * Current translation support in $MODULE \n\n"; foreach my $lang (@languages) { print STDERR "$lang: "; system ("$MSGFMT", "-o", "$devnull", "--verbose", "$SRCDIR/$lang.po"); } } sub SubstituteVariable { my ($str) = @_; # always need to rewind file whenever it has been accessed seek (CONF, 0, 0); # cache each variable. varhash is global to we can add # variables elsewhere. while () { if (/^(\w+)=(.*)$/) { ($varhash{$1} = $2) =~ s/^["'](.*)["']$/$1/; } } if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/) { my $rest = $3; my $untouched = $1; my $sub = ""; # Ignore recursive definitions of variables $sub = $varhash{$2} if defined $varhash{$2} and $varhash{$2} !~ /\${?$2}?/; return SubstituteVariable ("$untouched$sub$rest"); } # We're using Perl backticks ` and "echo -n" here in order to # expand any shell escapes (such as backticks themselves) in every variable return echo_n ($str); } sub CONF_Handle_Open { my $base_dirname = getcwd(); $base_dirname =~ s@.*/@@; my ($conf_in, $src_dir); if ($base_dirname =~ /^po(-.+)?$/) { if (-f "Makevars") { my $makefile_source; local (*IN); open (IN, ") { if (/^top_builddir[ \t]*=/) { $src_dir = $_; $src_dir =~ s/^top_builddir[ \t]*=[ \t]*([^ \t\n\r]*)/$1/; chomp $src_dir; if (-f "$src_dir" . "/configure.ac") { $conf_in = "$src_dir" . "/configure.ac" . "\n"; } else { $conf_in = "$src_dir" . "/configure.in" . "\n"; } last; } } close IN; $conf_in || die "Cannot find top_builddir in Makevars."; } elsif (-f "$SRCDIR/../configure.ac") { $conf_in = "$SRCDIR/../configure.ac"; } elsif (-f "$SRCDIR/../configure.in") { $conf_in = "$SRCDIR/../configure.in"; } else { my $makefile_source; local (*IN); open (IN, ") { if (/^top_srcdir[ \t]*=/) { $src_dir = $_; $src_dir =~ s/^top_srcdir[ \t]*=[ \t]*([^ \t\n\r]*)/$1/; chomp $src_dir; $conf_in = "$src_dir" . "/configure.in" . "\n"; last; } } close IN; $conf_in || die "Cannot find top_srcdir in Makefile."; } open (CONF, "<$conf_in"); } else { print STDERR "$PROGRAM: Unable to proceed.\n" . "Make sure to run this script inside the po directory.\n"; exit; } } sub FindPackageName { my $version; my $domain = &FindMakevarsDomain; my $name = $domain || "untitled"; &CONF_Handle_Open; my $conf_source; { local (*IN); open (IN, "<&CONF") || return $name; seek (IN, 0, 0); local $/; # slurp mode $conf_source = ; close IN; } # priority for getting package name: # 1. GETTEXT_PACKAGE # 2. first argument of AC_INIT (with >= 2 arguments) # 3. first argument of AM_INIT_AUTOMAKE (with >= 2 argument) # /^AM_INIT_AUTOMAKE\([\s\[]*([^,\)\s\]]+)/m # the \s makes this not work, why? if ($conf_source =~ /^AM_INIT_AUTOMAKE\(([^,\)]+),([^,\)]+)/m) { ($name, $version) = ($1, $2); $name =~ s/[\[\]\s]//g; $version =~ s/[\[\]\s]//g; $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/); $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/); $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/); $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/); } if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)/m) { ($name, $version) = ($1, $2); $name =~ s/[\[\]\s]//g; $version =~ s/[\[\]\s]//g; $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/); $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/); $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/); $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/); } # \s makes this not work, why? $name = $1 if $conf_source =~ /^GETTEXT_PACKAGE=\[?([^\n\]]+)/m; # m4 macros AC_PACKAGE_NAME, AC_PACKAGE_VERSION etc. have same value # as corresponding $PACKAGE_NAME, $PACKAGE_VERSION etc. shell variables. $name =~ s/\bAC_PACKAGE_/\$PACKAGE_/g; $name = $domain if $domain; $name = SubstituteVariable ($name); $name =~ s/^["'](.*)["']$/$1/; return $name if $name; } sub FindPOTKeywords { my $keywords = "--keyword\=\_ --keyword\=N\_ --keyword\=U\_ --keyword\=Q\_"; my $varname = "XGETTEXT_OPTIONS"; my $make_source; { local (*IN); open (IN, "; close IN; } # unwrap lines split with a trailing \ $make_source =~ s/\\ $ \n/ /mxg; $keywords = $1 if $make_source =~ /^$varname[ ]*=\[?([^\n\]]+)/m; return $keywords; } sub FindMakevarsDomain { my $domain = ""; my $makevars_source; { local (*IN); open (IN, "; close IN; } $domain = $1 if $makevars_source =~ /^DOMAIN[ ]*=\[?([^\n\]\$]+)/m; $domain =~ s/^\s+//; $domain =~ s/\s+$//; return $domain; } sub FindMakevarsBugAddress { my $address = ""; my $makevars_source; { local (*IN); open (IN, "; close IN; } $address = $1 if $makevars_source =~ /^MSGID_BUGS_ADDRESS[ ]*=\[?([^\n\]\$]+)/m; $address =~ s/^\s+//; $address =~ s/\s+$//; return $address; } libqalculate-0.9.7/config.sub0000755000175100017510000007772410707444443013127 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-06-28' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libqalculate-0.9.7/config.guess0000755000175100017510000012706110707444443013452 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-07-22' # This file 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. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa:Linux:*:*) echo xtensa-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libqalculate-0.9.7/ChangeLog0000644000175100017510000023224611320654654012705 000000000000002009-01-05 Jonathan Stickel * General build updates and bug fixes, including the ability to build against cln >= 1.2. * Bug fix for segfaults with some uses of integrate() (bug 2537772). 2008-03-17 Niklas Knutsson * Fix reduction of vector size. Fixes bug 1913388. 2007-08-27 Niklas Knutsson * Begin work on propagation of uncertainties * Allow parentheses for vectors (a bit stricter parsing) * brackets_as_parentheses parse option 2007-08-23 Niklas Knutsson * 2/5m = 2/(5m); 2/5 m = (2/5)*m 2007-08-22 Niklas Knutsson * Make DataSet::calculate virtual * dataset.object.property and object.property (with parse_options.default_dataset set) syntax 2007-08-21 Niklas Knutsson * Fix crash with unsupported operator in RPN syntax (bug 1778267) 2007-08-07 Niklas Knutsson * New Simplified Chinese translation (Roy Qu ) 2007-06-17 Niklas Knutsson * Miscellaneous fixes before release 2007-04-27 Niklas Knutsson * New functions: addTime(), isNumber(), isReal(), isRational(), isInteger(), representsNumber(), representsReal(), representsRational(), representsInteger() * Show argument name instead of \x in argument condition 2007-04-26 Niklas Knutsson * Use Lambert W to solve equations * Fix infinite loop when solving some equations * New functions: addDays(), addMonths(), addYear() 2007-04-19 Niklas Knutsson * Enhance lambertw() * Add the Omega constant 2007-04-18 Niklas Knutsson * Implement the Lambert W function 2007-04-17 Niklas Knutsson * Avoid floating point underflow by, in approximate mode, checking against the value of pi in sin() and cos() * Add more exact values for sin() and cos() 2007-04-15 Niklas Knutsson * Fix simplification of (1-1/x)^3 and similar 2007-03-31 Niklas Knutsson * Add grams of TNT (gTNT/gramTNT) and tons of TNT (tTNT/tonTNT) units 2007-03-29 Niklas Knutsson * Fix parsing of unit expressions (when converting) such as W/(m K) * Expand data on elements 2007-03-20 Niklas Knutsson * Fix clumsy mistakes in setPrefixes() leading to crashes * Add typographic units * Add some old french length units * Add alternative name "variations" for permutations * Fix atomic mass unit being put in second density category 2006-12-16 Niklas Knutsson * New French translation (Nicolas Laug ) 2006-11-18 Niklas Knutsson * Update Swedish translation 2006-11-07 Niklas Knutsson * Update Dutch translation (Jaap Woldringh ) 2006-11-02 Niklas Knutsson * Use "name := value" as shortcut for save(value; name) * Return value in save() 2006-09-10 Niklas Knutsson * Group integer factors in powers 2006-09-05 Niklas Knutsson * Integer factorization * Heaviside Step Function, Rectangular Function, Triangular Function, and Ramp Function * Kronecker Delta, Sigmoid, and Logit Transformation 2006-08-18 Niklas Knutsson * Generate API docs from autogen.sh * Radius instead of diameter as argument for circumference() 2006-07-21 Niklas Knutsson * Interpret 0x[0-9,a-f] as hexadecimal number (do not require first digit to be 0-9) 2006-07-03 Niklas Knutsson * Add optional upper and lower limit arguments to integrate() for definite integrals * Add cross() function * Handle powers with multiplication as base when setting prefixes * Split powers with units when placing units separately * Increment version number 2006-06-21 Niklas Knutsson * Fix parsing of "x!)!" * Use Julian year for light-year value 2006-06-20 Niklas Knutsson * Use "Display units separately" also for quantities with multiple terms 2006-06-10 Niklas Knutsson * Add base 3 exponent mode * Add "Engineering" display mode 2006-06-06 Niklas Knutsson * Unevaluated arguments were used when checking for numerical arguments in logn(), which caused log2(16/2) to first be evaluated to ln(16/2)/ln(2). 2006-06-01 Niklas Knutsson * Polishing before 0.9.4 release 2006-05-18 Niklas Knutsson * Fix libqalculate.so unresolved symbols with patch from Thomas de Grenier de Latour, add GLIB_LIBS to LIBADD 2006-05-09 Niklas Knutsson * Add additional localization options for use in KDE GUI 2006-05-03 Niklas Knutsson * Update API documentation * Clean up Unit API * More function descriptions * tetrahedron(), tetrahedron_sa(), tetrahedron_height(), sqpyramid(), sqpyramid_sa() and sqpyramid_height() functions * Do not update the stack until the calculation is finished * stack() and register() functions * Add true RPN mode to qalc * Add "rpn", "stack" and "clear stack" commands, and "lowercase e", "lowercase numbers", "spell out logical", "dot as separator" and "rpn" set command options in qalc * Update Swedish translation 2006-04-28 Niklas Knutsson * Update API documentation * equation => formula in MathFunction * Do less in setFormula() if formula is empty 2006-04-27 Niklas Knutsson * Fix parsed expression for RPN operation * Remove capitalization from argument titles 2006-04-24 Niklas Knutsson * Fix bug #1475373 ("1 kg m/s" was simplified to "1000 m/s") 2006-04-23 Niklas Knutsson * README.translate with information for translators * Update Swedish translation 2006-04-22 Niklas Knutsson * Prepend !category! to strings, which might have different translations in different contexts, in data files 2006-04-21 Niklas Knutsson * Add the completed Dutch translation * New name format in data files * Update Dutch translation to new name format 2006-04-13 Niklas Knutsson * Fix horrible, horrible bug that caused all number arguments to require numbers to be rational 2006-04-09 Niklas Knutsson * Ignore definition names beginning with colon, for plural names where the original name does not differ * Set vectors and matrices as the first argument by default * Add more function descriptions 2006-04-08 Niklas Knutsson * Options to use dot as thousands separator when it is not the default decimal sign * require_translation property for definitions, used in the large numbers category 2006-04-06 Niklas Knutsson * Update RPN functions * Update API documentation * Change usecs argument to msecs 2006-04-04 Niklas Knutsson * Plugins * True RPN mode 2006-04-03 Niklas Knutsson * Set min and max in argument definition for zeta() * Set exact value for zeta with argument 2, 4, 6, 8 or 10 and set infinity for 1 2006-04-02 Niklas Knutsson * Symmetric matrix => Square matrix * Some text string changes * Accept vectors in elements function 2006-04-01 Niklas Knutsson * Interpret 0x..., 0o... and 0b... as hexadecimal, octal and binary numbers, respectively, when base is decimal 2006-03-29 Niklas Knutsson * Remove deleted data set from the data set list, not only the function list (fix crash on delete and update list view) 2006-03-28 Niklas Knutsson * Fix contains... functions (and thereby integration) 2006-03-25 Niklas Knutsson * Ignore commas in numbers * Start API documentation 2006-03-13 Niklas Knutsson * Approximate comparison fixes * Add PrintOptions->restrict_to_parent_precision (default true) * Do not produce a result with multiplications inside multiplications (fixes prefixes with simplification) 2006-02-26 Niklas Knutsson * Approximate comparison * Avoid floating point overflow and underflow by not lowering precision in comparison and always using long floats * Use floating point raise more often in approximate mode 2006-02-21 Niklas Knutsson * Fix show ending zeroes when max decimals is set to off by a max value below zero 2006-02-11 Niklas Knutsson * Do not use "Read Precision" in plot 2005-01-30 Niklas Knutsson * isodate(), localdate(), timestamp(), stamptodate() functions 2005-01-27 Niklas Knutsson * cos(x*pi*rad) equals 1 if x is even, not -1 2005-12-20 Niklas Knutsson * Warn about denominators assumed non-zero option 2005-12-19 Niklas Knutsson * Various fixes and enhancements * Update Swedish translation 2005-12-14 Niklas Knutsson * Fix ln(e^x) * Isolate x in log(x) for inequalities * Factorize x^2-y^2 and x^3-y^3 2005-12-13 Niklas Knutsson * Isolate x fixes * Fix merging of common factor with multiplication 2005-12-12 Niklas Knutsson * Assume that simple unit relations do not negate * Fix ?+(+infinity) 2005-12-11 Niklas Knutsson * Fix non-commutative multiplication (multiplication with possible matrices) 2005-12-09 Niklas Knutsson * Fix isolate x with "x^2 > -5" and similar * Do not calculate y in "x && y" and "x || y" if x is false or true, respectively 2005-12-08 Niklas Knutsson * New assumption type "non-matrix" for unknowns with commutative multiplication * Finish isolate x / solve changes 2005-12-06 Niklas Knutsson * Isolate x and solve fixes * Fix matrix multiplication 2005-12-04 Niklas Knutsson * Isolate x updates * Put AND within OR (to get nicer inequalities) 2005-12-03 Niklas Knutsson * Isolate x using AND and OR instead of vector * Enhanced inequalities handling in isolate x * Simplify AND and OR with comparisons (ex x < 5 && x < 3 = x < 3) * Display "x < 3 && x > 1" as "1 < x < 3" 2005-12-01 Niklas Knutsson * Incorporate ginac sqrfree updates between version 1.2.3 and 1.3.3 * Assorted fixes 2005-11-30 Niklas Knutsson * Only treat e as E if preceded by number * Do not test float number for infinite series * Check factorized numerators and denominators for negative powers 2005-11-29 Niklas Knutsson * Parse -x/y as (-x)/y instead of -(x/y) * Print multiplication in negation with parentheses when excessive parentheses is on * Do not display (x)(y)^z with multiplication sign * Sort x^2*y^3 + 10xy - 3x + 8 instead of x^2*y^3 - 3x + 10xy + 8 2005-11-28 Niklas Knutsson * Updated function arguments parsing ignoring space after function name and not stopping parsing of single argument without parentheses until space or right parenthesis without corresponding left parenthesis * Be more strict with 0/x if x is not non-zero * Fix 1E-1 = 1e-1 * Calculate as float when 1.0001 > base < 0.9999 and exponent is greater than 10000 or less than -10000 2005-11-27 Niklas Knutsson * Unknown variable with sign non-negative or non-positive represents real number * Update assumption type after setting sign and vice versa * Assume again when dividing that units do not convert to zero * "Einstein per Meter per Second" => "Einstein per Meter Squared per Second" 2005-11-26 Niklas Knutsson * Be more restrictive with unknown variables/symbols with unknown type (might be unit or vector) 2005-11-25 Niklas Knutsson * Update qalc with new factorization and some more * Option for qalc to read commands from a file first * Fix unit comparisons * Fix handling of units with function in relation saved in approximate variable 2005-11-24 Niklas Knutsson * Sort out some power transformations 2005-11-23 Niklas Knutsson * More fixes (I'm not very good at keeping track of them) 2005-11-22 Niklas Knutsson * Preserve factorization print option (for (3/4*(x+1))/(y+1)) 2005-11-21 Niklas Knutsson * Lots of evaluation and factorization fixes * Pass parent to some functions so the reference can be replaced for the whole child * New MathStructure sorting algorithm using the fact that the structure usually already is well sorted, reducing the time to factorize (x+y)^50 to a third 2005-11-19 Niklas Knutsson * Add rational polynomial parameter to arguments * Add rational number parameter to number arguments * Add polynomial functions -- coeff(), lcoeff(), pcontent(), degree(), etc. * Fix lcoefficient (confused by l in ldegree mening low and l in coefficient leading) * A more efficient differentiate function for sqrfree 2005-11-18 Niklas Knutsson * Fixes * Determinant from GiNaC * Only use the new inverse function for numeric matrices 2005-11-17 Niklas Knutsson * "borrow" sqrfree factorization and related functions from GiNaC * Make evaluation more efficient (avoid recalculations) 2005-11-10 Niklas Knutsson * MathStructure gcd() and lcm() * New simplification using factorization and factorization combing denominators * Increment library soname number (QALCULATE_CURRENT) 2005-11-07 Niklas Knutsson * Much more efficient determinant calculation * Fix x*y^-1*y^-1+x*y^-1 * Fix cases when (x-1)^-1*(x-1)^-1 not returned (x-1)^-2 * Much more efficient inverse matrix calculation 2005-11-06 Niklas Knutsson * Use quotient rule in differentation to possible get simpler results then if always using the product rule * Fix fetching of exchange rates with gnome-vfs < 2.10 * Fix display of fractions in fractional mode "Decimal (Try Exact)" * Differentiation fixes * Do unicode stuff correctly (a sequence of unicode characters was sometimes counted as one) 2005-11-05 Niklas Knutsson * Fix (x+1)/x (= 1 + 1/x) * Simplification by combining divisions * Reversed polynomial division (ex. (x+1)/(x^2+2x+1) = 1/(x+1)) 2005-11-04 Niklas Knutsson * Compile without warnings with -pedantic and -Wextra 2005-11-03 Niklas Knutsson * Fix simplification of (ax^b+cx^d)/x * Fix (xy/z)+1/z * Fix suggested multiplication sign before and after power 2005-11-02 Niklas Knutsson * More parse polishing * Fix for cln-1.1.10 and remove all "obfuscating" cln operators * Builtin function's represents...() was not used because of missing const in declaration 2005-10-31 Niklas Knutsson * Cleaner parsing (same result but looks nicer) 2005-10-30 Niklas Knutsson * Add metre/metres for meter/meters * nounit() function 2005-10-29 Niklas Knutsson * Fix Kibit interpretation (was kibitonne, is now kibibit) and similar * Update setting of parsed structure and to expression in calculate function * Update qalc 2005-10-28 Niklas Knutsson * Option to reduce transformation when parsing and print formating * Support for binary and other prefixes * Information units (bit, byte, etc.) and binary prefixes * Neper and Bel units 2005-10-26 Niklas Knutsson * Update Swedish translation * light_year => lightyear * Fix unended function information when optional arguments 2005-10-22 Niklas Knutsson * Add SIGN_SMALLCIRCLE and SIGN_MULTIBULLET to utf8_pos_is_valid_in_name to fix completion 2005-10-21 Niklas Knutsson * Lots of new units 2005-10-20 Niklas Knutsson * Only give "Error in unit expression" message on errors in CompositeUnit parsing * Do not accumulate the error count between levels for temporary stop messages 2005-10-19 Niklas Knutsson * Add arguments past max arguments to unended_function 2005-10-18 Niklas Knutsson * Put seperation of unit expression to string in calculate function in a separate function * Add stopped warnings count 2005-10-17 Niklas Knutsson * Print option to hide underscores (if not for suffix) in names * Adjust precision of constants 2005-10-16 Niklas Knutsson * Add unended_function to parse_options and put unended function there when parsing 2005-10-15 Niklas Knutsson * mmHg unit * Ideal Gas Constant 2005-10-13 Niklas Knutsson * Fortnight unit * More composite units for convenience * Foot-Candle unit * Fix conversion footcandle <-> lux * Einstein unit 2005-10-11 Niklas Knutsson * More composite units for convenience (km, mm, ml, km/h, etc.) 2005-10-08 Niklas Knutsson * Move currency definitions to currencies.xml * Functions for loading sepearate global definitions files * Create angle units if not loaded from definitions files 2005-10-05 Niklas Knutsson * Do not create qalculate symlink to qalc (confusing when installing GUI in other location) * Use gnomevfs-copy instead of wget if available * Allow user to specify wget arguments * Update currencies 2005-09-21 Niklas Knutsson * mph and mpg units 2005-08-21 Niklas Knutsson * Fix (1/2)^n < 0.5 * Fix replacement of unicode signs when skipping quotes * Fix 0 oC to oF (0*unit != 0) 2005-06-11 Niklas Knutsson * Remove requirement glib-2.0 >= 2.4 and require libxml2 >= 2.3.8 * Do not let << take precedence over >> read from left to right 2005-06-10 Niklas Knutsson * Do not use unicode prefix names for long names * xor() and bitxor() is NOT algebra * Add even() and odd() functions * shift() function and operators ("<<" and ">>") * Add functins for getting exchange rates url and file name to allow interface to do the downloading themselves 2005-06-09 Niklas Knutsson * Support for "e" instead of "E" in result 2005-06-07 Niklas Knutsson * SIGN_POWER_1, ... => "^(1)", ... instead of "^1", ... 2005-06-06 Niklas Knutsson * Update Swedish translation 2005-06-05 Niklas Knutsson * Reminder => Remainder * Reminder (mod) => Modulus * Bitwise NOT (~) * xor() and bitXor() * Clean up expression such (x && y) > 0 * Update currencies (more added) * Warn the use that objects with '~' in name will be lost * Keep loading/saving after error * Do not crash when saving data sets (initialize cat_i_prev) * Do not load nameless objects 2005-06-02 Niklas Knutsson * Bitwise AND (&), OR (|), XOR * Remove old giac stuff 2005-06-01 Niklas Knutsson * Non-static getElement() function * Initialize saved_locale before use 2005-05-15 Niklas Knutsson * Max values seem to have been lost a long time ago -- add them again 2005-05-07 Niklas Knutsson * Initialize ids_i * Fix documentation typos * Fix includes.h for gcc-4.0 2005-03-06 Niklas Knutsson * 5e2 = 5E2 = 500 and 5e = 5*e 2005-02-08 Niklas Knutsson * Update solve2() 2005-02-06 Niklas Knutsson * Dialog with buttons works in gtk+-2.6.2 * Do not look at function arguments in contains... functions 2005-02-02 Niklas Knutsson * Update integration and differentiation (sin(x) != sin(x)*rad) after change in sin() and cos() behaviour 2005-01-25 Niklas Knutsson * Fix RPN crash and don't add lonely stack value to itself * Workaround freeze with message dialog without buttons 2005-01-24 Niklas Knutsson * Use the last operator for leftover stack values 2004-11-30 Niklas Knutsson * Show base (if not decimal, hexadecimal or non-standard) as subscript 2004-11-26 Niklas Knutsson * Fix "Convert result" button * Use singular instead of abbreviated name for completion 2004-11-21 Niklas Knutsson * Fix draw unit * Add alternative multiplication dot signs * Enhance preferences safety 2004-11-16 Niklas Knutsson * Check if unicode characters can be displayed 2004-11-10 Niklas Knutsson * Revert back somewhat to the old behaviour of not rounding exact numbers not in exponential format 2004-10-25 Niklas Knutsson * Generate vector function 2004-10-24 Niklas Knutsson * Rearrange plot dialog * Do not update plot data when not changed * Make x variable separate for each plot function 2004-10-22 Niklas Knutsson * Fix angle arguments by adding option default angle unit none where angle units must be specified * Represents... for some functions * Some tweaks 2004-10-21 Niklas Knutsson * Fix 0.5! 2004-10-20 Niklas Knutsson * Fix comparison of unit with unknown * Try with assumptions set to unknown in solve function if not successful 2004-10-19 Niklas Knutsson * Fix when size_t not is unsigned int 2004-10-17 Niklas Knutsson * Disable plural forms not at the end of text strings (metersqrt(5) = meter * sqrt(5) instead of meters * qrt(5)) * Replace new lines with in definition xml files until we have a better solution 2004-10-14 Niklas Knutsson * Speed-up csum when component(i, "v") is used * Give messages in the right order (reversed) * Update obsolete plot documentation * Clean up parsing * Add limit implicit multiplication mode * Fix unit conversion * Fix m*s -> 1 m*s 2004-10-13 Niklas Knutsson * More speed-ups 2004-10-12 Niklas Knutsson * Limit qalc history to 100 entries * Increase qalculate-gtk history to 25 entries * Store children i math structures as pointers to reduce copying of large vectors 2004-10-11 Niklas Knutsson * Help buttons in variable edit, unit edit, function edit and plot dialogs * Make definitions loading more than twice as fast * -set command line option for qalc 2004-10-10 Niklas Knutsson * defs2doc program for generation of definition list in help * Make help book and add appendix for lists of functions, variables and units * Fix broken CVS 2004-10-09 Niklas Knutsson * promille -> permille * Permille sign * permyriad * Fix atan() ignoring angle unit * Add exact value for atan(1) = 1/4 pi and atan(-1) = -1/4 pi 2004-10-08 Niklas Knutsson * Install headers * Added pkgconfig file libqalculate.pc * Remove inclusion of config.h in installed headers * Include library headers with * Rename src/calclib src/libqalculate 2004-10-07 Niklas Knutsson * Update exchange rates command in qalc * Update Swedish translation * Add last set options to qalc * Allow user to type - when unicode signs is disabled * Division sign selection * Use selected multiplication and division sign in text printing 2004-10-06 Niklas Knutsson * Fix qalc Ctrl+D crash (exit when read line is NULL) * Do not require two tabs to show completion list * Do not show all output directly if terminal is too small * Split out localization of definitions into po-defs * Add full support for non-utf8 local characters in qalc * Various qalc tweaks 2004-10-05 Niklas Knutsson * Fix equalsIgnoreCase() for unicode chars and make more efficient * Make qalc case insensitive and add extend localization * Change package name to qalculate 2004-10-04 Niklas Knutsson * Use readline for qalc * Change class Function to MathFunction * Only use plural name when short multiplication * qalc completion * Autoconf updates -- make compilation of qalc and qalculate-gtk optional as well as readline * qalc save variable, set assumptions, and more 2004-10-03 Niklas Knutsson * Ask if exchange rates shall be downloaded the first qalculate run * Number base 1 makes no sense * More work on qalc 2004-10-02 Niklas Knutsson * Change n for micro to u * Command line program "qalc" * Get rid of traces of separate angle unit variable 2004-10-01 Niklas Knutsson * Add filter to save result to image file dialog * Install libqalculate as a shared library 2004-09-30 Niklas Knutsson * Alternative to use step size instead of sampling rate for generation of plot data * Big approximate and precision check and fix * Message about the limited functionality of the gamma function 2004-09-29 Niklas Knutsson * Gamma for rational numbers with denominator 2 * Double and multi factorials * Tweak parsing of !-factorials * Modify CLN error message * hyperfactorial() and superfactorial() * Make factorials more efficient by using CLN numbers directly 2004-09-28 Niklas Knutsson * Allow arguments to only be used in sub functions * Remove countArgOccurence() as it is not needed any more * Drop support for gtk+ < 2.4 * Fix large integers displayed inexact was reported as exact * Stop gamma() if argument is not an integer * Read precision from zero with decimals (0.000...) * Set precision from function and its arguments after function calculation 2004-09-27 Niklas Knutsson * "Inverse" -> "Matrix Inverse" * Fix isolate_x() when comparison type is not equals * Make plot non-numerical error more informative and include non-reals * No use to have if() arguments as text, as they now only are parsed initially * Fix trimmean() and winsormean() * Localize "timed out" * Version 0.6.4 2004-09-26 Niklas Knutsson * Fix selection of variable to solve * New solve2() function * New multisolve() function * Do not add modified data object once more * Do not check against new data objects for duplicates * Get a default name for new vector/matrix just as with other known variables * Display error when plot data contains non-numerical values * Show function condition in function description * Update Swedish translation * We need to sort fully recursively before merging factors in factorize() * Fix factorization with duplicate factor with a in (ax+b) greater than one * Add new expression to expression history after set unknowns * Use g_find_program_in_path() to check if gnuplot and wget is available to avoid terminal output 2004-09-25 Niklas Knutsson * unitedit_glade was used in variable dialogs * Use factorization in isolate_x() * Improve isolate_x() * Check if terms is equal (or a = -b) with the current precision in subtract and add to be able to find very small numbers that really are zero * isolate_x() fixes * Preserve evaluation options through factorization 2004-09-24 Niklas Knutsson * Include both "liter" and "litre" to avoid confusion * Add "tonne" for metric ton * Prefer keeping the original unit if equally good when converting to best unit * Merge infinite numbers with somewhat known structures * Be a bit more strict with undefined values * Ohm and farad are SI units 2004-09-23 Niklas Knutsson * Increase space after imaginary i by 1 * Fix never ending loop in getBestPrefix() * Fix (2x)/(5(yz)) --> (2x)/(5yz) * Take into account place_units_separately in improve_division_multipliers() * Increase space at end of parenthesis by 1 * Change components() to dimension() * Set correl() as a different name for pearson() instead of a separate function * Check that the dimension of vectors is equal in pearson() and spearman() * Test if polynomial division reduces the size of the expression * Stop after editing data set from edit function function * Tweak data set info printing removing tabs * Save Image -> Save Image... 2004-09-22 Niklas Knutsson * Fix data object edit option menu * Do not show error when global data file cannot be loaded for local data set * Update data property list also when the data set is new * Fix setting data set function name * Set default argument names for data set when entries are empty * Do not delete original property and add new -- set original with new to not invalidate references in objects * Position progress dialog center parent, and set unknowns and convert to unit expression under mouse * Once again, fix prefix selection when prefix is first before/after zero 2004-09-21 Niklas Knutsson * Rational factorization of higher degree polynomials 2004-09-20 Niklas Knutsson * Some result display tweaks * Update function titles and argument names * Update Swedish translation * Update documentation * Print quotation marks for symbolic structures when not allow unusable * Display e*e^x with multiplication sign 2004-09-19 Niklas Knutsson * Full factorization of quadratic polynomials * Transform sqrt(8) to 2*sqrt(2) (and similar) in exact mode * Fix xy-xy=xy !!! * Fix repeated apply in unknowns dialog 2004-09-18 Niklas Knutsson * Updated result sorting * (-x-y)/z --> -(x+y)/z 2004-09-17 Niklas Knutsson * Set unknowns dialog * More refined selection of popup menu items to show * Polynomial division * More reliable internal sorting 2004-09-16 Niklas Knutsson * Extensive enhancements of symbolic division * Alternative to assume that unknown denominators are non-zero 2004-09-12 Niklas Knutsson * Ex. 1/(x+10)=5, test if x+10 is zero after solve 2004-09-11 Niklas Knutsson * Evaluation options was not always preserved when converting to best units * Display x^(5/2) as x^2*sqrt(x) 2004-09-10 Niklas Knutsson * Internal sorting fixes * Update documentation * Update Swedish translation * Use displayed name when sorting 2004-09-09 Niklas Knutsson * Make factorization more functional 2004-09-08 Niklas Knutsson * Integration fixes * Use representsNonZero() for arguments that must be non-zero 2004-09-07 Niklas Knutsson * "times", "plus", "minus", "per", "AND", "OR" 2004-09-06 Niklas Knutsson * Finish GUI and user modifications for data sets 2004-09-01 Niklas Knutsson * rm -f qalculate; $(LN_S) qalculate-gtk qalculate 2004-08-28 Niklas Knutsson * Edit and save data objects * Finish system property of units * Clean up some left over plural and singular stuff * Add unit system to edit GUI 2004-08-26 Niklas Knutsson * Planets data set * Day and Julian Year * Fix set icon * Do not always make Calculator message window transient for main window * Save and load accel map 2004-08-25 Niklas Knutsson * data collection -> data set * Complete data set GUI 2004-08-24 Niklas Knutsson * Complete most of the data collection stuff * Move elements to data collection format 2004-08-23 Niklas Knutsson * Fix diff() with variables and functions that contains x * Simple integration 2004-08-22 Niklas Knutsson * ans2, ans3, ans4 and ans5 * google/googleplex -> googol/googolplex * thousand and hundred * Reduce min result area height * Put angle mode in evalution options * Status text * Save to image * Initial work on data collection concept 2004-08-20 Niklas Knutsson * Fix RPN mode * include errno.h 2004-08-16 Niklas Knutsson * Remove giac arguments * Update documentation 2004-08-15 Niklas Knutsson * Fix prefix selection when first positive/negative exponent prefix * No prefix in result prefix menu * Only left parenthesis where added around vector! * Make the title for mils more descriptive * FIx matrix multiplication 2004-08-14 Niklas Knutsson * Make no comparison to solve error message more informative * Do not factorize if factor is not non-zero * Fix prefix selection with negative exponent prefixes * Fix prefix selection with denominator prefix enabled 2004-08-13 Niklas Knutsson * Fix concatenate() * Add localized full name to ans variable * Make sure that completion pops down when going back in history * Set minimum arguments to 1 for mergevectors() 2004-08-12 Niklas Knutsson * Fix derangements() which was broken due to changed interpretation of -1^x * CALCULATOR->u_rad was null * True and False variables * "yes" -> "Yes" and "no" -> "No" * Localize "True" and "False" radio buttons * Add *.xml.in files to the dist tar sources * Complete exp1 in "2+5exp1" * Add undefined variable * Fix ids in text arguments when function is used in other function (fixes distribution functions) * Show classification in atom() dialog 2004-08-11 Niklas Knutsson * Remove double decimal points * Nicer unit printing * Warn in name edit dialog if name is used * Update documentation * Use gtk-paste instead of gtk-go-forward icon for insert * Properties dialog for atoms in periodic table * Respect max decimals with show ending zeroes * Fix precision typos which made objects with undefined precision approximate * Make element properties selectable * Paste function instead of value of element property * Display classification in element dialog * Unformat parsed function expression * Make sure that no unwanted prefixes are left when function expression has been parsed * BMI (Body Mass index) function added (just to prove that Qalculate! is more than a scientific calculator) 2004-08-10 Niklas Knutsson * Reduce number of element properties for now and verify * Periodic table * Update Swedish translation 2004-08-09 Niklas Knutsson * Do not be backwards compatible for definitions saved with the current version * Update Swedish translation * Where there is approximate there shall also be precision * More physical constants * Fix formatting of x/unit * Add atomic mass unit, u * Add si again * Elements! * Ignore initial zeroes for precision 2004-08-08 Niklas Knutsson * Finish names GUI * Finish new number precision system * Menu item for read precision * Option to show ending decimals (to see actual precision) * Fix parsing of numbers with base < 10 and decimal point 2004-08-07 Niklas Knutsson * Initial work on GUI for new name system * Treat whole ending number as suffix (for log10) 2004-08-06 Niklas Knutsson * More work on name system * Remove quarter unit * Regenerate definition files * Remove duplicate names 2004-08-05 Niklas Knutsson * Do not prefix currencies in all locales 2004-08-04 Niklas Knutsson * New system for variable, unit and function names * Solve quadratic equations 2004-07-31 Niklas Knutsson * System property for units ("si" value only used for now) * Optional automatic conversion to best or base units * Update version number in global definition files * Add CGS units 2004-07-30 Niklas Knutsson * Mark SI units * Convert to best unit now only converts to SI units * Mass Fraction (kg/kg) * Fix insert and edit composite unit 2004-07-29 Niklas Knutsson * Electron Volt is approximate 2004-07-21 Niklas Knutsson * Fix arg() * ...and disable it as it does not work correctly * Fix i being display multiple times 2004-07-20 Niklas Knutsson * Focus tweaks 2004-07-19 Niklas Knutsson * -5^2 = (-5)^2 -> = -(5^2) * Beautify 2 * -1 * Fix not 2004-07-18 Niklas Knutsson * Show if precalculation display is approximate * Show if approximate conversion in units manager * Enable unicode signs in from-unit label * Deillion -> Decillion * Refine when to update result and display of result * Ability to disable complex results * Ability to disable infinite results 2004-07-17 Niklas Knutsson * Update variable lists in GUI after save function has been called * Do not let the user type any braces in the expression entry * Select added plot series and let enter in plot expression entry modify selected (if any selected) * Fix rad unit being dropped in unsolved sin/cos function * Fix plus/minus before id * Show precalculation result in history view 2004-07-16 Niklas Knutsson * Oops! operators does not include parenthesis * Use unicode operators in text printing * base == 10 -> base >= 2 && base <= 10 (in parsing) * Refine CSV export dialog * Sort out some getActive... vs get... * Fix too many arguments warning * Increase function parsing efficiency (decrease number of MathStructure copies) * Produce vector imediately on parse * Export button in variables dialog * Split number base expression and export csv dialogs from main.glade * Remove lines * Update Swedish translation * Update documentation * Fix nameTaken() * Fix overwriting variable * Remove deleted items from recent units/variables/functions * Do not try to insert deleted variable 2004-07-15 Niklas Knutsson * More work on base in parse options * Fix E in rpn mode * Parsing tweaking * GUI for number base in expression 2004-07-14 Niklas Knutsson * Alternative to round halfway integers to even (instead of upwards) * Make qalculate symlink from qalculate-gtk * Fix addColumns() and import of CSV file to matrix * Export to CSV file * if, function, error, warning, load, save and title functions were not activated (oops!) * Let argument definitions parse default values * Do not parse ! as factorial if functions is disabled * Ability to set number base for expression parsing * Allow full expressions in base functions 2004-07-13 Niklas Knutsson * Ability to set all number bases from 2 to 36 from GUI * Documentation updates * Alternative to use lower case letters in numbers * Fix double decimal point with integers * Fix decimal reduction rounding * Fix precision rounding * Fix approximate indication with multiple numbers * Fix printing of empty vector 2004-07-12 Niklas Knutsson * Update documentation * Force use of -O2 instead of -Os * Revert back to a^b^c = a^(b^z) (I don't remember changing it) * Unknowns disabled by default * Copy subfunctions * GUI for subfunctions 2004-07-11 Niklas Knutsson * Do not segfault on exit * Fix compilation warnings 2004-07-10 Niklas Knutsson * Do not try to fetch exchange rates everytime they are missing * Set fetch timeout to 5 seconds on first run * Inform user that we are trying to fetch exchange rates * Update fetch exchange rates at startup in preferences dialog 2004-07-05 Niklas Knutsson * Follow ISO 8601 standard for week numbers (glib doesn't) * Sort out approximation with rounding 2004-07-03 Niklas Knutsson * Fix input of numbers in bases > 10 * Is approximate? fixes * usleep() is obsolete. use nanosleep() instead * Terminate threads before exit * Include unistd.h in main.cc for pipes 2004-06-24 Niklas Knutsson * definitions -> subfunctions * save subfunctions * Function::countSubfunctions() * Fix for() * Fix creation of vectors with zero or one component * Pass parse options to function parsing * Variables might contain functions * Fix approximate integer printing * Fix try exact 2004-06-23 Niklas Knutsson * Release v. 0.6 * Do not create a new thread for every calculation and printing 2004-06-21 Niklas Knutsson * ... 2004-06-18 Niklas Knutsson * Continue converting to new internal structures 2004-06-14 Niklas Knutsson * Continue converting to new internal structures 2004-05-25 Niklas Knutsson * Converting to new internal structures 2004-05-12 Niklas Knutsson * New internal structures (Manager -> MathStructure) 2004-04-05 Niklas Knutsson * Find linear function * Do not automatically recalculate on precision spinbutton update and add recalculate button to avoid annoying problems * More multiple root updates * Do not just clear the window, clear the pixbuf too * MatrixArgument->type should not return TEXT_ARGUMENT * Multiple roots updates 2004-04-04 Niklas Knutsson * Put in some restrictions and enable multiple roots * Disable multiple roots * Remove 0 == any number from Manager->equals * try x^(y+z) = x^y*x^z and x^(yz) = x^y^z 2004-04-03 Niklas Knutsson * Capitulate in search for exact as long as possible to fix alternatives * Recalculate directly on angle unit change * Enable multiple roots again * Do not ignore unsolvable comparison * Remove imaginary or real part present because of approximate floating point numbers * Do not display errors for arguments in exact precalculation * Do not display extra trailing zeros * Make comparison between floats in lower precision (but not less than user defined precision) * Fix printing of toplevel negative complex number * Return -(x^(1/3)) for (-x)^(1/3) 2004-04-02 Niklas Knutsson * Remove integrate parts that does not work * Do not crash on i^4 * Disable broken multiple roots 2004-04-01 Niklas Knutsson * Hyperbolic and inverse does not take angle arguments * Fix raise by matrix * Fix raise by alternatives * Fix drawing of function 2004-03-31 Niklas Knutsson * More solve work * Fix sorting of alternatives * Fix wrong add alternatives to alternatives logic * Clean after multiplication raise... (serious bug) * Quadratic equations * Non-giac solve function and automatic "solving" of comparisons * Better comparison equals printing * Minimal non-giac integrate function 2004-03-30 Niklas Knutsson * Finance -> Economics/Finance * Demand Elasticity function * Fix that all arguments wanted text after function editing * Free temporary composite units * Fix sin(x)/tan(x) * No (+ -) in printing with complex numbers * Fix sorting of complex numbers 2004-03-29 Niklas Knutsson * Release v. 0.5 * More extensive, verbose and fault-tolerant roman input 2004-03-28 Niklas Knutsson * Set exact button for edit variable * Fix diff() with power without x * Fix compilation with gtk+ < 2.3 * Do not crash on abort sum() (memory leak is better) * Change line width instead of drawing multiple lines * Use barckets instead of parenthesis when drawing matrix * Use commas for vector drawing * Fix matrix text printing 2004-03-27 Niklas Knutsson * Do not let user disable loading of global definitions * Do not raise if makes approximate in exact mode * Cleanup unused functions * Fix hypotenuse and make non-builtin * Automatically act on "calculate variables" * Set e as default second argument in log() 2004-03-26 Niklas Knutsson * time() * week(), weekday(), year(), month(), day() * Allow "today" for dates * Use both localized and non-localized "to" * Sexagesimal number display * Fix prefixes with simple display format * Sexagesimal number input * (2 > 0) + (2 > 0) = 2 * (2 > 0) * Polynomial division refinements 2004-03-25 Niklas Knutsson * Roman numerals * Polynomial division 2004-03-24 Niklas Knutsson * Fix printing of complex numbers with negative imaginary part and no real part * re() and im() * Fix unit conversion * Imperial and U.S. capacity units * Fix nested product() and sum() * Correct treatment of (), "", '', and {} in text argument 2004-03-23 Niklas Knutsson * Symbols for sum, product and ohm * derangements() * sum() and product() corresponding to the signs * sum() -> total() * Reorganisation of function categories 2004-03-22 Niklas Knutsson * Complete convert to best unit 2004-03-21 Niklas Knutsson * Make result context menu context sensitive * Protect intValue and longIntValue against overflow * Fix printing of exponent 1E... * Convert to best unit (beginning) * Convert to base units 2004-03-20 Niklas Knutsson * Define sin and cos as expressions * e^(i*pi) = -1 ... * ln -1 = i*pi, ln i = i*pi/2, ln -i = -i*pi/2 * permanent() * Print short currency unit before value * Factorize independent of giac * Make my own derive function default 2004-03-19 Niklas Knutsson * asec, acsc, acot, sech, csch, coth, asech, acsch, acoth * cis * As we now have complex number, define inverse trigonometric functions as expressions * sec, csc, cot * "CAS" -> "Calculus" * Update my own derive function and enable it if giac is not used * Fix ln() argument so that e can pass through 2004-03-18 Niklas Knutsson * Show error when custom condition is not met * area, ascii and char functions * Limits function should accept negative numbers for end. Fixes trimmed, weighted and winsorized mean. * Nicer text printing of matrices and vectors 2004-03-17 Niklas Knutsson * Save size of history dialog * Show a nice little help message the first time Qalculate! is started * Update Swedish translation * "quaert" -> "quart" * Do not insert parenthesis when completing if they already are there * New error message when matrix has no inverse * Make abort messages localized and nicer * Limit width of result display text * Use transparent pixbuf for result to not look ugly with pixmap themes * Support newer Giac versions 2004-03-16 Niklas Knutsson * Serious try to fix the localized decimal point and comma once and for all * Use [] for vectors and matrices * Use Page Up and Page Down for expression history instead to allow completion to use Up and Down keys * huh! do not sort functions. * "European 30/365" -> "European 30/360" * Fix date calculations * Add "allow_complex" property for number arguments * Fix abs (for complex numbers) 2004-03-15 Niklas Knutsson * Handle CLN errors better * Font selection for expression entry * Replace Fraction and Integer with new Number class 2004-03-12 Niklas Knutsson * Set selected font in custom font dialog * Save time by first destroying completion then updating list then creating new completion on update * Do not crash when updating completion after new variable * Bring up user interface as soon as possible * Make completion block work * Move recent objects to to the top of object menus * "buttons" -> "keypad" * Completion finished * Ugly fix to not complete on completed * Add units to completion if not composite * Use g_utf8_next_char and g_utf8_prev_char 2004-03-11 Niklas Knutsson * Advanced completion in expression * Popup menu for resultview 2004-03-10 Niklas Knutsson * Lower default precision * Make history button a regular button * Reworked GUI -- menubar, expander, history window... * Release 0.4.2a * Set correct name on separator again * Fix some compiler warnings * Fix compilation without Giac 2004-03-08 Niklas Knutsson * Release 0.4.2 * Proofread manual * Allow currencies to be put in front of quantity * Cent, yen, pound and dollar signs * Remove debug output related to Giac * Fix some troubles printing complex numbers 2004-03-07 Niklas Knutsson * Update Swedish translation * First manual draft finished * Remove compiler warnings 2004-03-06 Niklas Knutsson * Gnuplot does not like quotation signs * Do not abort when locale not supported by C library 2004-03-05 Niklas Knutsson * Fix unit conversion of ex. ch^2 to acre * Some menu fixes * More user documentation 2004-03-04 Niklas Knutsson * Move calculate multiple roots option to result menu * Move unit display options to a unit display submenu * Begin writing the manual * Add help menu item if libgnome is available * Add build structure for gnome style user documentation 2004-03-03 Niklas Knutsson * Fix exponential display in non-fractional mode with negative exponents * Fix big mistake in log (if negative exact result, returned zero) * Use "tab" for tab ("\t") a separator in load 2004-03-01 Niklas Knutsson * Load CSV file as matrix function (load) * File argument * Replace localized decimal point with dot in plot data * Save history (20 rows) * Expression entry history * "Save Result" -> "Store Result" 2004-02-28 Niklas Knutsson * Calculate command line expression 2004-02-26 Niklas Knutsson * Release 0.4.1 * Fix parsing of text arguments * Replace strptime with g_date_set_parse 2004-02-24 Niklas Knutsson * Destroy widgets after autoconnect 2004-02-19 Niklas Knutsson * Use the new file chooser * "Select file to import" --> "Select file to export" 2004-02-18 Niklas Knutsson * Release 0.4 * Fix tanh 2004-02-15 Niklas Knutsson * Reenable checks for arguments that results in infinity * Fix comparison with complex numbers (not solvable) 2004-02-12 Niklas Knutsson * Add giac functions in functions.xml 2004-02-11 Niklas Knutsson * Fix binomial arguments * Update Swedish translation 2004-02-10 Niklas Knutsson * Remove PACKAGE and VERSION warnings with giac * Permutations and combinations 2004-02-09 Niklas Knutsson * Start even if gnuplot is not present 2004-02-08 Niklas Knutsson * Complex numbers: log, pow, root 2004-02-07 Niklas Knutsson * Filter out all duplicate errors * Fix compilation without giac * Forward: "Copy Result" menu item * Forward: Correctly calculate divison by root with multiple solutions. * Forward: Remove unused non-portable function. 2003-11-02 Niklas Knutsson * Complex numbers... * Complex number printing * Use Newton's Binomial Formula for raised addition manager * Binomial function * Manager::set(const Integer*) * Start work on complex numbers 2003-10-30 Niklas Knutsson * Show argument names when too few arguments * Really no need to have exp, exp2 and exp10 as builtins * Log tweaks * More trigonometric tweaks * Giac might actually return -1*1 (we prefer -1) * Catch giac errors * Define tan, asinh, acosh, atanh as sin(x)/cos(x), log(x+sqrt(x^2+1)), ... * Handle pi correctly in trigonometric functions * Delay calculation of inexact values * New variable manager 2003-10-29 Niklas Knutsson * Giac function * Factorize in result menu * New functions: diff, integrate, solve * Giac support * Do not crash when printing a manager with matrix 2003-10-27 Niklas Knutsson * Release Qalculate-GTK version 0.3.1 * Left over missing setPrecise() in builtin functions * Fix printing of function manager * Fix display of only number in numerator * Parenthesis adjustments * Update swedish translation * More extensive error handling for misplaced operators * Replace "**" with "^" * Fix parenthesis in Manager::print() * Recreated Manager::print() from gtk drawing function * Optional prefix for denominator * Reworked composite unit printing * Reworked prefix handling * Reworked drawing of MULTIPLICATION_MANAGER * Fix loadLocalDefinitions() * Year and Century units * Fix parsec, light year, astronomical unit, and torr * Plural fixes * Draw unit names with "_" replaced by space 2003-10-24 Niklas Knutsson * Compability fixes for Unit.cc * change strold to strol in HEX() * remove ld2s() * provide another workaround for strptime * some warnings left * remove llpow() as it only creates problems * __USE_XOPEN for strptime * Replace insert(0, 1, ...) with insert(begin(), 1, ...) * Fix ALL warnings * Ignore blanks in BIN(), OCT(), HEX(), BASE() * Fix number bases dialog 2003-10-23 Niklas Knutsson * Do not use scandir as Solaris does not support it * Access hash_map header properly * Update POTFILES.in for new glade files * Remove #include from Calculator.h 2003-10-22 Niklas Knutsson * Split up glade file * minute -> min * Now function can have the same name as a unit or variable, but units and variables cannot have the same name 2003-10-21 Niklas Knutsson * Release Qalculate-GTK version 0.3 * Disable convert in units dialog when no unit selected * Revert fractional button to use combined fractional display, but treat it as normal fractional display for regular text * Draw parenthesis around not alone manager (not power) with childs in denominator * Add a bit more space behind italic text to not cut tall chars off * More drawing fixes 2003-10-20 Niklas Knutsson * Include all bytes in unicode char for unknown variables in setFunctionsAndVariables() * Fix Manager->print(), and as below * Display x^-y as 1/x^y in non-scientific mode * Draw multiplication manager fixes * Put menus before items * More TODO * Also add icon.xpm * Add qalculate.h to Makefile.am to get it included in dist * Accel fixes and additions * Move "convert number basis" to the other menu * Reorder some buttons to follow HIG * Make convert unit dialog non-modal 2003-10-19 Niklas Knutsson * Display ^0.5 as square root * Fix display of ugly -x^-0.5 (still ugly but no duplicate ones and spaces) * Stop display errors a bit more... 2003-10-18 Niklas Knutsson * Do not delete selection on sqrt button clicked but act as with the other functions * Make answer variables a special case which cannot be edited and does not display result in variable dialog * Change "first"/"second" axis to "primary"/"secondary" * Put axis after smooth * Fix rms(), stdev(), stdevp() * Fix error in setFunctionsAndVariables that stopped unknown variables after something was set * Remove CVS version title * Write something in AUTHORS and NEWS * Hidden property in function and unit edit dialogs * Hide some annoying composite units (m/m and m2/m2) * Hide hidden items in menus * New hidden property for ExpressionItem (meant for some composite units and sub functions) 2003-10-17 Niklas Knutsson * Finally implement angle units and allow direct specification of angle unit in trigonometric functions * rem and rad units renamed to rem_radioactivity and rad_radioactivity * Some swedish translation updates * Some tooltip updates * Some TODO updates * Fill in the last argument titles and add some descriptions * Set min arguments to zero if lower (and max to -1) * Argument names and descriptions for matrix and vector functions * Rename title "Power" with "X raised to Y" to solve translation conflict with the category "Power" * Fix 0^0 warning 2003-10-16 Niklas Knutsson * If add argument button is not sensitive, modify argument instead on enter * Fix arguments for process() * Titles for functions and arguments in utilities category * Put buttons in first tab * Default to show buttons * Remove quotes from default values in insert function dialog * Matrix multiplication error message * Better error message for misplaced operators * Updated swedish translation * More argument names * Fix category selection after editing * Argument names for all geometry functions * Do not use "free" for argument == NULL but printlong() of default argument 2003-10-15 Niklas Knutsson * Do not add extra space after matrix in GTK widget * Update rank() and sort() to new comparison that not only allows fractions * Update min() and max() to new comparison that not only allows fractions * Go back to builtin sum() function as sum() is used often and csum() is rather slow * eurocent and cent * Fix yearfrac() for basis = 1 * More TODO * Category "Matrices" -> "Matrices & Vectors", "Financial" -> "Finance" 2003-10-13 Niklas Knutsson * Finally make class variables in Manager protected * setPrecise(fraction()->isPrecise()) after operation directly on Manager::fraction() * Change output of "log" button to log10 * Write more in TODO 2003-10-11 Niklas Knutsson * Update plot on add/modify/remove * Use only one gnuplot process/window and close it on exit * Fix crach on create new variable dialog * Delete the submenus, not the menu item, when updating * Do not update treeviews if not created * Save plot settings * Switch to enums for style and smoothing 2003-10-10 Niklas Knutsson * More plot stuff * Change step to steps * Make that the second tab page is realised * Save plot as postscript, eps, png, svg, fig or latex * Set a nicer font for gnuplot * Plot dialog: tabwidget, paired matrix, save * Plots: logscale, style, separate smoothing for each line, title, grid, color, linewidth, borders * Set timeout for wget and error on fail * Check if wget and gnuplot is available 2003-10-08 Niklas Knutsson * Plot dialog * Lots of plotting stuff * Hide on destroy and delete events for non-modal windows * Place terms with negative sign in the back when not using scientific sorting * Do not display more than one minus * Change compare() in Manager to sortCompare() and add real compare() function * Plot vector * Plotting with gnuplot * Fix crash with no argument definitions and variable number of arguments * Do not recreate currencies, just change the relation 2003-10-07 Niklas Knutsson * Fully enable builtin units * Do not print the same error message more than once * Fetch exchange rates from ECB * Fix crash by removing new line for alternative manager and gettextize the "or" while we are at it * Root functions non-abs * Fix argument check on alternative manager * Remove unnecessary gtk_main_iteration() as they create lots of problems * Do not unref wrong Manager in conversion in units dialog * Fix check of arguments in functions with unlimited number of arguments * Remove (again) prepended "1" for composite units * Fix prefixes 2003-10-06 Niklas Knutsson * Allow disabling of multiple roots * "Recently Used"-menu * Fix rounding of negative numbers * Fix adding ALTERNATIVE_MANAGER to ALTERNATIVE_MANAGER * Change GUI code to allow unrestrained category depth * Load builtin unit definitions even if we have no such * Do not write active and precise attributes when true * Organize definitions files in a category tree structure * Make execute button in insert function dialog non-stock * Change button text to "Insert" * Fix insert function with undefined arguments * Use a frame for description in insert function dialog 2003-10-02 Niklas Knutsson * Use & for & * Fix NOT * Fix signedness function (and comparisons) * Replace "<" with "<" and ">" with ">" * Display NOT_MANAGER * Make it configurable in preferences * Do not use annoying prefixes (hekto, deka, centi, deci) by default * Change unit conversion from printing value to using a value id as was originally intended * Delete string alternative "," when switching locale * #ifdef out fenv.h and floating point exceptions as they are only obstructing portability when using CLN * Cleanup * Warning function * Disable message function for now 2003-10-01 Niklas Knutsson * Updated swedish translation * Do not actually lower the precision below 10 to prohibit overflow * Do not act when setting the initial value of spinbuttons * Precision and decimals dialog need not be modal * Actually load the correct nodes for the locale * New simpler algorithm for reading function arguments, which handles citations correctly * Accept zero length strings * Concatenate and Length functions * Save function 2003-09-30 Niklas Knutsson * Execute expression when updating result display if expression has changed * Do not display more than 1500 digits in result display widget and not more than 500000 digits in history (works for me at least) * Restrict display time in variables dialog * Restrict value length if variables dialog * Delay calculation of variables * Remove signs menu * Try to speed up determinant (not very succeful) 2003-09-29 Niklas Knutsson * A little icon for the window * Update display outside of thread * Do not reverse order when transforming manager * Merge boolean operations into Manager class to enable unsolved operations * Make sure that thread actually is canceled before resuming * Change log to log10 and logn to log * Ignore syntax error function without parentesis are space before argument * New better algorithm for Calculator::setFunctionsAndVariables() * Nicer functions, variables and units dialogs * Show a nice progress dialog * More information (syntax and arguments) in description in functions dialog * Sort categories in edit dialogs 2003-09-27 Niklas Knutsson * Safer threads * Switch unit->name() to short name and add singular to enable translation * Enable xml data translation * Use less attributes in xml * Implement GUI editing of argument rules * Replace empty optional value with default value * Fill in default values in insert function dialog * Add ability to abort long calculations * ...and slow result display 2003-09-25 Niklas Knutsson * New condition for functions which can test the relation between arguments * Error function * Boolean operators * For (loop) function * Fix crash on delete inactive definition in GUI * Definition edit fixes 2003-09-24 Niklas Knutsson * Move defintions to library and PACKAGE_DATA_DIR/qalculate * Place local definitions in ~/.qalculate/definitions and load everything in that directory * XML definitions files * Update function edit dialog to new argument definitions, and turn function expression entry into a textview * Furthering argument definitions: new Argument classes that tests type and value * Fix parenthesis madness and handle missing left parenthesis 2003-09-22 Niklas Knutsson * ExpressionItem::isRegistered() * Once again constants -- new DynamicVariable class that recalculates value when precision has changed * Fix ...E-... * Fix root for negative results * Fix log for negative results * Fix display of ...E... * Fix infinite loop with prefixes <= 10E-1 * Check file format and version of definitions file 2003-09-21 Niklas Knutsson * Fix error message when too many arguments * Change "years_between_dates" to "yearfrac" * Fix day counting basis (hopefully gnumeric has done it right) * More financial functions * Fix mod, rem and frac * Better RPN support 2003-09-20 Niklas Knutsson * RPN Mode * Clean up EqItem.cc * Add variables for constants functions * Load definitions in exact mode * Reset (and restore) mode when loading definitions * Lots of tooltips (too many perhaps?) * Some definitions fixes * Function edit dialog: turn argument entry into a list view and add argument type * Do not locally save global deactivations 2003-09-18 Niklas Knutsson * Big restructuring to fix editing of global definitions, including deactivation of definitions and a new virtual ExpressionItem class * More error messages in matrix functions * Check if matrix operations were successful * Correct bad setPrecise(false) call in matrix * Speed up csum function for large vectors in statistical functions * Fix addition^integer * Fix display of 1/-x * Fix sqrt() * Fix display of fraction with 'E' * Fix display of 5*5^x * Fix detection of long prefixes * Fix 'E' (now we can have it in names) * Type label, spin buttons, date picker etc. in insert function dialog * Argument type 2003-09-15 Niklas Knutsson * Fix insert function dialog * Add scrollbars to table in matrix edit dialog * CSV file import * Lots of statistical functions: range, harmonic mean, geometric mean, trimmed mean, winsorized mean, quadratic mean, quartile, decile, percentile, interquartile range, variance, standard error, mean deviation, pearson, spearman's rho, covariance, correlation, pooled variance, paired t-test, unpaired t-test... * Add limits to custom sum function and allow references to other than current element (x_i-1) * Limits * Clean up base conversion functions * Fix If function 2003-09-11 Niklas Knutsson * Sort function * Buttons to set if precise in variable and unit edit dialogs * Exact mode * Use vectors in max, min, mode and median * Make constants functions for more flexible precision 2003-09-10 Niklas Knutsson * Change behavior of decimals settings * CLN support (requirement for now, in place of GMP) * Disable gnome support in glade file 2003-09-09 Niklas Knutsson * More accurate roots using Newton's Method with the libc function as initial value * Require GMP (it is not a priority right now to fix my own integer implementation) * GUI for edit/create matrix/vector * Remove repaint artifacts * Rank function 2003-09-08 Niklas Knutsson * Pearson Correlation and Spearman's rho (still needs rank function) * Replace hardcoded statistical functions * Utility functions: csum (Custom sum), process (Process vector components) * Vector (\v) in user functions * Function function for immediate creation and execution of a custom function * Indicate infinite sequence of decimals (configurable) * Custom font selection * Vector * Better alignment 2003-09-07 Niklas Knutsson * Use GtkDrawingArea to make result display nicer * More matrix functions: cofactor, adjoint, inverse 2003-09-03 Niklas Knutsson * Matrix functions: determinant (det), identity, transpose, element, columns, rows, matrix * Multiple solutions (4^0.5 = 2 or -2) * More work on matrices 2003-09-02 Niklas Knutsson * Beginning of matrix support * Fix zero division 2003-09-01 Niklas Knutsson * factorial function and ! * frac and int functions * Menu items for fractional representation * Turn "use prefixes" into check menu item 2003-08-31 Niklas Knutsson * Move builtin functions to fraction system * Reactivate display modes, decimals and precision * Use GMP if available in Integer class (much faster) 2003-08-30 Niklas Knutsson * Show if result is exact or not * Arbitrary precision * Move from long double to Fraction 2003-08-24 Niklas Knutsson * Decimal string to fraction * Date functions (for financial functions) * Fixes 2003-08-23 Niklas Knutsson * Localized dot and more 2003-08-22 Niklas Knutsson * Fractions and restructuring 2003-08-20 Niklas Knutsson * CALCULATOR macro (removes Calculator object from all classes) * New Prefix class and new get/add prefix functions; prefixes stored in a sorted vector * New get Function/Variable/Unit(index) functions 2003-08-20 Niklas Knutsson * Fraction button * Fraction Manager * New Fraction class 2003-08-19 Niklas Knutsson * Add title label to insert function dialog * Remove duplicate adding of answer variables, and remove from global definitions file... and gettextize 2003-08-18 Niklas Knutsson * Qalculate! version 0.2 released * Last minute fixes * More unicode * Fix display of exponent of exponent * Put unicode chars on buttons in code and add option to disable unicode signs * Unicode math operators * Save version info to configuration file * Update version number 2003-08-17 Niklas Knutsson * Only put "1 " in front of unit in toplevel * Fix 5*5^m (endless loop in Manager::convert) * Unscientific mode gives inexact result display -- disable for now * Disable installation of old German translation (will enable again after v0.2) * Create en_GB and en_US locales to get that nice square root sign * Do not shrink result label on clear * Do not expand menu buttons * Make functions dialog a bit nicer * Make units dialog a bit nicer * More energy and pressure units * Some constants * Write variables to file with maximum precision * Show variable title in menu and tree * Unit expression conversion fixes * Make operators wrap selection in parenthesis instead of deleting it, thus they operate on the result after execute * Insert ^ directly instead of waiting for another key press. * Fix annoying repositioning of text cursor in n-bases dialog * Update conversion in units dialog after focus out event in entries * Remove empty parenthesis after zero argument functions * Fix disabling of units * Fix unclosed brackets * restrict abs() to numbers * Change Function::name(string), Unit::title(string), etc. to setTitle(), setName() 2003-08-16 Niklas Knutsson * Google style in expression conversion (ex. 5 m to ft = 16.4 ft) * Small unit conversion fix (1 km/1 kg => 1 km/kg). * More units. * Fix loading of alias unit that is defined before its base unit in file * Modify priotrity for calculations so that inexplicit multiplication is calculated before division (2/2(x) = 2/(2*x)) and functions (sin 2x(x) = sin (2x*x), but sin(2x)(x) is still sin(2x)*x) * Some restructuring * Unbreak brokeness from last fix * Move three small dialogs to Glade * Convert button 2003-08-15 Niklas Knutsson * Fix bracket madness breaking unbrackened division (!) * About dialog 2003-08-14 Niklas Knutsson * Fix loading of argument names for builtin functions * Do not add argument names in code for builtin functions, read from definitions file instead * Fix crash when creating new unit * Disable OK button for editing global definitions until structure is sorted out * Beautify dialogs * Functions, variables and units buttons in main window * Sorting menus * Tree lists implemented for units, variables and functions dialogs * Submenus implemented for unit, variable and function menus * Connect "convert to"-button in unit managaer to new conversion system * Complete set of SI units * Various fixes 2003-08-13 Niklas Knutsson * Remove duplicate functions * Do not save unchanged global definitions in users definitions files * Selectable prefix in result * Fully functional unit conversion! 2003-08-12 Niklas Knutsson * Interpret "apple" as an unknown variable named apple * Add base conversion dialog * Beautify units dialog * Store pointer to unit in GUI to simplify the Unit/ComplexUnit mess * Enable editing/creation of composite units * New Greatest Common Divisor (gcd) function * First try at differentiation * Fix division 2003-08-11 Niklas Knutsson * Beautify insert function dialog * Populate category combos * Turn base unit combo into entry as it probably is not a good idea to fill the combo with all units * Gladeify the variable and function edit dialogs hidden callbacks.cc (gladeification finished?) * Beautification of dialogs * Huge gladeification of signals and widget references 2003-08-10 Sven Herzberg * data/qalculate.glade: don't know what exactly, but i'm sure that we got rid of one c dialog more * src/callbacks.cc: * src/interface.cc: 2003-08-10 Niklas Knutsson * Use for all exponents for consistency * New elegant and intelligent sorting, not only for internal purposes * Updated swedish translation. * Gettextized error messages. * Updaterad Calculator::error(). * Only enable prefixes in front of units * Fix disable/enable variables/functions/units/unknown * Found true evil in Manager::sort(). This should solve many problems. :-) * Enable binary output for larger numbers * Fix nested functions * Fix prefix followed be unit * Fix functions without parenthesis * correct widget name (units_option_menu_to_unit) * handle long result by making the window not resizable and the result label wrap 2003-08-09 Niklas Knutsson * Swedish translation * More strings to translate * Binary output * Fix BASE() * Fix prefixes in expression * Added ability to disable unknown variables * Support unsolved function -- now log(x) returns log(x) instead of the result of log(0) * Fix prefix display mode (only use in front of units to avoid confusion and support exponents) 2003-08-08 Niklas Knutsson * Set LC_NUMERIC to "C" to make strold() happy * Minor restructuring in preparation for different decimal points * Comment out debug output. Now (x+y)^50 takes 1 instead of 100 seconds. For those interested, the result of (x+y)^100 is 24287 pixels wide... 2003-08-08 Sven Herzberg * data/qalculate.glade, * src/interface.cc: glade-ified the preferences dialog 2003-08-08 Sven Herzberg * data/qalculate.glade, * src/interface.cc: glade-ified the units dialog * po/de.po: updated translation 2003-08-08 Sven Herzberg * src/interface.cc: removed unneccessary variables 2003-08-08 Sven Herzberg * data/qalculate.glade, * src/interface.cc: glade-ified the variables dialog 2003-08-08 Sven Herzberg * src/interface.cc: removed unneccessary variables 2003-08-08 Sven Herzberg * data/qalculate.glade, * src/callbacks.cc, * src/interface.cc: finished moving the menus 2003-08-08 Sven Herzberg * data/qalculate.glade, * src/callbacks.cc, * src/interface.cc: moving the menus to a (hidden) menubar to solve a warning regarding an accelerator group 2003-08-08 Niklas Knutsson * Move generated menus one step up * Add finalize() after conversion in callbacks.cc 2003-08-08 Niklas Knutsson * Some more fixes that I do not remember * Fix (x+y)^(6+n) * Fix kWs = W^2 * s^2 in Calculator.cc * Do not convert units during the whole calculation, do it in finalize() afterwards instead * Make units work even better. * Move OCT, HEX, BIN and BASE functions to category "Number Bases" 2003-08-08 Sven Herzberg * configure.in: added -Wall stuff again (was just a typo) * src/interface.cc: removed some unneccessary variables from create_window 2003-08-08 Sven Herzberg * data/qalculate.glade: includes the complete main window now * src/callbacks.cc: removed the GtkHSeparator (the're not used anymore) * src/interface.cc: moved the whole main window to the glade file 2003-08-07 Sven Herzberg * data/qalculate.glade: added the expression menu and the result menu * po/de.po: updated translation * src/callbacks.cc: glade updates * src/interface.cc: glade updates 2003-08-07 Sven Herzberg * src/interface.cc, * src/interface.h, * src/main.cc: as the return value of create_window was only used to display the widget, made create_window a void method and display widget from there 2003-08-07 Sven Herzberg * configure.in: added libglade dependency * data/Makefile.am: added glade file * data/qalculate.glade: user interface definition * src/callbacks.cc: removed the extern GtkWidget *window * src/interface.cc: started migration to glade * src/interface.h: started migration to glade * src/main.cc: started migration to glade 2003-08-07 Sven Herzberg * .cvsignore: cvs update has less warnings now * configure.in: added de to ALL_LINGUAS * data/qalculate.desktop.in: fixed the starter * po/.cvsignore: cvs update has less warnings now * po/de.po: updated german translation 2003-08-07 Sven Herzberg * data/Makefile.am: added fixes for kde pre-3.2 (aka stable) 2003-08-07 Sven Herzberg * .cvsignore: cvs update has less warnings now * configure.in: some beautification (will fix -Wall later this day) * data/.cvsignore: cvs update has less warnings now * data/Makefile.am: added desktop file * data/qalculate.desktop.in: desktop file template * po/.cvsignore: cvs update has less warnings now * po/POTFILES.in: added data/qalculate.desktop * po/de.po: added german translation 2003-08-07 Sven Herzberg * src/main.cc: some beautification * src/main.h: made enums from #defines (are the values relevant?) 2003-08-06 Niklas Knutsson * Removed some debug output * Fix (x+y)^5, but unfortunately not (x+y)^6... * Even better unit conversion. * Change Ctrl+V to Ctrl+M for manage variables 2003-08-06 Sven Herzberg * Makefile.am: make dist works now * configure.in: added data/Makefile.am * data/.cvsignore: cvs update has less warnings now * data/Makefile.am: make dist works now, make install too * po/.cvsignore: cvs update has less warnings now 2003-08-06 Sven Herzberg * .cvsignore: cvs update has less warnings now * Makefile.am: added data as subdir * acconfig.h: removed (templates are deprecated) * configure.in: added libtool * data/Makefile.am: added config file installation * po/.cvsignore: cvs update has less warnings now * src/.cvsignore: cvs update has less warnings now * src/Makefile.am: switched to libtool now * src/calclib/.cvsignore: cvs update has less warnings now * src/calclib/Makefile.am: using libtool now 2003-08-04 Niklas Knutsson * Optional arguments for functions * More functions... * Implemented if...then...else function * "config" -> "definition" * Added Execute button to insert function dialog * Added some financial functions libqalculate-0.9.7/missing0000755000175100017510000002557710753066007012537 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 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, 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. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: libqalculate-0.9.7/ltmain.sh0000644000175100017510000060646710752724413012764 00000000000000# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008 Free Software Foundation, Inc. # 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. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION="1.5.26 Debian 1.5.26-1ubuntu1" TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)" # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # Check that we have a working $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, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 ##################################### # Shell function definitions: # This seems to be the best place for them # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $mkdir "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) extracted_serial=`expr $extracted_serial + 1` my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) echo "\ $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.[fF][09]?) xform=[fF][09]. ;; *.for) xform=for ;; *.java) xform=java ;; *.obj) xform=obj ;; *.sx) xform=sx ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$deplibdir/$depdepl" ; then depdepl="$deplibdir/$depdepl" elif test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" else # Can't find it, oh well... depdepl= fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) case " $deplibs" in *\ -l* | *\ -L*) $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;; esac if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then major=`expr $current - $age` else major=`expr $current - $age + 1` fi case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then case $archive_cmds in *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; esac else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then $show "${rm}r $gentop" $run ${rm}r "$gentop" fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) case " $deplibs" in *\ -l* | *\ -L*) $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;; esac if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` else compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` fi ;; * ) compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ char * find_executable (const char* wrapper) { int has_slash = 0; const char* p; const char* p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char* concat_name; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char* path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char* q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR(*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); return NULL; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # 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='$sed_quote_subst' # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # 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 relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \$*\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` else relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: libqalculate-0.9.7/xmldocs.make0000644000175100017510000000603411305546371013434 00000000000000# # No modifications of this Makefile should be necessary. # # To use this template: # 1) Define: figdir, docname, lang, omffile, and entities in # your Makefile.am file for each document directory, # although figdir, omffile, and entities may be empty # 2) Make sure the Makefile in (1) also includes # "include $(top_srcdir)/xmldocs.make" and # "dist-hook: app-dist-hook". # 3) Optionally define 'entities' to hold xml entities which # you would also like installed # 4) Figures must go under $(figdir)/ and be in PNG format # 5) You should only have one document per directory # 6) Note that the figure directory, $(figdir)/, should not have its # own Makefile since this Makefile installs those figures. # # example Makefile.am: # figdir = figures # docname = scrollkeeper-manual # lang = C # omffile=scrollkeeper-manual-C.omf # entities = fdl.xml # include $(top_srcdir)/xmldocs.make # dist-hook: app-dist-hook # # About this file: # This file was taken from scrollkeeper_example2, a package illustrating # how to install documentation and OMF files for use with ScrollKeeper # 0.3.x and 0.4.x. For more information, see: # http://scrollkeeper.sourceforge.net/ # Version: 0.1.2 (last updated: March 20, 2002) # # ************* Begin of section some packagers may need to modify ************** # This variable (docdir) specifies where the documents should be installed. # This default value should work for most packages. # docdir = $(datadir)/@PACKAGE@/doc/$(docname)/$(lang) docdir = $(datadir)/gnome/help/$(docname)/$(lang) # ************** You should not have to edit below this line ******************* xml_files = $(entities) $(docname).xml EXTRA_DIST = $(xml_files) $(omffile) CLEANFILES = omf_timestamp # If the following file is in a subdir (like help/) you need to add that to the path include $(top_srcdir)/omf.make all: omf $(docname).xml: $(entities) app-dist-hook: if test "$(figdir)"; then \ $(mkinstalldirs) $(distdir)/$(figdir); \ for file in $(srcdir)/$(figdir)/*.png; do \ basefile=`echo $$file | sed -e 's,^.*/,,'`; \ $(INSTALL_DATA) $$file $(distdir)/$(figdir)/$$basefile; \ done \ fi install-data-local: omf $(mkinstalldirs) $(DESTDIR)$(docdir) for file in $(xml_files); do \ cp $(srcdir)/$$file $(DESTDIR)$(docdir); \ done if test "$(figdir)"; then \ $(mkinstalldirs) $(DESTDIR)$(docdir)/$(figdir); \ for file in $(srcdir)/$(figdir)/*.png; do \ basefile=`echo $$file | sed -e 's,^.*/,,'`; \ $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/$(figdir)/$$basefile; \ done \ fi install-data-hook: install-data-hook-omf uninstall-local: uninstall-local-doc uninstall-local-omf uninstall-local-doc: -if test "$(figdir)"; then \ for file in $(srcdir)/$(figdir)/*.png; do \ basefile=`echo $$file | sed -e 's,^.*/,,'`; \ rm -f $(DESTDIR)$(docdir)/$(figdir)/$$basefile; \ done; \ rmdir $(DESTDIR)$(docdir)/$(figdir); \ fi -for file in $(xml_files); do \ rm -f $(DESTDIR)$(docdir)/$$file; \ done -rmdir $(DESTDIR)$(docdir) libqalculate-0.9.7/README.translate0000644000175100017510000001621311305546371014000 00000000000000The Qalculate! developer(s) are thankful for every possible translation and willing to answer any questions or help with any problems you may have as a translator. Please read through this document before starting the translation. Qalculate! is split up in one library package (libqalculate, which also includes the text interface) and five GUI packages -- qalculate-kde for KDE, qalculate-gtk for GTK+, and the other for small GTK+ utilities (with only a total of 46 messages). The GUI packages contains translations for the GUI text as usual in the po directory. The libqalculate translations is split up in two -- translation of error messages, type information and the text interface in po, and translation of definitions of functions, variables, units, etc. in po-defs (merged with the data files in data). The best strategy is probably to start with qalculate-gtk or qalculate-kde. These contain approximately 700 messages which are essentially the same in both GUI's. The most difficult and demanding task is no doubt the translation of all definitions. It's by no means necessary to translate every package. The source packages for libqalculate, qalculate-gtk, qalculate-bases, qalculate-currency and qalculate-units do not include any .pot files. Instead the pot file is created with "../intltool-update --pot". You can then run "msginit --locale=??" or just copy the pot-file to ??.po. The translation file is updated with "../intltool-update language code" (ex. ../intltool-update sv, for the Swedish translation) from the po directories. intltool-update is generated when ./configure is run from the top package directory. qalculate-kde uses a slightly different system and the package includes a pot-file which is copied and edited to create a new translation. The translation of the libqalculate message strings in po-defs require some further knowledge. These are merged with the xml data files in libqalculate/data. The different types of message strings in these files are: Data objects: Values of text properties Data sets: Categories, titles, names, descriptions, property titles, property names and property descriptions Functions: Categories, titles, names, descriptions and argument titles Variables/constants: Categories, titles and names Units: Categories, titles and names To distinguish equal text strings with different meaning (for example "Mercury" as a planet and as a chemical element), some text strings is preceded by "!type!" (for example "!units!" for units). Everything between and including a exclamation mark in the beginning and the second exclamation mark is not displayed in the application. Translators do not need include to include "!type!" in the translation. Names require some special considerations from the translator. The names are used to reference an object in a mathematical expression and to display them in a result. An object can have any number of names but each must be fully unique, with the exception that functions can have names used by other types of objects (for example "min" is used as a name for the minute unit but also for a function returning smallest value in a vector). The translation does not need to have the same number of names as the the untranslated object. There are some characters which are reserved for other purposes (mainly mathematical operators) and may not be included in names. These are - ~ + - * / ^ & | ! <> = ' @ ? \ { } " . , ; : ( ) [ ], - spaces, tabs and newline characters, and - unicode signs for operators. No name may begin with a digit and units are not allowed to contain a digit anywhere. All names of a object is contained in one text string. The names are separated by commas (','). The order of names decides their priority, which name is by default used for display and input. Each name may be preceeded by a a number of properties before a colon (':'). The format of the names strings is thus [properties1:]name1,[properties2:]name2,... The possible properties are - 'a': the name is an abbreviation, - 'c': the name is case-sensitive, - 'i': the name should not be presented to the user for input (but looks good for display), - 'p':the name is in plural form, - 'r': the name is used as reference, - 's': the name ends with a suffix (the text after the last '_' will displayed as subscript with the '_' removed, often used in combination with 'i'), and - 'u': the name contains a unicode sign. All properties is off by default, except for names with only one sign which are interpreted as abbreviations by default, and for abbreviations which by default are case-sensitive. A property can be turned off by preceeding it with a minus '-'. The reference property tells that the name will be available to all users regardless of the language used. If a reference name is not included in the translated list of names, it is appended at the end by the program. The translator can inlcude the reference names to select the position of the name and change all properties except 'r', 'c' and 'u'. All untranslated first names has the reference property explicitely specified, so names can easily be distinguished from other text strings by the preceeding properties and colon. Most functions and variables have only one name. Units usually have an abbreviated name, a normal name and a name in plural form. Units should always have a name in plural form if it differs from the singular form. Names string that is the same translated as untranslated should preferably not be copied but left empty or replaced by "-" (so that it is marked as translated), to allow the size of the definitions data files to be reduced. Property names works like the names described above except that 'r' for reference is the only possible property. Below follows some examples from the Swedish translation. msgid "ar:m,meter,p:meters,metre,p:metres" msgstr "a:m,meter" The meter unit has the abbreviated reference name "m" (case-sensitive), a normal name "meter" and a plural form "meters". Meter does also in addition have a different spelling in English. The Swedish name for meter is the same as in English but the plural form is the same as the singular, and no alternative spelling exist. msgid "r:mean" msgstr "medel" The name of the mean function is translated to "medel", but since "mean" is specified as a reference name it is appended by the program as the second name (results in "medel,r:mean"). msgid "ar:SEK" msgstr "a-c:kr,a:SEK,krona,p:kronor" The English version can only use the three character code for the Swedish currency since the other names can be used for other currencies, but the translation can assume that the user refers to the local currency. msgid "-r:billion" msgstr "miljard,p:miljarder" The constants for large numbers follows two different systems in different countries. With the "short scale" billion means 1e9, while it with the "long scale" means 1e12. Therefor, these constants do not have any reference name. The short scale is used in most English-speaking countries, while in Sweden the long scale is used. msgid "r:sqrt" msgstr "-" The untranslated string is kept. qalc commands and options to commands in libqalculate/po/ follows the same principles as reference names, meaning that the untranslated message string is kept in addition to the translated. libqalculate-0.9.7/config.h.in0000644000175100017510000000462211320655031013137 00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* always defined to indicate that i18n is enabled */ #undef ENABLE_NLS /* The package name for gettext */ #undef GETTEXT_PACKAGE /* Define to 1 if you have the `bind_textdomain_codeset' function. */ #undef HAVE_BIND_TEXTDOMAIN_CODESET /* Define to 1 if you have the `dcgettext' function. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES /* Define if the text port uses readline */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H /* Define if CLN can be used */ #undef HAVE_RECENT_CLN /* 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 /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* The directory in which qalculate's locale data will be stored */ #undef PACKAGE_LOCALE_DIR /* Define to the full name of this package. */ #undef PACKAGE_NAME /* 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 /* Version number of package */ #undef VERSION libqalculate-0.9.7/intltool-extract.in0000644000175100017510000005565411320655025014776 00000000000000#!@INTLTOOL_PERL@ -w # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*- # # The Intltool Message Extractor # # Copyright (C) 2000-2001, 2003 Free Software Foundation. # # Intltool 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. # # Intltool 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., 675 Mass Ave, Cambridge, MA 02139, 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. # # Authors: Kenneth Christiansen # Darin Adler # ## Release information my $PROGRAM = "intltool-extract"; my $PACKAGE = "intltool"; my $VERSION = "0.37.1"; ## Loaded modules use strict; use File::Basename; use Getopt::Long; ## Scalars used by the option stuff my $TYPE_ARG = "0"; my $LOCAL_ARG = "0"; my $HELP_ARG = "0"; my $VERSION_ARG = "0"; my $UPDATE_ARG = "0"; my $QUIET_ARG = "0"; my $SRCDIR_ARG = "."; my $FILE; my $OUTFILE; my $gettext_type = ""; my $input; my %messages = (); my %loc = (); my %count = (); my %comments = (); my $strcount = 0; my $XMLCOMMENT = ""; ## Use this instead of \w for XML files to handle more possible characters. my $w = "[-A-Za-z0-9._:]"; ## Always print first $| = 1; ## Handle options GetOptions ( "type=s" => \$TYPE_ARG, "local|l" => \$LOCAL_ARG, "help|h" => \$HELP_ARG, "version|v" => \$VERSION_ARG, "update" => \$UPDATE_ARG, "quiet|q" => \$QUIET_ARG, "srcdir=s" => \$SRCDIR_ARG, ) or &error; &split_on_argument; ## Check for options. ## This section will check for the different options. sub split_on_argument { if ($VERSION_ARG) { &version; } elsif ($HELP_ARG) { &help; } elsif ($LOCAL_ARG) { &place_local; &extract; } elsif ($UPDATE_ARG) { &place_normal; &extract; } elsif (@ARGV > 0) { &place_normal; &message; &extract; } else { &help; } } sub place_normal { $FILE = $ARGV[0]; $OUTFILE = "$FILE.h"; my $dirname = dirname ($OUTFILE); if (! -d "$dirname" && $dirname ne "") { system ("mkdir -p $dirname"); } } sub place_local { $FILE = $ARGV[0]; $OUTFILE = fileparse($FILE, ()); if (!-e "tmp/") { system("mkdir tmp/"); } $OUTFILE = "./tmp/$OUTFILE.h" } sub determine_type { if ($TYPE_ARG =~ /^gettext\/(.*)/) { $gettext_type=$1 } } ## Sub for printing release information sub version{ print <<_EOF_; ${PROGRAM} (${PACKAGE}) $VERSION Copyright (C) 2000, 2003 Free Software Foundation, Inc. Written by Kenneth Christiansen, 2000. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. _EOF_ exit; } ## Sub for printing usage information sub help { print <<_EOF_; Usage: ${PROGRAM} [OPTION]... [FILENAME] Generates a header file from an XML source file. It grabs all strings between <_translatable_node> and its end tag in XML files. Read manpage (man ${PROGRAM}) for more info. --type=TYPE Specify the file type of FILENAME. Currently supports: "gettext/glade", "gettext/ini", "gettext/keys" "gettext/rfc822deb", "gettext/schemas", "gettext/scheme", "gettext/xml", "gettext/quoted", "gettext/quotedxml" -l, --local Writes output into current working directory (conflicts with --update) --update Writes output into the same directory the source file reside (conflicts with --local) --srcdir Root of the source tree -v, --version Output version information and exit -h, --help Display this help and exit -q, --quiet Quiet mode Report bugs to http://bugzilla.gnome.org/ (product name "$PACKAGE") or send email to . _EOF_ exit; } ## Sub for printing error messages sub error{ print STDERR "Try `${PROGRAM} --help' for more information.\n"; exit; } sub message { print "Generating C format header file for translation.\n" unless $QUIET_ARG; } sub extract { &determine_type; &convert; open OUT, ">$OUTFILE"; binmode (OUT) if $^O eq 'MSWin32'; &msg_write; close OUT; print "Wrote $OUTFILE\n" unless $QUIET_ARG; } sub convert { ## Reading the file { local (*IN); local $/; #slurp mode open (IN, "<$SRCDIR_ARG/$FILE") || die "can't open $SRCDIR_ARG/$FILE: $!"; $input = ; } &type_ini if $gettext_type eq "ini"; &type_keys if $gettext_type eq "keys"; &type_xml if $gettext_type eq "xml"; &type_glade if $gettext_type eq "glade"; &type_scheme if $gettext_type eq "scheme"; &type_schemas if $gettext_type eq "schemas"; &type_rfc822deb if $gettext_type eq "rfc822deb"; &type_quoted if $gettext_type eq "quoted"; &type_quotedxml if $gettext_type eq "quotedxml"; } sub entity_decode_minimal { local ($_) = @_; s/'/'/g; # ' s/"/"/g; # " s/&/&/g; return $_; } sub entity_decode { local ($_) = @_; s/'/'/g; # ' s/"/"/g; # " s/<//g; s/&/&/g; return $_; } sub escape_char { return '\"' if $_ eq '"'; return '\n' if $_ eq "\n"; return '\\\\' if $_ eq '\\'; return $_; } sub escape { my ($string) = @_; return join "", map &escape_char, split //, $string; } sub type_ini { ### For generic translatable desktop files ### while ($input =~ /^(#(.+)\n)?^_.*=(.*)$/mg) { if (defined($2)) { $comments{$3} = $2; } $messages{$3} = []; } } sub type_keys { ### For generic translatable mime/keys files ### while ($input =~ /^\s*_\w+=(.*)$/mg) { $messages{$1} = []; } } sub type_xml { ### For generic translatable XML files ### my $tree = readXml($input); parseTree(0, $tree); } sub print_var { my $var = shift; my $vartype = ref $var; if ($vartype =~ /ARRAY/) { my @arr = @{$var}; print "[ "; foreach my $el (@arr) { print_var($el); print ", "; } print "] "; } elsif ($vartype =~ /HASH/) { my %hash = %{$var}; print "{ "; foreach my $key (keys %hash) { print "$key => "; print_var($hash{$key}); print ", "; } print "} "; } else { print $var; } } # Same syntax as getAttributeString in intltool-merge.in.in, similar logic (look for ## differences comment) sub getAttributeString { my $sub = shift; my $do_translate = shift || 1; my $language = shift || ""; my $translate = shift; my $result = ""; foreach my $e (reverse(sort(keys %{ $sub }))) { my $key = $e; my $string = $sub->{$e}; my $quote = '"'; $string =~ s/^[\s]+//; $string =~ s/[\s]+$//; if ($string =~ /^'.*'$/) { $quote = "'"; } $string =~ s/^['"]//g; $string =~ s/['"]$//g; ## differences from intltool-merge.in.in if ($key =~ /^_/) { $comments{entity_decode($string)} = $XMLCOMMENT if $XMLCOMMENT; $messages{entity_decode($string)} = []; $$translate = 2; } ## differences end here from intltool-merge.in.in $result .= " $key=$quote$string$quote"; } return $result; } # Verbatim copy from intltool-merge.in.in sub getXMLstring { my $ref = shift; my $spacepreserve = shift || 0; my @list = @{ $ref }; my $result = ""; my $count = scalar(@list); my $attrs = $list[0]; my $index = 1; $spacepreserve = 1 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/)); $spacepreserve = 0 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?default["']?$/)); while ($index < $count) { my $type = $list[$index]; my $content = $list[$index+1]; if (! $type ) { # We've got CDATA if ($content) { # lets strip the whitespace here, and *ONLY* here $content =~ s/\s+/ /gs if (!$spacepreserve); $result .= $content; } } elsif ( "$type" ne "1" ) { # We've got another element $result .= "<$type"; $result .= getAttributeString(@{$content}[0], 0); # no nested translatable elements if ($content) { my $subresult = getXMLstring($content, $spacepreserve); if ($subresult) { $result .= ">".$subresult . ""; } else { $result .= "/>"; } } else { $result .= "/>"; } } $index += 2; } return $result; } # Verbatim copy from intltool-merge.in.in, except for MULTIPLE_OUTPUT handling removed # Translate list of nodes if necessary sub translate_subnodes { my $fh = shift; my $content = shift; my $language = shift || ""; my $singlelang = shift || 0; my $spacepreserve = shift || 0; my @nodes = @{ $content }; my $count = scalar(@nodes); my $index = 0; while ($index < $count) { my $type = $nodes[$index]; my $rest = $nodes[$index+1]; traverse($fh, $type, $rest, $language, $spacepreserve); $index += 2; } } # Based on traverse() in intltool-merge.in.in sub traverse { my $fh = shift; # unused, to allow us to sync code between -merge and -extract my $nodename = shift; my $content = shift; my $language = shift || ""; my $spacepreserve = shift || 0; if ($nodename && "$nodename" eq "1") { $XMLCOMMENT = $content; } elsif ($nodename) { # element my @all = @{ $content }; my $attrs = shift @all; my $translate = 0; my $outattr = getAttributeString($attrs, 1, $language, \$translate); if ($nodename =~ /^_/) { $translate = 1; $nodename =~ s/^_//; } my $lookup = ''; $spacepreserve = 0 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?default["']?$/)); $spacepreserve = 1 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/)); if ($translate) { $lookup = getXMLstring($content, $spacepreserve); if (!$spacepreserve) { $lookup =~ s/^\s+//s; $lookup =~ s/\s+$//s; } if ($lookup && $translate != 2) { $comments{$lookup} = $XMLCOMMENT if $XMLCOMMENT; $messages{$lookup} = []; } elsif ($translate == 2) { translate_subnodes($fh, \@all, $language, 1, $spacepreserve); } } else { $XMLCOMMENT = ""; my $count = scalar(@all); if ($count > 0) { my $index = 0; while ($index < $count) { my $type = $all[$index]; my $rest = $all[$index+1]; traverse($fh, $type, $rest, $language, $spacepreserve); $index += 2; } } } $XMLCOMMENT = ""; } } # Verbatim copy from intltool-merge.in.in, $fh for compatibility sub parseTree { my $fh = shift; my $ref = shift; my $language = shift || ""; my $name = shift @{ $ref }; my $cont = shift @{ $ref }; while (!$name || "$name" eq "1") { $name = shift @{ $ref }; $cont = shift @{ $ref }; } my $spacepreserve = 0; my $attrs = @{$cont}[0]; $spacepreserve = 1 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/)); traverse($fh, $name, $cont, $language, $spacepreserve); } # Verbatim copy from intltool-merge.in.in sub intltool_tree_comment { my $expat = shift; my $data = $expat->original_string(); my $clist = $expat->{Curlist}; my $pos = $#$clist; $data =~ s/^$//s; push @$clist, 1 => $data; } # Verbatim copy from intltool-merge.in.in sub intltool_tree_cdatastart { my $expat = shift; my $clist = $expat->{Curlist}; my $pos = $#$clist; push @$clist, 0 => $expat->original_string(); } # Verbatim copy from intltool-merge.in.in sub intltool_tree_cdataend { my $expat = shift; my $clist = $expat->{Curlist}; my $pos = $#$clist; $clist->[$pos] .= $expat->original_string(); } # Verbatim copy from intltool-merge.in.in sub intltool_tree_char { my $expat = shift; my $text = shift; my $clist = $expat->{Curlist}; my $pos = $#$clist; # Use original_string so that we retain escaped entities # in CDATA sections. # if ($pos > 0 and $clist->[$pos - 1] eq '0') { $clist->[$pos] .= $expat->original_string(); } else { push @$clist, 0 => $expat->original_string(); } } # Verbatim copy from intltool-merge.in.in sub intltool_tree_start { my $expat = shift; my $tag = shift; my @origlist = (); # Use original_string so that we retain escaped entities # in attribute values. We must convert the string to an # @origlist array to conform to the structure of the Tree # Style. # my @original_array = split /\x/, $expat->original_string(); my $source = $expat->original_string(); # Remove leading tag. # $source =~ s|^\s*<\s*(\S+)||s; # Grab attribute key/value pairs and push onto @origlist array. # while ($source) { if ($source =~ /^\s*([\w:-]+)\s*[=]\s*["]/) { $source =~ s|^\s*([\w:-]+)\s*[=]\s*["]([^"]*)["]||s; push @origlist, $1; push @origlist, '"' . $2 . '"'; } elsif ($source =~ /^\s*([\w:-]+)\s*[=]\s*[']/) { $source =~ s|^\s*([\w:-]+)\s*[=]\s*[']([^']*)[']||s; push @origlist, $1; push @origlist, "'" . $2 . "'"; } else { last; } } my $ol = [ { @origlist } ]; push @{ $expat->{Lists} }, $expat->{Curlist}; push @{ $expat->{Curlist} }, $tag => $ol; $expat->{Curlist} = $ol; } # Copied from intltool-merge.in.in and added comment handler. sub readXml { my $xmldoc = shift || return; my $ret = eval 'require XML::Parser'; if(!$ret) { die "You must have XML::Parser installed to run $0\n\n"; } my $xp = new XML::Parser(Style => 'Tree'); $xp->setHandlers(Char => \&intltool_tree_char); $xp->setHandlers(Start => \&intltool_tree_start); $xp->setHandlers(CdataStart => \&intltool_tree_cdatastart); $xp->setHandlers(CdataEnd => \&intltool_tree_cdataend); ## differences from intltool-merge.in.in $xp->setHandlers(Comment => \&intltool_tree_comment); ## differences end here from intltool-merge.in.in my $tree = $xp->parse($xmldoc); #print_var($tree); # Hello thereHowdydo # would be: # [foo, [{}, 1, "comment", head, [{id => "a"}, 0, "Hello ", em, [{}, 0, "there"]], bar, # [{}, 0, "Howdy", ref, [{}]], 0, "do" ] ] return $tree; } sub type_schemas { ### For schemas XML files ### # FIXME: We should handle escaped < (less than) while ($input =~ / \s* (\s*(?:\s*)?(.*?)\s*<\/default>\s*)? (\s*(?:\s*)?(.*?)\s*<\/short>\s*)? (\s*(?:\s*)?(.*?)\s*<\/long>\s*)? <\/locale> /sgx) { my @totranslate = ($3,$6,$9); my @eachcomment = ($2,$5,$8); foreach (@totranslate) { my $currentcomment = shift @eachcomment; next if !$_; s/\s+/ /g; $messages{entity_decode_minimal($_)} = []; $comments{entity_decode_minimal($_)} = $currentcomment if (defined($currentcomment)); } } } sub type_rfc822deb { ### For rfc822-style Debian configuration files ### my $lineno = 1; my $type = ''; while ($input =~ /\G(.*?)(^|\n)(_+)([^:]+):[ \t]*(.*?)(?=\n\S|$)/sg) { my ($pre, $newline, $underscore, $tag, $text) = ($1, $2, $3, $4, $5); while ($pre =~ m/\n/g) { $lineno ++; } $lineno += length($newline); my @str_list = rfc822deb_split(length($underscore), $text); for my $str (@str_list) { $strcount++; $messages{$str} = []; $loc{$str} = $lineno; $count{$str} = $strcount; my $usercomment = ''; while($pre =~ s/(^|\n)#([^\n]*)$//s) { $usercomment = "\n" . $2 . $usercomment; } $comments{$str} = $tag . $usercomment; } $lineno += ($text =~ s/\n//g); } } sub rfc822deb_split { # Debian defines a special way to deal with rfc822-style files: # when a value contain newlines, it consists of # 1. a short form (first line) # 2. a long description, all lines begin with a space, # and paragraphs are separated by a single dot on a line # This routine returns an array of all paragraphs, and reformat # them. # When first argument is 2, the string is a comma separated list of # values. my $type = shift; my $text = shift; $text =~ s/^[ \t]//mg; return (split(/, */, $text, 0)) if $type ne 1; return ($text) if $text !~ /\n/; $text =~ s/([^\n]*)\n//; my @list = ($1); my $str = ''; for my $line (split (/\n/, $text)) { chomp $line; if ($line =~ /^\.\s*$/) { # New paragraph $str =~ s/\s*$//; push(@list, $str); $str = ''; } elsif ($line =~ /^\s/) { # Line which must not be reformatted $str .= "\n" if length ($str) && $str !~ /\n$/; $line =~ s/\s+$//; $str .= $line."\n"; } else { # Continuation line, remove newline $str .= " " if length ($str) && $str !~ /\n$/; $str .= $line; } } $str =~ s/\s*$//; push(@list, $str) if length ($str); return @list; } sub type_quoted { while ($input =~ /\"(([^\"]|\\\")*[^\\\"])\"/g) { my $message = $1; my $before = $`; $message =~ s/\\\"/\"/g; $before =~ s/[^\n]//g; $messages{$message} = []; $loc{$message} = length ($before) + 2; } } sub type_quotedxml { while ($input =~ /\"(([^\"]|\\\")*[^\\\"])\"/g) { my $message = $1; my $before = $`; $message =~ s/\\\"/\"/g; $message = entity_decode($message); $before =~ s/[^\n]//g; $messages{$message} = []; $loc{$message} = length ($before) + 2; } } sub type_glade { ### For translatable Glade XML files ### my $tags = "label|title|text|format|copyright|comments|preview_text|tooltip|message"; while ($input =~ /<($tags)>([^<]+)<\/($tags)>/sg) { # Glade sometimes uses tags that normally mark translatable things for # little bits of non-translatable content. We work around this by not # translating strings that only includes something like label4 or window1. $messages{entity_decode($2)} = [] unless $2 =~ /^(window|label|dialog)[0-9]+$/; } while ($input =~ /(..[^<]*)<\/items>/sg) { for my $item (split (/\n/, $1)) { $messages{entity_decode($item)} = []; } } ## handle new glade files while ($input =~ /<(property|atkproperty|col)\s+[^>]*translatable\s*=\s*"yes"(?:\s+[^>]*comments\s*=\s*"([^"]*)")?[^>]*>([^<]+)<\/\1>/sg) { $messages{entity_decode($3)} = [] unless $3 =~ /^(window|label)[0-9]+$/; if (defined($2) and !($3 =~ /^(window|label)[0-9]+$/)) { $comments{entity_decode($3)} = entity_decode($2) ; } } while ($input =~ /]*)"\s+description="([^>]+)"\/>/sg) { $messages{entity_decode_minimal($2)} = []; } } sub type_scheme { my ($line, $i, $state, $str, $trcomment, $char); for $line (split(/\n/, $input)) { $i = 0; $state = 0; # 0 - nothing, 1 - string, 2 - translatable string while ($i < length($line)) { if (substr($line,$i,1) eq "\"") { if ($state == 2) { $comments{$str} = $trcomment if ($trcomment); $messages{$str} = []; $str = ''; $state = 0; $trcomment = ""; } elsif ($state == 1) { $str = ''; $state = 0; $trcomment = ""; } else { $state = 1; $str = ''; if ($i>0 && substr($line,$i-1,1) eq '_') { $state = 2; } } } elsif (!$state) { if (substr($line,$i,1) eq ";") { $trcomment = substr($line,$i+1); $trcomment =~ s/^;*\s*//; $i = length($line); } elsif ($trcomment && substr($line,$i,1) !~ /\s|\(|\)|_/) { $trcomment = ""; } } else { if (substr($line,$i,1) eq "\\") { $char = substr($line,$i+1,1); if ($char ne "\"" && $char ne "\\") { $str = $str . "\\"; } $i++; } $str = $str . substr($line,$i,1); } $i++; } } } sub msg_write { my @msgids; if (%count) { @msgids = sort { $count{$a} <=> $count{$b} } keys %count; } else { @msgids = sort keys %messages; } for my $message (@msgids) { my $offsetlines = 1; $offsetlines++ if $message =~ /%/; if (defined ($comments{$message})) { while ($comments{$message} =~ m/\n/g) { $offsetlines++; } } print OUT "# ".($loc{$message} - $offsetlines). " \"$FILE\"\n" if defined $loc{$message}; print OUT "/* ".$comments{$message}." */\n" if defined $comments{$message}; print OUT "/* xgettext:no-c-format */\n" if $message =~ /%/; my @lines = split (/\n/, $message, -1); for (my $n = 0; $n < @lines; $n++) { if ($n == 0) { print OUT "char *s = N_(\""; } else { print OUT " \""; } print OUT escape($lines[$n]); if ($n < @lines - 1) { print OUT "\\n\"\n"; } else { print OUT "\");\n"; } } } } libqalculate-0.9.7/libqalculate/0000777000175100017510000000000011320655050013637 500000000000000libqalculate-0.9.7/libqalculate/MathStructure.h0000644000175100017510000011170611320653617016553 00000000000000/* Qalculate Copyright (C) 2004-2007 Niklas Knutsson (nq@altern.org) 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. */ #ifndef MATH_STRUCTURE_H #define MATH_STRUCTURE_H #include #include /** @file */ /// Types for MathStructure typedef enum { STRUCT_MULTIPLICATION, STRUCT_INVERSE, STRUCT_DIVISION, STRUCT_ADDITION, STRUCT_NEGATE, STRUCT_POWER, STRUCT_NUMBER, STRUCT_UNIT, STRUCT_SYMBOLIC, STRUCT_FUNCTION, STRUCT_VARIABLE, STRUCT_VECTOR, STRUCT_BITWISE_AND, STRUCT_BITWISE_OR, STRUCT_BITWISE_XOR, STRUCT_BITWISE_NOT, STRUCT_LOGICAL_AND, STRUCT_LOGICAL_OR, STRUCT_LOGICAL_XOR, STRUCT_LOGICAL_NOT, STRUCT_COMPARISON, STRUCT_UNDEFINED } StructureType; enum { MULTIPLICATION_SIGN_NONE, MULTIPLICATION_SIGN_SPACE, MULTIPLICATION_SIGN_OPERATOR, MULTIPLICATION_SIGN_OPERATOR_SHORT }; /// A structure representing a mathematical value/expression/result /** * A MathStructure can both be container representing an operation with an ordered list of children or simple value representing * a number, , variable etc. The children of a container might be of any type, allowing a tree-like nested structure. * * These are the most common conatiner/operation types: * - \b Addition: contains two or more children, representing terms (x+y+...) * - \b Multiplication: contains two or more children, representing factors (x*y*...) * - \b Power: contains exactly two children, representing base and exponent (x^y) * - \b Function: contains a two or more children, representing arguments, and a reference to a MathFunction object ( f(x,y,...) ) * - \b Comparison: an equality or inequality containing exactly two children, represening the expressions right and left of the sign, specified with a ComparisonType (x=y, x!=y, x>y, ...) * - \b Vector: contains zero or more children, representing elements in a vector ( [x, y, z, ...] ) * * Also available are containers representing logical and bitwise operations. * Subtraction is represented by an addition structure with negated children and division by a multiplication structure with inverted children. * Matrices is represented by a vector with vectors as children. * * For formatted structures, the following types is also available: * - \b Negation: contains exactly one child (-x) * - \b Invertion: contains exactly one child (1/x) * - \b Division: contains exactly two children representing numerator and denominator (x/y) * * The following value types are available: * - \b Number: has a Number object, representing a rational, floating point, complex or infinite numeric value * - \b Variable: has a reference to a Variable object, with a known or unknown value * - \b Symbolic: has an associated text string, with assumptions about the represented value controlled by the default assumptions * - \b Unit: has a reference to a Unit object, and might in a formatted structure also have a reference to a Prefix object * - \b Undefined: represents an undefined value * * To create a MathStructure, you can either create a simple structure using the constructors and then expanding it with structural operations, * or use the parse or calculation functions of the global Calculator object to convert an expression string. * * The expression "(5x + 2) * 3" can be turned into a MathStructure either using * \code * MathStructure mstruct = CALCULATOR->parse("(5x + 2) * 3"); * \endcode * or * \code * MathStructure mstruct(5); * mstruct *= CALCULATOR->v_x; * mstruct += 2; * mstruct *= 3: * \endcode * The first variant is obviously simpler, but slower and allows less control. * * Then, to evaluate/calculate/simplify (whatever) a structure, eval() should normally be used. The EvaluationOptions passed to eval() allows much control over the process * and the outcome. * \code * EvaluationOptions eo; * mstruct.eval(eo); * \endcode * * After that, to display the result, you should first format the structure using format() and then display it using print(), passing the PrintOptions to both. * \code * PrintOptions po; * mstruct.format(po); * std::cout << mstruct.print(po) << std::endl; * \endcode * * Most low-level functions expect the structure to be unformatted och require that unformat() is called after an expression string has been parsed or format() has been called. * * To access a child structure either the [] operator or the safer getChild() can be used. * Note however that the index passed to the operator start at zero and the index argument for getChild() starts at one. * \code * MathStructure mstruct(5); * mstruct += 2; * std::cout << mstruct.print() << std::endl; // output: "5 + 2" * std::cout << mstruct.getChild(1)->print() << std::endl; // output: "5" * std::cout << mstruct[1].print() << std::endl; // output: "2" * \endcode * * MathStructure uses reference count for management of objects allocated with new. * Call ref() when starting to use the object and unref() when done. * Note that the reference count is initialized to 1 in the constructors, so ref() should not be called after the object creation. * This system is used for all child objects, so the following is perfectly legal: * \code * MathStructure *mchild_p = mstruct->getChild(1); * mchild_p->ref(); // mchild_p reference count = 2 * mstruct->unref(); //mstruct reference count = 0, mstruct deleted, mchild_p reference count = 1 * (...) * mchild_p->unref(); // mchild_p reference count = 0, mchild_p deleted * \endcode */ class MathStructure { protected: size_t i_ref; StructureType m_type; bool b_approx; int i_precision; vector v_subs; vector v_order; string s_sym; Number o_number; Variable *o_variable; Unit *o_unit; Prefix *o_prefix; bool b_plural; MathFunction *o_function; MathStructure *function_value; MathStructure *o_uncertainty; ComparisonType ct_comp; bool b_protected; bool isolate_x_sub(const EvaluationOptions &eo, EvaluationOptions &eo2, const MathStructure &x_var, MathStructure *morig = NULL); void init(); MathStructure& CHILD(size_t v_index) const; public: /** @name Constructors */ //@{ /** Create a new structure, initialized to zero. */ MathStructure(); /** Create a copy of a structure. Child structures are copied. * * @param o The structure to copy. */ MathStructure(const MathStructure &o); /** Create a new numeric structure (value=num/den*10^exp10). Equivalent to MathStructure(Number(num, den, exp10)). * * @param num The numerator of the numeric value. * @param den The denominator of the numeric value. * @param exp10 The base 10 exponent of the numeric value. */ MathStructure(int num, int den = 1, int exp10 = 0); /** Create a new symbolic/text structure. * * @param sym Symbolic/text value. */ MathStructure(string sym); /** Create a new numeric structure with floating point value. Uses Number::setFloat(). * * @param o Numeric value. */ MathStructure(double float_value); /** Create a new vector. * * @param o The first element (copied) in the vector. * @param ... Elements (copied) in the vector. End with NULL. */ MathStructure(const MathStructure *o, ...); /** Create a new function structure. * * @param o Function value. * @param ... Arguments (copied) to the function. End with NULL. */ MathStructure(MathFunction *o, ...); /** Create a new unit structure. * * @param u The unit value. * @param p Prefix of the unit. */ MathStructure(Unit *u, Prefix *p = NULL); /** Create a new variable structure. * * @param o Variable value. */ MathStructure(Variable *o); /** Create a new numeric structure. * * @param o Numeric value. */ MathStructure(const Number &o); ~MathStructure(); //@} /** @name Functions/operators for setting type and content */ //@{ /** Set the structure to a copy of another structure. Child structures are copied. * * @param o The structure to copy. * @param merge_precision Preserve the current precision (unless the new value has a lower precision). */ void set(const MathStructure &o, bool merge_precision = false); /** Set the structure to a copy of another structure. Pointers to child structures are copied. * * @param o The structure to copy. * @param merge_precision Preserve the current precision (unless the new value has a lower precision). */ void set_nocopy(MathStructure &o, bool merge_precision = false); /** Set the structure to a number (num/den*10^exp10). Equivalent to set(Number(num, den, exp10), precerve_precision). * * @param num The numerator of the new numeric value. * @param den The denominator of the new numeric value. * @param exp10 The base 10 exponent of the new numeric value. * @param preserve_precision Preserve the current precision (unless the new value has a lower precision). */ void set(int num, int den = 1, int exp10 = 0, bool preserve_precision = false); /** Set the structure to a symbolic/text value. * * @param o The new symolic/text value. * @param preserve_precision Preserve the current precision. */ void set(string sym, bool preserve_precision = false); /** Set the structure to a number with a floating point value. Uses Number::setFloat(). * * @param o The new numeric value. * @param preserve_precision Preserve the current precision (unless the new value has a lower precision). */ void set(double float_value, bool preserve_precision = false); /** Set the structure to a vector. * * @param o The first element (copied) in the new vector. * @param ... Elements (copied) in the new vector. End with NULL. */ void setVector(const MathStructure *o, ...); /** Set the structure to a mathematical function. * * @param o The new function value. * @param ... Arguments (copied) to the function. End with NULL. */ void set(MathFunction *o, ...); /** Set the structure to a unit. * * @param u The new unit value. * @param p Prefix of the unit. * @param preserve_precision Preserve the current precision (unless the new value has a lower precision). */ void set(Unit *u, Prefix *p = NULL, bool preserve_precision = false); /** Set the structure to a variable. * * @param o The new variable value. * @param preserve_precision Preserve the current precision. */ void set(Variable *o, bool preserve_precision = false); /** Set the structure to a number. * * @param o The new numeric value. * @param preserve_precision Preserve the current precision (unless the new value has a lower precision). */ void set(const Number &o, bool preserve_precision = false); void setInfinity(bool preserve_precision = false); /** Set the value of the structure to undefined. * * @param preserve_precision Preserve the current precision. */ void setUndefined(bool preserve_precision = false); /** Reset the value (to zero) and parameters of the structure. * * @param preserve_precision Preserve the current precision. */ void clear(bool preserve_precision = false); /** Set the structure to an empty vector. * * @param preserve_precision Preserve the current precision. */ void clearVector(bool preserve_precision = false); /** Set the structure to an empty matrix. * * @param preserve_precision Preserve the current precision. */ void clearMatrix(bool preserve_precision = false); /** Explicitely sets the type of the structure. * setType() is dangerous and might crash the program if used unwisely. * * @param mtype The new structure type */ void setType(StructureType mtype); void operator = (const MathStructure &o); void operator = (const Number &o); void operator = (int i); void operator = (Unit *u); void operator = (Variable *v); void operator = (string sym); //@} /** @name Functions to keep track of referrers */ //@{ void ref(); void unref(); size_t refcount() const; //@} /** @name Functions for numbers */ //@{ const Number &number() const; Number &number(); void numberUpdated(); //@} /** @name Functions for symbols */ //@{ const string &symbol() const; //@} /** @name Functions for units */ //@{ Unit *unit() const; Prefix *prefix() const; void setPrefix(Prefix *p); bool isPlural() const; void setPlural(bool is_plural); void setUnit(Unit *u); //@} /** @name Functions for mathematical functions */ //@{ void setFunction(MathFunction *f); MathFunction *function() const; const MathStructure *functionValue() const; //@} /** @name Functions for variables */ //@{ void setVariable(Variable *v); Variable *variable() const; //@} /** @name Functions for statistical uncertainty/error of value */ //@{ void setUncertainty(const MathStructure &o); const MathStructure *uncertainty() const; //@} /** @name Functions for nested structures (power, muliplication, addition, vector, etc) */ //@{ /** Call this function when you have updated a child. Updates the precision. * * @param index Index (starting at 1) of the updated child. * @recursive If true, do the same for each child of the child. */ void childUpdated(size_t index, bool recursive = false); /** Call this function when you have updated children. Updates the precision. * * @recursive If true, do the same for each child of the children. */ void childrenUpdated(bool recursive = false); /** Returns a child. Does not check if a child exists at the index. * * @param index Index (starting at zero). */ MathStructure &operator [] (size_t index); /** Returns a child. Does not check if a child exists at the index. * * @param index Index (starting at zero). */ const MathStructure &operator [] (size_t index) const; void setToChild(size_t index, bool merge_precision = false, MathStructure *mparent = NULL, size_t index_this = 1); void swapChildren(size_t index1, size_t index2); void childToFront(size_t index); void addChild(const MathStructure &o); void addChild_nocopy(MathStructure *o); void delChild(size_t index); void insertChild(const MathStructure &o, size_t index); void insertChild_nocopy(MathStructure *o, size_t index); void setChild(const MathStructure &o, size_t index = 1); void setChild_nocopy(MathStructure *o, size_t index = 1); const MathStructure *getChild(size_t index) const; MathStructure *getChild(size_t index); size_t countChildren() const; size_t countTotalChildren(bool count_function_as_one = true) const; size_t size() const; //@} /** @name Functions for power */ //@{ const MathStructure *base() const; const MathStructure *exponent() const; MathStructure *base(); MathStructure *exponent(); //@} /** @name Functions for comparisons */ //@{ ComparisonType comparisonType() const; void setComparisonType(ComparisonType comparison_type); //@} /** @name Functions checking type and value */ //@{ StructureType type() const; bool isAddition() const; bool isMultiplication() const; bool isPower() const; bool isSymbolic() const; bool isEmptySymbol() const; bool isVector() const; bool isMatrix() const; bool isFunction() const; bool isUnit() const; bool isUnit_exp() const; bool isNumber_exp() const; bool isVariable() const; bool isComparison() const; bool isBitwiseAnd() const; bool isBitwiseOr() const; bool isBitwiseXor() const; bool isBitwiseNot() const; bool isLogicalAnd() const; bool isLogicalOr() const; bool isLogicalXor() const; bool isLogicalNot() const; bool isInverse() const; bool isDivision() const; bool isNegate() const; bool isInfinity() const; bool isUndefined() const; bool isInteger() const; bool isNumber() const; bool isZero() const; bool isOne() const; bool isMinusOne() const; bool hasNegativeSign() const; bool representsBoolean() const; bool representsPositive(bool allow_units = false) const; bool representsNegative(bool allow_units = false) const; bool representsNonNegative(bool allow_units = false) const; bool representsNonPositive(bool allow_units = false) const; bool representsInteger(bool allow_units = false) const; bool representsNumber(bool allow_units = false) const; bool representsRational(bool allow_units = false) const; bool representsReal(bool allow_units = false) const; bool representsComplex(bool allow_units = false) const; bool representsNonZero(bool allow_units = false) const; bool representsZero(bool allow_units = false) const; bool representsEven(bool allow_units = false) const; bool representsOdd(bool allow_units = false) const; bool representsUndefined(bool include_childs = false, bool include_infinite = false, bool be_strict = false) const; bool representsNonMatrix() const; //@} /** @name Functions for precision */ //@{ void setApproximate(bool is_approx = true); bool isApproximate() const; void setPrecision(int prec); int precision() const; void mergePrecision(const MathStructure &o); //@} /** @name Operators for structural transformations and additions * These operators transforms or adds to the structure without doing any calculations */ //@{ MathStructure operator - () const; MathStructure operator * (const MathStructure &o) const; MathStructure operator / (const MathStructure &o) const; MathStructure operator + (const MathStructure &o) const; MathStructure operator - (const MathStructure &o) const; MathStructure operator ^ (const MathStructure &o) const; MathStructure operator && (const MathStructure &o) const; MathStructure operator || (const MathStructure &o) const; MathStructure operator ! () const; void operator *= (const MathStructure &o); void operator /= (const MathStructure &o); void operator += (const MathStructure &o); void operator -= (const MathStructure &o); void operator ^= (const MathStructure &o); void operator *= (const Number &o); void operator /= (const Number &o); void operator += (const Number &o); void operator -= (const Number &o); void operator ^= (const Number &o); void operator *= (int i); void operator /= (int i); void operator += (int i); void operator -= (int i); void operator ^= (int i); void operator *= (Unit *u); void operator /= (Unit *u); void operator += (Unit *u); void operator -= (Unit *u); void operator ^= (Unit *u); void operator *= (Variable *v); void operator /= (Variable *v); void operator += (Variable *v); void operator -= (Variable *v); void operator ^= (Variable *v); void operator *= (string sym); void operator /= (string sym); void operator += (string sym); void operator -= (string sym); void operator ^= (string sym); //@} /** @name Functions for structural transformations and additions * These functions transforms or adds to the structure without doing any calculations */ //@{ void add(const MathStructure &o, MathOperation op, bool append = false); void add(const MathStructure &o, bool append = false); void subtract(const MathStructure &o, bool append = false); void multiply(const MathStructure &o, bool append = false); void divide(const MathStructure &o, bool append = false); void raise(const MathStructure &o); void add(const Number &o, bool append = false); void subtract(const Number &o, bool append = false); void multiply(const Number &o, bool append = false); void divide(const Number &o, bool append = false); void raise(const Number &o); void add(int i, bool append = false); void subtract(int i, bool append = false); void multiply(int i, bool append = false); void divide(int i, bool append = false); void raise(int i); void add(Variable *v, bool append = false); void subtract(Variable *v, bool append = false); void multiply(Variable *v, bool append = false); void divide(Variable *v, bool append = false); void raise(Variable *v); void add(Unit *u, bool append = false); void subtract(Unit *u, bool append = false); void multiply(Unit *u, bool append = false); void divide(Unit *u, bool append = false); void raise(Unit *u); void add(string sym, bool append = false); void subtract(string sym, bool append = false); void multiply(string sym, bool append = false); void divide(string sym, bool append = false); void raise(string sym); void add_nocopy(MathStructure *o, MathOperation op, bool append = false); void add_nocopy(MathStructure *o, bool append = false); void subtract_nocopy(MathStructure *o, bool append = false); void multiply_nocopy(MathStructure *o, bool append = false); void divide_nocopy(MathStructure *o, bool append = false); void raise_nocopy(MathStructure *o); void inverse(); void negate(); void setLogicalNot(); void setBitwiseNot(); void transform(StructureType mtype, const MathStructure &o); void transform(StructureType mtype, const Number &o); void transform(StructureType mtype, int i); void transform(StructureType mtype, Unit *u); void transform(StructureType mtype, Variable *v); void transform(StructureType mtype, string sym); void transform_nocopy(StructureType mtype, MathStructure *o); void transform(StructureType mtype); //@} /** @name Functions/operators for comparisons */ //@{ bool equals(const MathStructure &o) const; bool equals(const Number &o) const; bool equals(int i) const; bool equals(Unit *u) const; bool equals(Variable *v) const; bool equals(string sym) const; ComparisonResult compare(const MathStructure &o) const; ComparisonResult compareApproximately(const MathStructure &o) const; bool operator == (const MathStructure &o) const; bool operator == (const Number &o) const; bool operator == (int i) const; bool operator == (Unit *u) const; bool operator == (Variable *v) const; bool operator == (string sym) const; bool operator != (const MathStructure &o) const; //@} /** @name Functions for calculation/evaluation */ //@{ MathStructure &eval(const EvaluationOptions &eo = default_evaluation_options); void calculateUncertaintyPropagation(const EvaluationOptions &eo); bool calculateMergeIndex(size_t index, const EvaluationOptions &eo, const EvaluationOptions &feo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalOrLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalOrIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalOr(const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalXorLast(const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalXor(const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalAndLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalAndIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalAnd(const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalNot(const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseNot(const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateInverse(const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateNegate(const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateRaiseExponent(const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateRaise(const MathStructure &mexp, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseOrLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseOrIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseOr(const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseXorLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseXorIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseXor(const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseAndLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseAndIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseAnd(const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateMultiplyLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateMultiplyIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateMultiply(const MathStructure &mmul, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateDivide(const MathStructure &mdiv, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateAddLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateAddIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateAdd(const MathStructure &madd, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateSubtract(const MathStructure &msub, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateFunctions(const EvaluationOptions &eo, bool recursive = true); int merge_addition(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_multiplication(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false, bool do_append = true); int merge_power(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_logical_and(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_logical_or(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_logical_xor(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_bitwise_and(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_bitwise_or(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_bitwise_xor(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); bool calculatesub(const EvaluationOptions &eo, const EvaluationOptions &feo, bool recursive = true, MathStructure *mparent = NULL, size_t index_this = 1); void evalSort(bool recursive = false); bool integerFactorize(); //@} /** @name Functions for protection from changes when evaluating */ //@{ void setProtected(bool do_protect = true); bool isProtected() const; //@} /** @name Functions for format and display */ //@{ void sort(const PrintOptions &po = default_print_options, bool recursive = true); bool improve_division_multipliers(const PrintOptions &po = default_print_options); void setPrefixes(const PrintOptions &po = default_print_options, MathStructure *parent = NULL, size_t pindex = 0); void prefixCurrencies(); void format(const PrintOptions &po = default_print_options); void formatsub(const PrintOptions &po = default_print_options, MathStructure *parent = NULL, size_t pindex = 0, bool recursive = true); void postFormatUnits(const PrintOptions &po = default_print_options, MathStructure *parent = NULL, size_t pindex = 0); bool factorizeUnits(); void unformat(const EvaluationOptions &eo = default_evaluation_options); bool needsParenthesis(const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool flat_division = true, bool flat_power = true) const; int neededMultiplicationSign(const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool par, bool par_prev, bool flat_division = true, bool flat_power = true) const; string print(const PrintOptions &po = default_print_options, const InternalPrintStruct &ips = top_ips) const; //@} /** @name Functions for vectors */ //@{ MathStructure &flattenVector(MathStructure &mstruct) const; bool rankVector(bool ascending = true); bool sortVector(bool ascending = true); MathStructure &getRange(int start, int end, MathStructure &mstruct) const; void resizeVector(size_t i, const MathStructure &mfill); //@} /** @name Functions for matrices */ //@{ size_t rows() const; size_t columns() const; const MathStructure *getElement(size_t row, size_t column) const; MathStructure *getElement(size_t row, size_t column); MathStructure &getArea(size_t r1, size_t c1, size_t r2, size_t c2, MathStructure &mstruct) const; MathStructure &rowToVector(size_t r, MathStructure &mstruct) const; MathStructure &columnToVector(size_t c, MathStructure &mstruct) const; MathStructure &matrixToVector(MathStructure &mstruct) const; void setElement(const MathStructure &mstruct, size_t row, size_t column); void addRows(size_t r, const MathStructure &mfill); void addColumns(size_t c, const MathStructure &mfill); void addRow(const MathStructure &mfill); void addColumn(const MathStructure &mfill); void resizeMatrix(size_t r, size_t c, const MathStructure &mfill); bool matrixIsSquare() const; bool isNumericMatrix() const; int pivot(size_t ro, size_t co, bool symbolic = true); int gaussianElimination(const EvaluationOptions &eo = default_evaluation_options, bool det = false); MathStructure &determinant(MathStructure &mstruct, const EvaluationOptions &eo) const; MathStructure &permanent(MathStructure &mstruct, const EvaluationOptions &eo) const; void setToIdentityMatrix(size_t n); MathStructure &getIdentityMatrix(MathStructure &mstruct) const; bool invertMatrix(const EvaluationOptions &eo); bool adjointMatrix(const EvaluationOptions &eo); bool transposeMatrix(); MathStructure &cofactor(size_t r, size_t c, MathStructure &mstruct, const EvaluationOptions &eo) const; //@} /** @name Functions for unit conversion */ //@{ int isUnitCompatible(const MathStructure &mstruct); bool syncUnits(bool sync_complex_relations = false, bool *found_complex_relations = NULL, bool calculate_new_functions = false, const EvaluationOptions &feo = default_evaluation_options); bool testDissolveCompositeUnit(Unit *u); bool testCompositeUnit(Unit *u); bool dissolveAllCompositeUnits(); bool convert(Unit *u, bool convert_complex_relations = false, bool *found_complex_relations = NULL, bool calculate_new_functions = false, const EvaluationOptions &feo = default_evaluation_options); bool convert(const MathStructure unit_mstruct, bool convert_complex_relations = false, bool *found_complex_relations = NULL, bool calculate_new_functions = false, const EvaluationOptions &feo = default_evaluation_options); //@} /** @name Functions for recursive search and replace */ //@{ int contains(const MathStructure &mstruct, bool structural_only = true, bool check_variables = false, bool check_functions = false) const; int containsRepresentativeOf(const MathStructure &mstruct, bool check_variables = false, bool check_functions = false) const; int containsType(StructureType mtype, bool structural_only = true, bool check_variables = false, bool check_functions = false) const; int containsRepresentativeOfType(StructureType mtype, bool check_variables = false, bool check_functions = false) const; bool containsOpaqueContents() const; bool containsAdditionPower() const; bool containsUnknowns() const; bool containsDivision() const; size_t countFunctions(bool count_subfunctions = true) const; void findAllUnknowns(MathStructure &unknowns_vector); bool replace(const MathStructure &mfrom, const MathStructure &mto); bool calculateReplace(const MathStructure &mfrom, const MathStructure &mto, const EvaluationOptions &eo); bool replace(const MathStructure &mfrom1, const MathStructure &mto1, const MathStructure &mfrom2, const MathStructure &mto2); bool removeType(StructureType mtype); //@} /** @name Functions to generate vectors for plotting */ //@{ MathStructure generateVector(MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector = NULL, const EvaluationOptions &eo = default_evaluation_options) const; MathStructure generateVector(MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector = NULL, const EvaluationOptions &eo = default_evaluation_options) const; MathStructure generateVector(MathStructure x_mstruct, const MathStructure &x_vector, const EvaluationOptions &eo = default_evaluation_options) const; //@} /** @name Differentiation and integration */ //@{ bool differentiate(const MathStructure &x_var, const EvaluationOptions &eo); bool integrate(const MathStructure &x_var, const EvaluationOptions &eo); //@} /** @name Functions for polynomials */ //@{ bool simplify(const EvaluationOptions &eo = default_evaluation_options, bool unfactorize = true); bool factorize(const EvaluationOptions &eo = default_evaluation_options); /** If the structure represents a rational polynomial. * This is true for * - rational numbers; * - functions, units, variables and symbols that do not represent a matrix or undefined; * - a power with a positive integer exponent and any of the previous as base; * - a multiplication with the previous as factors; or * - an addition with the previous as terms. * * @returns true if structure represents a rational polynomial. */ bool isRationalPolynomial() const; const Number &overallCoefficient() const; const Number °ree(const MathStructure &xvar) const; const Number &ldegree(const MathStructure &xvar) const; void lcoefficient(const MathStructure &xvar, MathStructure &mcoeff) const; void tcoefficient(const MathStructure &xvar, MathStructure &mcoeff) const; void coefficient(const MathStructure &xvar, const Number &pownr, MathStructure &mcoeff) const; Number maxCoefficient(); int polynomialUnit(const MathStructure &xvar) const; void polynomialContent(const MathStructure &xvar, MathStructure &mcontent, const EvaluationOptions &eo) const; void polynomialPrimpart(const MathStructure &xvar, MathStructure &mprim, const EvaluationOptions &eo) const; void polynomialPrimpart(const MathStructure &xvar, const MathStructure &c, MathStructure &mprim, const EvaluationOptions &eo) const; void polynomialUnitContentPrimpart(const MathStructure &xvar, int &munit, MathStructure &mcontent, MathStructure &mprim, const EvaluationOptions &eo) const; //@} static bool polynomialDivide(const MathStructure &mnum, const MathStructure &mden, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args = true); static bool polynomialQuotient(const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args = true); static bool lcm(const MathStructure &m1, const MathStructure &m2, MathStructure &mlcm, const EvaluationOptions &eo, bool check_args = true); static bool gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mresult, const EvaluationOptions &eo, MathStructure *ca = NULL, MathStructure *cb = NULL, bool check_args = true); /** @name Functions for equations */ //@{ const MathStructure &find_x_var() const; bool isolate_x(const EvaluationOptions &eo, const MathStructure &x_var = m_undefined, bool check_result = false); bool isolate_x(const EvaluationOptions &eo, const EvaluationOptions &feo, const MathStructure &x_var = m_undefined, bool check_result = false); //@} }; #endif libqalculate-0.9.7/libqalculate/Variable.cc0000644000175100017510000003026011305546373015622 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #include "support.h" #include "Variable.h" #include "util.h" #include "Calculator.h" #include "MathStructure.h" #include "Number.h" Assumptions::Assumptions() : i_type(ASSUMPTION_TYPE_NONE), i_sign(ASSUMPTION_SIGN_UNKNOWN), fmin(NULL), fmax(NULL), b_incl_min(true), b_incl_max(true) {} Assumptions::~Assumptions() {} bool Assumptions::isPositive() {return i_sign == ASSUMPTION_SIGN_POSITIVE || (fmin && (fmin->isPositive() || (!b_incl_min && fmin->isNonNegative())));} bool Assumptions::isNegative() {return i_sign == ASSUMPTION_SIGN_NEGATIVE || (fmax && (fmax->isNegative() || (!b_incl_max && fmax->isNonPositive())));} bool Assumptions::isNonNegative() {return i_sign == ASSUMPTION_SIGN_NONNEGATIVE || i_sign == ASSUMPTION_SIGN_POSITIVE || (fmin && fmin->isNonNegative());} bool Assumptions::isNonPositive() {return i_sign == ASSUMPTION_SIGN_NONPOSITIVE || i_sign == ASSUMPTION_SIGN_NEGATIVE || (fmax && fmax->isNonPositive());} bool Assumptions::isInteger() {return i_type >= ASSUMPTION_TYPE_INTEGER;} bool Assumptions::isNumber() {return i_type >= ASSUMPTION_TYPE_NUMBER;} bool Assumptions::isRational() {return i_type >= ASSUMPTION_TYPE_RATIONAL;} bool Assumptions::isReal() {return i_type >= ASSUMPTION_TYPE_REAL;} bool Assumptions::isComplex() {return i_type == ASSUMPTION_TYPE_COMPLEX;} bool Assumptions::isNonZero() {return i_sign == ASSUMPTION_SIGN_NONZERO || isPositive() || isNegative();} bool Assumptions::isNonMatrix() {return i_type >= ASSUMPTION_TYPE_NONMATRIX;} AssumptionType Assumptions::type() {return i_type;} AssumptionSign Assumptions::sign() {return i_sign;} void Assumptions::setType(AssumptionType ant) { i_type = ant; if(i_type <= ASSUMPTION_TYPE_COMPLEX && i_sign != ASSUMPTION_SIGN_NONZERO) { i_sign = ASSUMPTION_SIGN_UNKNOWN; } if(i_type <= ASSUMPTION_TYPE_NONMATRIX) { if(fmax) delete fmax; if(fmin) delete fmin; } } void Assumptions::setSign(AssumptionSign as) { i_sign = as; if(i_type <= ASSUMPTION_TYPE_COMPLEX && i_sign != ASSUMPTION_SIGN_NONZERO && i_sign != ASSUMPTION_SIGN_UNKNOWN) { i_type = ASSUMPTION_TYPE_REAL; } } void Assumptions::setMin(const Number *nmin) { if(!nmin) { if(fmin) { delete fmin; } return; } if(i_type <= ASSUMPTION_TYPE_NONMATRIX) i_type = ASSUMPTION_TYPE_NUMBER; if(!fmin) { fmin = new Number(*nmin); } else { fmin->set(*nmin); } } void Assumptions::setIncludeEqualsMin(bool include_equals) { b_incl_min = include_equals; } bool Assumptions::includeEqualsMin() const { return b_incl_min; } const Number *Assumptions::min() const { return fmin; } void Assumptions::setMax(const Number *nmax) { if(!nmax) { if(fmax) { delete fmax; } return; } if(i_type <= ASSUMPTION_TYPE_NONMATRIX) i_type = ASSUMPTION_TYPE_NUMBER; if(!fmax) { fmax = new Number(*nmax); } else { fmax->set(*nmax); } } void Assumptions::setIncludeEqualsMax(bool include_equals) { b_incl_max = include_equals; } bool Assumptions::includeEqualsMax() const { return b_incl_max; } const Number *Assumptions::max() const { return fmax; } Variable::Variable(string cat_, string name_, string title_, bool is_local, bool is_builtin, bool is_active) : ExpressionItem(cat_, name_, title_, "", is_local, is_builtin, is_active) { setChanged(false); } Variable::Variable() : ExpressionItem() {} Variable::Variable(const Variable *variable) {set(variable);} Variable::~Variable() {} void Variable::set(const ExpressionItem *item) { ExpressionItem::set(item); } UnknownVariable::UnknownVariable(string cat_, string name_, string title_, bool is_local, bool is_builtin, bool is_active) : Variable(cat_, name_, title_, is_local, is_builtin, is_active) { setChanged(false); o_assumption = NULL; } UnknownVariable::UnknownVariable() : Variable() { o_assumption = NULL; } UnknownVariable::UnknownVariable(const UnknownVariable *variable) { set(variable); } UnknownVariable::~UnknownVariable() { if(o_assumption) delete o_assumption; } ExpressionItem *UnknownVariable::copy() const { return new UnknownVariable(this); } void UnknownVariable::set(const ExpressionItem *item) { if(item->type() == TYPE_VARIABLE && item->subtype() == SUBTYPE_UNKNOWN_VARIABLE) { if(o_assumption) delete o_assumption; o_assumption = ((UnknownVariable*) item)->assumptions(); } ExpressionItem::set(item); } void UnknownVariable::setAssumptions(Assumptions *ass) { if(o_assumption) delete o_assumption; o_assumption = ass; } Assumptions *UnknownVariable::assumptions() { return o_assumption; } bool UnknownVariable::representsPositive(bool) { if(o_assumption) return o_assumption->isPositive(); return CALCULATOR->defaultAssumptions()->isPositive(); } bool UnknownVariable::representsNegative(bool) { if(o_assumption) return o_assumption->isNegative(); return CALCULATOR->defaultAssumptions()->isNegative(); } bool UnknownVariable::representsNonNegative(bool) { if(o_assumption) return o_assumption->isNonNegative(); return CALCULATOR->defaultAssumptions()->isNonNegative(); } bool UnknownVariable::representsNonPositive(bool) { if(o_assumption) return o_assumption->isNonPositive(); return CALCULATOR->defaultAssumptions()->isNonPositive(); } bool UnknownVariable::representsInteger(bool) { if(o_assumption) return o_assumption->isInteger(); return CALCULATOR->defaultAssumptions()->isInteger(); } bool UnknownVariable::representsNumber(bool) { if(o_assumption) return o_assumption->isNumber(); return CALCULATOR->defaultAssumptions()->isNumber(); } bool UnknownVariable::representsRational(bool) { if(o_assumption) return o_assumption->isRational(); return CALCULATOR->defaultAssumptions()->isRational(); } bool UnknownVariable::representsReal(bool) { if(o_assumption) return o_assumption->isReal(); return CALCULATOR->defaultAssumptions()->isReal(); } bool UnknownVariable::representsComplex(bool) { if(o_assumption) return o_assumption->isComplex(); return CALCULATOR->defaultAssumptions()->isComplex(); } bool UnknownVariable::representsNonZero(bool) { if(o_assumption) return o_assumption->isNonZero(); return CALCULATOR->defaultAssumptions()->isNonZero(); } bool UnknownVariable::representsNonMatrix() { if(o_assumption) return o_assumption->isNonMatrix(); return CALCULATOR->defaultAssumptions()->isNonMatrix(); } KnownVariable::KnownVariable(string cat_, string name_, const MathStructure &o, string title_, bool is_local, bool is_builtin, bool is_active) : Variable(cat_, name_, title_, is_local, is_builtin, is_active) { mstruct = new MathStructure(o); setApproximate(mstruct->isApproximate()); setPrecision(mstruct->precision()); b_expression = false; sexpression = ""; calculated_precision = 0; setChanged(false); } KnownVariable::KnownVariable(string cat_, string name_, string expression_, string title_, bool is_local, bool is_builtin, bool is_active) : Variable(cat_, name_, title_, is_local, is_builtin, is_active) { mstruct = NULL; calculated_precision = 0; set(expression_); setChanged(false); } KnownVariable::KnownVariable() : Variable() { mstruct = NULL; } KnownVariable::KnownVariable(const KnownVariable *variable) { mstruct = NULL; set(variable); } KnownVariable::~KnownVariable() { if(mstruct) delete mstruct; } ExpressionItem *KnownVariable::copy() const { return new KnownVariable(this); } bool KnownVariable::isExpression() const { return b_expression; } string KnownVariable::expression() const { return sexpression; } void KnownVariable::set(const ExpressionItem *item) { if(item->type() == TYPE_VARIABLE && item->subtype() == SUBTYPE_KNOWN_VARIABLE) { calculated_precision = 0; sexpression = ((KnownVariable*) item)->expression(); b_expression = ((KnownVariable*) item)->isExpression(); if(!b_expression) { set(((KnownVariable*) item)->get()); } } ExpressionItem::set(item); } void KnownVariable::set(const MathStructure &o) { if(!mstruct) mstruct = new MathStructure(o); else mstruct->set(o); setApproximate(mstruct->isApproximate()); setPrecision(mstruct->precision()); calculated_precision = 0; b_expression = false; sexpression = ""; setChanged(true); } void KnownVariable::set(string expression_) { if(mstruct) { delete mstruct; } mstruct = NULL; b_expression = true; sexpression = expression_; remove_blank_ends(sexpression); calculated_precision = 0; setChanged(true); } const MathStructure &KnownVariable::get() { if(b_expression && !mstruct) { ParseOptions po; if(isApproximate() && precision() < 1) { po.read_precision = READ_PRECISION_WHEN_DECIMALS; } mstruct = new MathStructure(); CALCULATOR->parse(mstruct, sexpression, po); if(precision() > 0 && (mstruct->precision() < 1 || precision() < mstruct->precision())) { mstruct->setPrecision(precision()); } if(isApproximate() && !mstruct->isApproximate()) { mstruct->setApproximate(); } } return *mstruct; } bool KnownVariable::representsPositive(bool allow_units) {return get().representsPositive(allow_units);} bool KnownVariable::representsNegative(bool allow_units) {return get().representsNegative(allow_units);} bool KnownVariable::representsNonNegative(bool allow_units) {return get().representsNonNegative(allow_units);} bool KnownVariable::representsNonPositive(bool allow_units) {return get().representsNonPositive(allow_units);} bool KnownVariable::representsInteger(bool allow_units) {return get().representsInteger(allow_units);} bool KnownVariable::representsNumber(bool allow_units) {return get().representsNumber(allow_units);} bool KnownVariable::representsRational(bool allow_units) {return get().representsRational(allow_units);} bool KnownVariable::representsReal(bool allow_units) {return get().representsReal(allow_units);} bool KnownVariable::representsComplex(bool allow_units) {return get().representsComplex(allow_units);} bool KnownVariable::representsNonZero(bool allow_units) {return get().representsNonZero(allow_units);} bool KnownVariable::representsEven(bool allow_units) {return get().representsEven(allow_units);} bool KnownVariable::representsOdd(bool allow_units) {return get().representsOdd(allow_units);} bool KnownVariable::representsUndefined(bool include_childs, bool include_infinite, bool be_strict) {return get().representsUndefined(include_childs, include_infinite, be_strict);} bool KnownVariable::representsBoolean() {return get().representsBoolean();} bool KnownVariable::representsNonMatrix() {return get().representsNonMatrix();} DynamicVariable::DynamicVariable(string cat_, string name_, string title_, bool is_local, bool is_builtin, bool is_active) : KnownVariable(cat_, name_, MathStructure(), title_, is_local, is_builtin, is_active) { mstruct = NULL; calculated_precision = 0; setApproximate(); setChanged(false); } DynamicVariable::DynamicVariable(const DynamicVariable *variable) { mstruct = NULL; set(variable); setApproximate(); setChanged(false); } DynamicVariable::DynamicVariable() : KnownVariable() { mstruct = NULL; calculated_precision = 0; setApproximate(); setChanged(false); } DynamicVariable::~DynamicVariable() { if(mstruct) delete mstruct; } void DynamicVariable::set(const ExpressionItem *item) { ExpressionItem::set(item); } void DynamicVariable::set(const MathStructure&) {} void DynamicVariable::set(string) {} const MathStructure &DynamicVariable::get() { if(calculated_precision != CALCULATOR->getPrecision() || !mstruct) { mstruct = new MathStructure(); calculated_precision = CALCULATOR->getPrecision(); calculate(); } return *mstruct; } int DynamicVariable::calculatedPrecision() const { return calculated_precision; } PiVariable::PiVariable() : DynamicVariable("Constants", "pi") {} void PiVariable::calculate() const { Number nr; nr.pi(); mstruct->set(nr); } EVariable::EVariable() : DynamicVariable("Constants", "e") {} void EVariable::calculate() const { Number nr; nr.e(); mstruct->set(nr); } EulerVariable::EulerVariable() : DynamicVariable("Constants", "euler") {} void EulerVariable::calculate() const { Number nr; nr.euler(); mstruct->set(nr); } CatalanVariable::CatalanVariable() : DynamicVariable("Constants", "catalan") {} void CatalanVariable::calculate() const { Number nr; nr.catalan(); mstruct->set(nr); } libqalculate-0.9.7/libqalculate/Makefile.am0000644000175100017510000000145611305546372015626 00000000000000# # src/libqalculate/Makefile.am for qalculate # lib_LTLIBRARIES = libqalculate.la libqalculate_la_SOURCES = \ Function.cc Calculator.cc DataSet.cc \ Variable.cc ExpressionItem.cc Number.cc MathStructure.cc \ Prefix.cc support.h util.cc Unit.cc BuiltinFunctions.cc libqalculateincludedir = $(includedir)/libqalculate libqalculateinclude_HEADERS = \ Function.h Calculator.h DataSet.h Variable.h \ ExpressionItem.h Number.h MathStructure.h Prefix.h \ util.h includes.h Unit.h BuiltinFunctions.h \ qalculate.h libqalculate_la_LDFLAGS = -version-info $(QALCULATE_CURRENT):$(QALCULATE_REVISION):$(QALCULATE_AGE) -no-undefined libqalculate_la_LIBADD = \ @GLIB_LIBS@ INCLUDES = \ -I../ \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ @GLIB_CFLAGS@ libqalculate-0.9.7/libqalculate/DataSet.cc0000644000175100017510000010104511305546372015421 00000000000000/* Qalculate Copyright (C) 2004-2006 Niklas Knutsson (nq@altern.org) 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. */ #include "support.h" #include "DataSet.h" #include "util.h" #include "Calculator.h" #include "MathStructure.h" #include "Number.h" #include #include #include #include #include #define XML_GET_STRING_FROM_PROP(node, name, str) value = xmlGetProp(node, (xmlChar*) name); if(value) {str = (char*) value; remove_blank_ends(str); xmlFree(value);} else str = ""; #define XML_GET_STRING_FROM_TEXT(node, str) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value) {str = (char*) value; remove_blank_ends(str); xmlFree(value);} else str = ""; DataObject::DataObject(DataSet *parent_set) { parent = parent_set; b_uchanged = false; } void DataObject::eraseProperty(DataProperty *property) { for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { s_properties.erase(s_properties.begin() + i); a_properties.erase(a_properties.begin() + i); if(m_properties[i]) { m_properties[i]->unref(); } m_properties.erase(m_properties.begin() + i); s_nonlocalized_properties.erase(s_nonlocalized_properties.begin() + i); } } } void DataObject::setProperty(DataProperty *property, string s_value, int is_approximate) { if(s_value.empty()) eraseProperty(property); for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { s_properties[i] = s_value; a_properties[i] = is_approximate; if(m_properties[i]) { m_properties[i]->unref(); m_properties[i] = NULL; } return; } } properties.push_back(property); s_properties.push_back(s_value); m_properties.push_back(NULL); a_properties.push_back(is_approximate); s_nonlocalized_properties.push_back(""); } void DataObject::setNonlocalizedKeyProperty(DataProperty *property, string s_value) { for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { s_nonlocalized_properties[i] = s_value; return; } } properties.push_back(property); s_properties.push_back(""); m_properties.push_back(NULL); a_properties.push_back(-1); s_nonlocalized_properties.push_back(s_value); } const string &DataObject::getProperty(DataProperty *property, int *is_approximate) { if(!property) return empty_string; for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { if(is_approximate) *is_approximate = a_properties[i]; return s_properties[i]; } } return empty_string; } const string &DataObject::getNonlocalizedKeyProperty(DataProperty *property) { if(!property) return empty_string; for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { return s_nonlocalized_properties[i]; } } return empty_string; } string DataObject::getPropertyInputString(DataProperty *property) { if(!property) return empty_string; for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { return property->getInputString(s_properties[i]); } } return empty_string; } string DataObject::getPropertyDisplayString(DataProperty *property) { if(!property) return empty_string; for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { return property->getDisplayString(s_properties[i]); } } return empty_string; } const MathStructure *DataObject::getPropertyStruct(DataProperty *property) { if(!property) return NULL; for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { if(!m_properties[i]) { m_properties[i] = property->generateStruct(s_properties[i], a_properties[i]); } return m_properties[i]; } } return NULL; } bool DataObject::isUserModified() const { return b_uchanged; } void DataObject::setUserModified(bool user_modified) { b_uchanged = user_modified; } DataSet *DataObject::parentSet() const { return parent; } DataProperty::DataProperty(DataSet *parent_set, string s_name, string s_title, string s_description) { if(!s_name.empty()) { names.push_back(s_name); name_is_ref.push_back(false); } stitle = s_title; sdescr = s_description; parent = parent_set; m_unit = NULL; ptype = PROPERTY_EXPRESSION; b_key = false; b_case = false; b_hide = false; b_brackets = false; b_approximate = false; b_uchanged = false; } DataProperty::DataProperty(const DataProperty &dp) { m_unit = NULL; set(dp); } void DataProperty::set(const DataProperty &dp) { stitle = dp.title(false); sdescr = dp.description(); sunit = dp.getUnitString(); parent = dp.parentSet(); if(m_unit) m_unit->unref(); m_unit = NULL; ptype = dp.propertyType(); b_key = dp.isKey(); b_case = dp.isCaseSensitive(); b_hide = dp.isHidden(); b_brackets = dp.usesBrackets(); b_approximate = dp.isApproximate(); b_uchanged = dp.isUserModified(); clearNames(); for(size_t i = 1; i <= dp.countNames(); i++) { names.push_back(dp.getName(i)); name_is_ref.push_back(dp.nameIsReference(i)); } } void DataProperty::setName(string s_name, bool is_ref) { if(s_name.empty()) return; names.clear(); name_is_ref.clear(); names.push_back(s_name); name_is_ref.push_back(is_ref); } void DataProperty::setNameIsReference(size_t index, bool is_ref) { if(index > 0 && index <= name_is_ref.size()) name_is_ref[index - 1] = is_ref; } bool DataProperty::nameIsReference(size_t index) const { if(index > 0 && index <= name_is_ref.size()) return name_is_ref[index - 1]; return false; } void DataProperty::clearNames() { names.clear(); name_is_ref.clear(); } void DataProperty::addName(string s_name, bool is_ref, size_t index) { if(s_name.empty()) return; if(index < 1 || index > names.size()) { names.push_back(s_name); name_is_ref.push_back(is_ref); } else { names.insert(names.begin() + (index - 1), s_name); name_is_ref.insert(name_is_ref.begin() + (index - 1), is_ref); } } const string &DataProperty::getName(size_t index) const { if(index < 1 || index > names.size()) return empty_string; return names[index - 1]; } const string &DataProperty::getReferenceName() const { for(size_t i = 0; i < name_is_ref.size(); i++) { if(name_is_ref[i]) return names[i]; } return getName(); } size_t DataProperty::hasName(const string &s_name) { for(size_t i = 0; i < names.size(); i++) { if(equalsIgnoreCase(s_name, names[i])) return i + 1; } return 0; } size_t DataProperty::countNames() const { return names.size(); } const string &DataProperty::title(bool return_name_if_no_title) const { if(return_name_if_no_title && stitle.empty()) { return getName(); } return stitle; } void DataProperty::setTitle(string s_title) { remove_blank_ends(s_title); stitle = s_title; } const string &DataProperty::description() const { return sdescr; } void DataProperty::setDescription(string s_description) { remove_blank_ends(s_description); sdescr = s_description; } void DataProperty::setUnit(string s_unit) { sunit = s_unit; if(m_unit) m_unit->unref(); m_unit = NULL; } const string &DataProperty::getUnitString() const { return sunit; } const MathStructure *DataProperty::getUnitStruct() { if(!m_unit && !sunit.empty()) { m_unit = new MathStructure(); CALCULATOR->parse(m_unit, sunit); } return m_unit; } string DataProperty::getInputString(const string &valuestr) { string str; if(b_brackets && valuestr.length() > 1 && valuestr[0] == '[' && valuestr[valuestr.length() - 1] == ']') { str = valuestr.substr(1, valuestr.length() - 2); } else { str = valuestr; } if(!sunit.empty()) { str += " "; str += sunit; } return str; } string DataProperty::getDisplayString(const string &valuestr) { string str = valuestr; if(!sunit.empty()) { str += " "; str += sunit; } return str; } MathStructure *DataProperty::generateStruct(const string &valuestr, int is_approximate) { MathStructure *mstruct = NULL; switch(ptype) { case PROPERTY_EXPRESSION: { ParseOptions po; if((b_approximate && is_approximate < 0) || is_approximate > 0) po.read_precision = ALWAYS_READ_PRECISION; if(b_brackets && valuestr.length() > 1 && valuestr[0] == '[' && valuestr[valuestr.length() - 1] == ']') { mstruct = new MathStructure(); CALCULATOR->parse(mstruct, valuestr.substr(1, valuestr.length() - 2), po); } else { mstruct = new MathStructure(); CALCULATOR->parse(mstruct, valuestr, po); } break; } case PROPERTY_NUMBER: { if(b_brackets && valuestr.length() > 1 && valuestr[0] == '[' && valuestr[valuestr.length() - 1] == ']') { if((b_approximate && is_approximate < 0) || is_approximate > 0) { ParseOptions po; po.read_precision = ALWAYS_READ_PRECISION; mstruct = new MathStructure(Number(valuestr.substr(1, valuestr.length() - 2), po)); } else { mstruct = new MathStructure(Number(valuestr.substr(1, valuestr.length() - 2))); } } else { if((b_approximate && is_approximate < 0) || is_approximate > 0) { ParseOptions po; po.read_precision = ALWAYS_READ_PRECISION; mstruct = new MathStructure(Number(valuestr, po)); } else { mstruct = new MathStructure(Number(valuestr)); } } break; } case PROPERTY_STRING: { if(b_brackets && valuestr.length() > 1 && valuestr[0] == '[' && valuestr[valuestr.length() - 1] == ']') mstruct = new MathStructure(valuestr.substr(1, valuestr.length() - 2)); else mstruct = new MathStructure(valuestr); break; } } if(getUnitStruct()) { mstruct->multiply(*getUnitStruct()); } return mstruct; } void DataProperty::setKey(bool is_key) {b_key = is_key;} bool DataProperty::isKey() const {return b_key;} void DataProperty::setHidden(bool is_hidden) {b_hide = is_hidden;} bool DataProperty::isHidden() const {return b_hide;} void DataProperty::setCaseSensitive(bool is_case_sensitive) {b_case = is_case_sensitive;} bool DataProperty::isCaseSensitive() const {return b_case;} void DataProperty::setUsesBrackets(bool uses_brackets) {b_brackets = uses_brackets;} bool DataProperty::usesBrackets() const {return b_brackets;} void DataProperty::setApproximate(bool is_approximate) {b_approximate = is_approximate;} bool DataProperty::isApproximate() const {return b_approximate;} void DataProperty::setPropertyType(PropertyType property_type) {ptype = property_type;} PropertyType DataProperty::propertyType() const {return ptype;} bool DataProperty::isUserModified() const { return b_uchanged; } void DataProperty::setUserModified(bool user_modified) { b_uchanged = user_modified; } DataSet *DataProperty::parentSet() const { return parent; } DataSet::DataSet(string s_category, string s_name, string s_default_file, string s_title, string s_description, bool is_local) : MathFunction(s_name, 1, 2, s_category, s_title, s_description) { b_local = is_local; sfile = s_default_file; b_loaded = false; setArgumentDefinition(1, new DataObjectArgument(this, _("Object"))); setArgumentDefinition(2, new DataPropertyArgument(this, _("Property"))); setDefaultValue(2, _("info")); setChanged(false); } DataSet::DataSet(const DataSet *o) { b_loaded = false; set(o); } ExpressionItem *DataSet::copy() const {return new DataSet(this);} void DataSet::set(const ExpressionItem *item) { if(item->type() == TYPE_FUNCTION && item->subtype() == SUBTYPE_DATA_SET) { DataSet *dc = (DataSet*) item; sfile = dc->defaultDataFile(); scopyright = dc->copyright(); } MathFunction::set(item); } int DataSet::subtype() const { return SUBTYPE_DATA_SET; } int DataSet::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { DataObject *o = getObject(vargs[0]); if(!o) { CALCULATOR->error(true, _("Object %s not available in data set."), vargs[0].symbol().c_str(), NULL); return 0; } if(equalsIgnoreCase(vargs[1].symbol(), string("info")) || equalsIgnoreCase(vargs[1].symbol(), string(_("info")))) { string str = printProperties(o); CALCULATOR->message(MESSAGE_INFORMATION, str.c_str(), NULL); return 1; } DataProperty *dp = getProperty(vargs[1].symbol()); if(!dp) { CALCULATOR->error(true, _("Property %s not available in data set."), vargs[1].symbol().c_str(), NULL); return 0; } const MathStructure *pmstruct = o->getPropertyStruct(dp); if(!pmstruct) { CALCULATOR->error(true, _("Property %s not defined for object %s."), vargs[1].symbol().c_str(), vargs[0].symbol().c_str(), NULL); return 0; } mstruct.set(*pmstruct); return 1; } void DataSet::setDefaultProperty(string property) { setDefaultValue(2, property); setChanged(true); } const string &DataSet::defaultProperty() const { return getDefaultValue(2); } void DataSet::setCopyright(string s_copyright) { scopyright = s_copyright; setChanged(true); } const string &DataSet::copyright() const { return scopyright; } void DataSet::setDefaultDataFile(string s_file) { sfile = s_file; setChanged(true); } const string &DataSet::defaultDataFile() const { return sfile; } bool DataSet::loadObjects(const char *file_name, bool is_user_defs) { string filename; if(file_name) { filename = file_name; } else if(sfile.empty()) { return false; } else if(sfile.find("/") != string::npos) { filename = sfile; bool b = loadObjects(filename.c_str(), false); size_t i = sfile.find_last_of("/"); if(i != sfile.length() - 1) { filename = getLocalDir(); filename += "definitions/"; filename += "datasets/"; filename += sfile.substr(i + 1, sfile.length() - (i + 1)); loadObjects(filename.c_str(), true); } return b; } else { filename = PACKAGE_DATA_DIR; filename += "/qalculate/"; filename += sfile; bool b = loadObjects(filename.c_str(), false); filename = getLocalDir(); filename += "definitions/"; filename += "datasets/"; filename += sfile; loadObjects(filename.c_str(), true); return b; } xmlDocPtr doc; xmlNodePtr cur, child; string locale, lang_tmp; char *clocale = setlocale(LC_MESSAGES, ""); if(clocale) { locale = clocale; if(locale == "POSIX" || locale == "C") { locale = ""; } } string localebase; if(locale.length() > 2) { localebase = locale.substr(0, 2); } else { localebase = locale; } while(localebase.length() < 2) localebase += " "; doc = xmlParseFile(filename.c_str()); if(doc == NULL) { if(!is_user_defs && !isLocal()) { CALCULATOR->error(true, _("Unable to load data objects in %s."), filename.c_str(), NULL); } return false; } cur = xmlDocGetRootElement(doc); if(cur == NULL) { xmlFreeDoc(doc); if(!is_user_defs && !isLocal()) { CALCULATOR->error(true, _("Unable to load data objects in %s."), filename.c_str(), NULL); } return false; } string version; xmlChar *value, *lang; while(cur != NULL) { if(!xmlStrcmp(cur->name, (const xmlChar*) "QALCULATE")) { XML_GET_STRING_FROM_PROP(cur, "version", version) break; } cur = cur->next; } if(cur == NULL) { CALCULATOR->error(true, _("File not identified as Qalculate! definitions file: %s."), filename.c_str(), NULL); xmlFreeDoc(doc); return false; } int version_numbers[] = {0, 0, 0}; for(size_t i = 0; i < 3; i++) { size_t dot_i = version.find("."); if(dot_i == string::npos) { version_numbers[i] = s2i(version); break; } version_numbers[i] = s2i(version.substr(0, dot_i)); version = version.substr(dot_i + 1, version.length() - (dot_i + 1)); } DataObject *o = NULL; cur = cur->xmlChildrenNode; string str, str2; vector lang_status_p; vector lang_status; int ils = 0; int i_approx = 0; bool cmp = false; bool b = false, old_object = false; size_t objects_before = objects.size(); vector p_refs; vector s_refs; while(cur) { b = false; if(!xmlStrcmp(cur->name, (const xmlChar*) "object")) { b = true; } else if(xmlStrcmp(cur->name, (const xmlChar*) "text")) { for(size_t i = 1; i <= countNames(); i++) { if(!xmlStrcmp(cur->name, (const xmlChar*) properties[i]->getName(i).c_str())) { b = true; break; } } } if(b) { lang_status_p.clear(); lang_status.clear(); if(is_user_defs && objects_before > 0) { s_refs.clear(); p_refs.clear(); } else { o = new DataObject(this); } for(size_t i = 0; i < properties.size(); i++) { if(properties[i]->isKey()) { for(size_t i2 = 1; i2 <= properties[i]->countNames(); i2++) { if(properties[i]->getName(i2).find(' ') != string::npos) { str2 = properties[i]->getName(i2); gsub(" ", "_", str2); XML_GET_STRING_FROM_PROP(cur, str2.c_str(), str) } else { XML_GET_STRING_FROM_PROP(cur, properties[i]->getName(i2).c_str(), str) } remove_blank_ends(str); if(!str.empty()) { if(is_user_defs && objects_before > 0) { s_refs.push_back(str); p_refs.push_back(properties[i]); } else { o->setProperty(properties[i], str); } } } } } old_object = false; if(is_user_defs && objects_before > 0) { for(size_t i = 0; i < p_refs.size(); i++) { for(size_t i2 = 0; i2 < objects_before; i2++) { if(s_refs[i] == objects[i2]->getProperty(p_refs[i]) || s_refs[i] == objects[i2]->getNonlocalizedKeyProperty(p_refs[i])) { o = objects[i2]; old_object = true; break; } } if(old_object) break; } if(!old_object) o = new DataObject(this); for(size_t i = 0; i < p_refs.size(); i++) { o->setProperty(p_refs[i], s_refs[i]); } } child = cur->xmlChildrenNode; while(child) { b = false; for(size_t i = 0; i < properties.size(); i++) { for(size_t i2 = 1; i2 <= properties[i]->countNames(); i2++) { if(properties[i]->getName(i2).find(' ') != string::npos) { str2 = properties[i]->getName(i2); gsub(" ", "_", str2); cmp = !xmlStrcmp(child->name, (const xmlChar*) str2.c_str()); } else { cmp = !xmlStrcmp(child->name, (const xmlChar*) properties[i]->getName(i2).c_str()); } if(cmp) { value = xmlGetProp(child, (xmlChar*) "approximate"); if(value) { if(!xmlStrcmp(value, (const xmlChar*) "false")) { i_approx = 0; } else if(value && !xmlStrcmp(value, (const xmlChar*) "true")) { i_approx = 1; } xmlFree(value); } else { i_approx = -1; } if(properties[i]->propertyType() == PROPERTY_STRING) { value = xmlNodeListGetString(doc, child->xmlChildrenNode, 1); lang = xmlNodeGetLang(child); ils = -1; for(int i3 = lang_status_p.size() - 1; i3 > 0; i3--) { if(lang_status_p[i3] == properties[i3]) { ils = i3; break; } } if(!lang && (ils < 0 || lang_status[ils] < 1 || properties[i]->isKey())) { if(value) { str = (char*) value; remove_blank_ends(str); if(!str.empty() && str[0] == '!') { size_t i4 = str.find('!', 1); if(i4 != string::npos) { if(i4 + 1 < str.length()) { str = str.substr(i4 + 1, str.length() - (i4 + 1)); } else { str = ""; } } } } else { str = ""; } if(ils < 0 || lang_status[ils] < 1) { o->setProperty(properties[i], str, i_approx); } else { o->setNonlocalizedKeyProperty(properties[i], str); } } else if(!locale.empty() && (ils < 0 || lang_status[ils] < 2)) { if(locale == (char*) lang) { if(ils < 0) { lang_status_p.push_back(properties[i]); lang_status.push_back(2); } else { lang_status[ils] = 2; } if(value) { str = (char*) value; remove_blank_ends(str); } else { str = ""; } o->setProperty(properties[i], str, i_approx); } else if((ils < 0 || lang_status[ils] < 1) && strlen((char*) lang) >= 2 && lang[0] == localebase[0] && lang[1] == localebase[1]) { if(ils < 0) { lang_status_p.push_back(properties[i]); lang_status.push_back(1); } else { lang_status[ils] = 1; } if(value) { str = (char*) value; remove_blank_ends(str); } else { str = ""; } o->setProperty(properties[i], str, i_approx); } } if(value) xmlFree(value); if(lang) xmlFree(lang); } else { XML_GET_STRING_FROM_TEXT(child, str) remove_blank_ends(str); o->setProperty(properties[i], str, i_approx); } b = true; break; } } if(b) break; } child = child->next; } if(!old_object) objects.push_back(o); } cur = cur->next; } xmlFreeDoc(doc); b_loaded = true; if(!scopyright.empty()) { CALCULATOR->message(MESSAGE_INFORMATION, "%s", scopyright.c_str(), NULL); } return true; } int DataSet::saveObjects(const char *file_name, bool save_global) { string str, filename; if(!save_global && !file_name) { filename = getLocalDir(); mkdir(filename.c_str(), S_IRWXU); filename += "definitions/"; mkdir(filename.c_str(), S_IRWXU); filename += "datasets/"; mkdir(filename.c_str(), S_IRWXU); filename += sfile; } else { filename = file_name; } const string *vstr; xmlDocPtr doc = xmlNewDoc((xmlChar*) "1.0"); xmlNodePtr cur, newnode, newnode2; doc->children = xmlNewDocNode(doc, NULL, (xmlChar*) "QALCULATE", NULL); xmlNewProp(doc->children, (xmlChar*) "version", (xmlChar*) VERSION); cur = doc->children; DataObject *o; int approx = false; bool do_save = save_global; for(size_t i = 0; i < objects.size(); i++) { if(save_global || objects[i]->isUserModified()) { do_save = true; o = objects[i]; newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "object", NULL); if(!save_global) { for(size_t i2 = 0; i2 < properties.size(); i2++) { if(properties[i2]->isKey()) { vstr = &o->getProperty(properties[i2], &approx); if(approx < 0 && !vstr->empty()) { xmlNewProp(newnode, (xmlChar*) properties[i2]->getReferenceName().c_str(), (xmlChar*) vstr->c_str()); } } } } for(size_t i2 = 0; i2 < properties.size(); i2++) { if(save_global && properties[i2]->isKey()) { vstr = &o->getNonlocalizedKeyProperty(properties[i2]); if(vstr->empty()) { vstr = &o->getProperty(properties[i2], &approx); } else { o->getProperty(properties[i2], &approx); } } else { vstr = &o->getProperty(properties[i2], &approx); } if(save_global || approx >= 0 || !properties[i2]->isKey()) { if(!vstr->empty()) { if(properties[i2]->getReferenceName().find(' ') != string::npos) { if(save_global && properties[i2]->propertyType() == PROPERTY_STRING) { str = "_"; } else { str = ""; } str += properties[i2]->getReferenceName(); gsub(" ", "_", str); newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) str.c_str(), (xmlChar*) vstr->c_str()); } else { if(save_global && properties[i2]->propertyType() == PROPERTY_STRING) { str = "_"; str += properties[i2]->getReferenceName(); newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) str.c_str(), (xmlChar*) vstr->c_str()); } else { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) properties[i2]->getReferenceName().c_str(), (xmlChar*) vstr->c_str()); } } if(approx >= 0) { xmlNewProp(newnode2, (xmlChar*) "approximate", (xmlChar*) b2tf(approx > 0)); } } } } } } int returnvalue = 1; if(do_save) { returnvalue = xmlSaveFormatFile(filename.c_str(), doc, 1); } xmlFreeDoc(doc); return returnvalue; } bool DataSet::objectsLoaded() const { return b_loaded || sfile.empty(); } void DataSet::setObjectsLoaded(bool objects_loaded) { b_loaded = objects_loaded; } void DataSet::addProperty(DataProperty *dp) { properties.push_back(dp); setChanged(true); } void DataSet::delProperty(DataProperty *dp) { for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == dp) { delete properties[i]; properties.erase(properties.begin() + i); setChanged(true); break; } } } void DataSet::delProperty(DataPropertyIter *it) { *it = properties.erase(*it); --(*it); } DataProperty *DataSet::getPrimaryKeyProperty() { for(size_t i = 0; i < properties.size(); i++) { if(properties[i]->isKey()) return properties[i]; } return NULL; } DataProperty *DataSet::getProperty(string property) { if(property.empty()) return NULL; for(size_t i = 0; i < properties.size(); i++) { if(properties[i]->hasName(property)) return properties[i]; } return NULL; } DataProperty *DataSet::getFirstProperty(DataPropertyIter *it) { *it = properties.begin(); if(*it != properties.end()) return **it; return NULL; } DataProperty *DataSet::getNextProperty(DataPropertyIter *it) { ++(*it); if(*it != properties.end()) return **it; return NULL; } const string &DataSet::getFirstPropertyName(DataPropertyIter *it) { *it = properties.begin(); if(*it != properties.end()) return (**it)->getName(); return empty_string; } const string &DataSet::getNextPropertyName(DataPropertyIter *it) { ++(*it); if(*it != properties.end()) return (**it)->getName(); return empty_string; } void DataSet::addObject(DataObject *o) { objects.push_back(o); } void DataSet::delObject(DataObject *o) { for(size_t i = 0; i < objects.size(); i++) { if(objects[i] == o) { delete objects[i]; objects.erase(objects.begin() + i); break; } } } void DataSet::delObject(DataObjectIter *it) { *it = objects.erase(*it); --(*it); } DataObject *DataSet::getObject(string object) { if(!objectsLoaded()) loadObjects(); if(object.empty()) return NULL; DataProperty *dp; for(size_t i = 0; i < properties.size(); i++) { if(properties[i]->isKey()) { dp = properties[i]; if(dp->isCaseSensitive()) { for(size_t i2 = 0; i2 < objects.size(); i2++) { if(object == objects[i2]->getProperty(dp) || object == objects[i2]->getNonlocalizedKeyProperty(dp)) { return objects[i2]; } } } else { for(size_t i2 = 0; i2 < objects.size(); i2++) { if(equalsIgnoreCase(object, objects[i2]->getProperty(dp)) || equalsIgnoreCase(object, objects[i2]->getNonlocalizedKeyProperty(dp))) { return objects[i2]; } } } } } return NULL; } DataObject *DataSet::getObject(const MathStructure &object) { if(object.isSymbolic()) return getObject(object.symbol()); if(!objectsLoaded()) loadObjects(); DataProperty *dp; for(size_t i = 0; i < properties.size(); i++) { if(properties[i]->isKey()) { dp = properties[i]; if(dp->propertyType() != PROPERTY_STRING) { const MathStructure *mstruct; for(size_t i2 = 0; i2 < objects.size(); i2++) { mstruct = objects[i2]->getPropertyStruct(dp); if(mstruct && object.equals(*mstruct)) { return objects[i2]; } } } } } return NULL; } DataObject *DataSet::getFirstObject(DataObjectIter *it) { if(!objectsLoaded()) loadObjects(); *it = objects.begin(); if(*it != objects.end()) return **it; return NULL; } DataObject *DataSet::getNextObject(DataObjectIter *it) { ++(*it); if(*it != objects.end()) return **it; return NULL; } const MathStructure *DataSet::getObjectProperyStruct(string property, string object) { DataObject *o = getObject(object); DataProperty *dp = getProperty(property); if(o && dp) { return o->getPropertyStruct(dp); } return NULL; } const string &DataSet::getObjectProperty(string property, string object) { DataObject *o = getObject(object); DataProperty *dp = getProperty(property); if(o && dp) { return o->getProperty(dp); } return empty_string; } string DataSet::getObjectPropertyInputString(string property, string object) { DataObject *o = getObject(object); DataProperty *dp = getProperty(property); if(o && dp) { return o->getPropertyInputString(dp); } return empty_string; } string DataSet::getObjectPropertyDisplayString(string property, string object) { DataObject *o = getObject(object); DataProperty *dp = getProperty(property); if(o && dp) { return o->getPropertyDisplayString(dp); } return empty_string; } string DataSet::printProperties(string object) { return printProperties(getObject(object)); } string DataSet::printProperties(DataObject *o) { if(o) { string str, stmp; str = "-------------------------------------\n"; bool started = false; for(size_t i = 0; i < properties.size(); i++) { if(!properties[i]->isHidden() && properties[i]->isKey()) { stmp = o->getPropertyDisplayString(properties[i]); if(!stmp.empty()) { if(started) str += "\n\n"; else started = true; str += properties[i]->title(); str += ":\n"; str += stmp; } } } for(size_t i = 0; i < properties.size(); i++) { if(!properties[i]->isHidden() && !properties[i]->isKey()) { stmp = o->getPropertyDisplayString(properties[i]); if(!stmp.empty()) { if(started) str += "\n\n"; else started = true; str += properties[i]->title(); str += ":\n"; str += stmp; } } } str += "\n-------------------------------------"; return str; } return empty_string; } DataPropertyArgument::DataPropertyArgument(DataSet *data_set, string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) { b_text = true; o_data = data_set; } DataPropertyArgument::DataPropertyArgument(const DataPropertyArgument *arg) {set(arg); b_text = true; o_data = arg->dataSet();} DataPropertyArgument::~DataPropertyArgument() {} bool DataPropertyArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic() && o_data && (o_data->getProperty(value.symbol()) || equalsIgnoreCase(value.symbol(), string("info")) || equalsIgnoreCase(value.symbol(), string(_("info")))); } int DataPropertyArgument::type() const {return ARGUMENT_TYPE_DATA_PROPERTY;} Argument *DataPropertyArgument::copy() const {return new DataPropertyArgument(this);} string DataPropertyArgument::print() const {return _("data property");} string DataPropertyArgument::subprintlong() const { string str = _("name of a data property"); str += " ("; DataPropertyIter it; DataProperty *o = NULL; if(o_data) { o = o_data->getFirstProperty(&it); } if(!o) { str += _("no properties available"); } else { string stmp; size_t l_last = 0; while(true) { if(!o->isHidden()) { if(!stmp.empty()) { stmp += ", "; l_last = stmp.length(); } stmp += o->getName(); } o = o_data->getNextProperty(&it); if(!o) break; } if(stmp.empty()) { str += _("no properties available"); } else { if(l_last > 0) { stmp.insert(l_last, " "); stmp.insert(l_last, _("or")); } str += stmp; } } str += ")"; return str; } DataSet *DataPropertyArgument::dataSet() const {return o_data;} void DataPropertyArgument::setDataSet(DataSet *data_set) {o_data = data_set;} DataObjectArgument::DataObjectArgument(DataSet *data_set, string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) { b_text = true; o_data = data_set; } DataObjectArgument::DataObjectArgument(const DataObjectArgument *arg) {set(arg); b_text = true; o_data = arg->dataSet();} DataObjectArgument::~DataObjectArgument() {} bool DataObjectArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(value.isSymbolic()) return true; value.eval(eo); if(value.isSymbolic()) return true; if(!o_data) return false; DataPropertyIter it; DataProperty *dp = o_data->getFirstProperty(&it); while(dp) { if(dp->isKey() && (dp->propertyType() == PROPERTY_EXPRESSION || (value.isNumber() && dp->propertyType() == PROPERTY_NUMBER))) { return true; } dp = o_data->getNextProperty(&it); } CALCULATOR->error(true, _("Data set \"%s\" has no object key that supports the provided argument type."), o_data->title().c_str(), NULL); return false; } int DataObjectArgument::type() const {return ARGUMENT_TYPE_DATA_OBJECT;} Argument *DataObjectArgument::copy() const {return new DataObjectArgument(this);} string DataObjectArgument::print() const {return _("data object");} string DataObjectArgument::subprintlong() const { string str = _("an object from"); str += " \""; str += o_data->title(); str += "\""; DataPropertyIter it; DataProperty *o = NULL; if(o_data) { o = o_data->getFirstProperty(&it); } if(o) { string stmp; size_t l_last = 0; while(true) { if(o->isKey()) { if(!stmp.empty()) { stmp += ", "; l_last = stmp.length(); } stmp += o->getName(); } o = o_data->getNextProperty(&it); if(!o) break; } if(!stmp.empty()) { if(l_last > 0) { stmp.insert(l_last, " "); stmp.insert(l_last, _("or")); } str += " ("; str += _("use"); str += " "; str += stmp; str += ")"; } } return str; } DataSet *DataObjectArgument::dataSet() const {return o_data;} void DataObjectArgument::setDataSet(DataSet *data_set) {o_data = data_set;} libqalculate-0.9.7/libqalculate/Calculator.cc0000644000175100017510000106275411320653617016201 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #include "support.h" #include "Calculator.h" #include "BuiltinFunctions.h" #include "util.h" #include "MathStructure.h" #include "Unit.h" #include "Variable.h" #include "Function.h" #include "DataSet.h" #include "ExpressionItem.h" #include "Prefix.h" #include "Number.h" #include #include #include #include #include #include #include #include #include #include #include #include #include //#include #include using namespace cln; #define XML_GET_PREC_FROM_PROP(node, i) value = xmlGetProp(node, (xmlChar*) "precision"); if(value) {i = s2i((char*) value); xmlFree(value);} else {i = -1;} #define XML_GET_APPROX_FROM_PROP(node, b) value = xmlGetProp(node, (xmlChar*) "approximate"); if(value) {b = !xmlStrcmp(value, (const xmlChar*) "true");} else {value = xmlGetProp(node, (xmlChar*) "precise"); if(value) {b = xmlStrcmp(value, (const xmlChar*) "true");} else {b = false;}} if(value) xmlFree(value); #define XML_GET_FALSE_FROM_PROP(node, name, b) value = xmlGetProp(node, (xmlChar*) name); if(value && !xmlStrcmp(value, (const xmlChar*) "false")) {b = false;} else {b = true;} if(value) xmlFree(value); #define XML_GET_TRUE_FROM_PROP(node, name, b) value = xmlGetProp(node, (xmlChar*) name); if(value && !xmlStrcmp(value, (const xmlChar*) "true")) {b = true;} else {b = false;} if(value) xmlFree(value); #define XML_GET_BOOL_FROM_PROP(node, name, b) value = xmlGetProp(node, (xmlChar*) name); if(value && !xmlStrcmp(value, (const xmlChar*) "false")) {b = false;} else if(value && !xmlStrcmp(value, (const xmlChar*) "true")) {b = true;} if(value) xmlFree(value); #define XML_GET_FALSE_FROM_TEXT(node, b) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value && !xmlStrcmp(value, (const xmlChar*) "false")) {b = false;} else {b = true;} if(value) xmlFree(value); #define XML_GET_TRUE_FROM_TEXT(node, b) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value && !xmlStrcmp(value, (const xmlChar*) "true")) {b = true;} else {b = false;} if(value) xmlFree(value); #define XML_GET_BOOL_FROM_TEXT(node, b) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value && !xmlStrcmp(value, (const xmlChar*) "false")) {b = false;} else if(value && !xmlStrcmp(value, (const xmlChar*) "true")) {b = true;} if(value) xmlFree(value); #define XML_GET_STRING_FROM_PROP(node, name, str) value = xmlGetProp(node, (xmlChar*) name); if(value) {str = (char*) value; remove_blank_ends(str); xmlFree(value);} else str = ""; #define XML_GET_STRING_FROM_TEXT(node, str) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value) {str = (char*) value; remove_blank_ends(str); xmlFree(value);} else str = ""; #define XML_DO_FROM_PROP(node, name, action) value = xmlGetProp(node, (xmlChar*) name); if(value) action((char*) value); else action(""); if(value) xmlFree(value); #define XML_DO_FROM_TEXT(node, action) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value) {action((char*) value); xmlFree(value);} else action(""); #define XML_GET_INT_FROM_PROP(node, name, i) value = xmlGetProp(node, (xmlChar*) name); if(value) {i = s2i((char*) value); xmlFree(value);} #define XML_GET_INT_FROM_TEXT(node, i) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value) {i = s2i((char*) value); xmlFree(value);} #define XML_GET_LOCALE_STRING_FROM_TEXT(node, str, best, next_best) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); lang = xmlNodeGetLang(node); if(!best) {if(!lang) {if(!next_best) {if(value) {str = (char*) value; remove_blank_ends(str);} else str = ""; if(locale.empty()) {best = true;}}} else {if(locale == (char*) lang) {best = true; if(value) {str = (char*) value; remove_blank_ends(str);} else str = "";} else if(!next_best && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {next_best = true; if(value) {str = (char*) value; remove_blank_ends(str);} else str = "";} else if(!next_best && str.empty() && value) {str = (char*) value; remove_blank_ends(str);}}} if(value) xmlFree(value); if(lang) xmlFree(lang); #define XML_GET_LOCALE_STRING_FROM_TEXT_REQ(node, str, best, next_best) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); lang = xmlNodeGetLang(node); if(!best) {if(!lang) {if(!next_best) {if(value) {str = (char*) value; remove_blank_ends(str);} else str = ""; if(locale.empty()) {best = true;}}} else {if(locale == (char*) lang) {best = true; if(value) {str = (char*) value; remove_blank_ends(str);} else str = "";} else if(!next_best && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {next_best = true; if(value) {str = (char*) value; remove_blank_ends(str);} else str = "";} else if(!next_best && str.empty() && value && !require_translation) {str = (char*) value; remove_blank_ends(str);}}} if(value) xmlFree(value); if(lang) xmlFree(lang); const string &PrintOptions::comma() const {if(comma_sign.empty()) return CALCULATOR->getComma(); return comma_sign;} const string &PrintOptions::decimalpoint() const {if(decimalpoint_sign.empty()) return CALCULATOR->getDecimalPoint(); return decimalpoint_sign;} /*#include #include struct timeval tvtime; long int usecs, secs, usecs2, usecs3; #define PRINT_TIME(x) gettimeofday(&tvtime, NULL); usecs2 = tvtime.tv_usec - usecs + (tvtime.tv_sec - secs) * 1000000; printf("%s %li\n", x, usecs2); #define PRINT_TIMEDIFF(x) gettimeofday(&tvtime, NULL); printf("%s %li\n", x, tvtime.tv_usec - usecs + (tvtime.tv_sec - secs) * 1000000 - usecs2); usecs2 = tvtime.tv_usec - usecs + (tvtime.tv_sec - secs) * 1000000; #define ADD_TIME1 gettimeofday(&tvtime, NULL); usecs2 = tvtime.tv_usec - usecs + (tvtime.tv_sec - secs) * 1000000; #define ADD_TIME2 gettimeofday(&tvtime, NULL); usecs3 += tvtime.tv_usec - usecs + (tvtime.tv_sec - secs) * 1000000 - usecs2; */ typedef void (*CREATEPLUG_PROC)(); PlotParameters::PlotParameters() { auto_y_min = true; auto_x_min = true; auto_y_max = true; auto_x_max = true; y_log = false; x_log = false; y_log_base = 10; x_log_base = 10; grid = false; color = true; linewidth = -1; show_all_borders = false; legend_placement = PLOT_LEGEND_TOP_RIGHT; } PlotDataParameters::PlotDataParameters() { yaxis2 = false; xaxis2 = false; } CalculatorMessage::CalculatorMessage(string message_, MessageType type_) { mtype = type_; smessage = message_; } CalculatorMessage::CalculatorMessage(const CalculatorMessage &e) { mtype = e.type(); smessage = e.message(); } string CalculatorMessage::message() const { return smessage; } const char* CalculatorMessage::c_message() const { return smessage.c_str(); } MessageType CalculatorMessage::type() const { return mtype; } void Calculator::addStringAlternative(string replacement, string standard) { signs.push_back(replacement); real_signs.push_back(standard); } bool Calculator::delStringAlternative(string replacement, string standard) { for(size_t i = 0; i < signs.size(); i++) { if(signs[i] == replacement && real_signs[i] == standard) { signs.erase(signs.begin() + i); real_signs.erase(real_signs.begin() + i); return true; } } return false; } void Calculator::addDefaultStringAlternative(string replacement, string standard) { default_signs.push_back(replacement); default_real_signs.push_back(standard); } bool Calculator::delDefaultStringAlternative(string replacement, string standard) { for(size_t i = 0; i < default_signs.size(); i++) { if(default_signs[i] == replacement && default_real_signs[i] == standard) { default_signs.erase(default_signs.begin() + i); default_real_signs.erase(default_real_signs.begin() + i); return true; } } return false; } Calculator *calculator; MathStructure m_undefined, m_empty_vector, m_empty_matrix, m_zero, m_one, m_minus_one; Number nr_zero, nr_one, nr_minus_one; EvaluationOptions no_evaluation; ExpressionName empty_expression_name; enum { PROC_RPN_ADD, PROC_RPN_SET, PROC_RPN_OPERATION_1, PROC_RPN_OPERATION_2, PROC_NO_COMMAND }; void autoConvert(const MathStructure &morig, MathStructure &mconv, const EvaluationOptions &eo) { switch(eo.auto_post_conversion) { case POST_CONVERSION_BEST: { mconv.set(CALCULATOR->convertToBestUnit(morig, eo)); } case POST_CONVERSION_BASE: { mconv.set(CALCULATOR->convertToBaseUnits(morig, eo)); } default: {} } } void *calculate_proc(void *pipe) { pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); FILE *calculate_pipe = (FILE*) pipe; while(true) { bool b_parse = true; fread(&b_parse, sizeof(bool), 1, calculate_pipe); void *x = NULL; fread(&x, sizeof(void*), 1, calculate_pipe); MathStructure *mstruct = (MathStructure*) x; if(b_parse) { mstruct->set(_("aborted")); if(CALCULATOR->tmp_parsedstruct) CALCULATOR->tmp_parsedstruct->set(_("aborted")); if(CALCULATOR->tmp_tostruct) CALCULATOR->tmp_tostruct->setUndefined(); mstruct->set(CALCULATOR->calculate(CALCULATOR->expression_to_calculate, CALCULATOR->tmp_evaluationoptions, CALCULATOR->tmp_parsedstruct, CALCULATOR->tmp_tostruct, CALCULATOR->tmp_maketodivision)); } else { MathStructure meval(*mstruct); mstruct->set(_("aborted")); meval.eval(CALCULATOR->tmp_evaluationoptions); if(CALCULATOR->tmp_evaluationoptions.auto_post_conversion == POST_CONVERSION_NONE) mstruct->set(meval); else autoConvert(meval, *mstruct, CALCULATOR->tmp_evaluationoptions); } switch(CALCULATOR->tmp_proc_command) { case PROC_RPN_ADD: { CALCULATOR->RPNStackEnter(mstruct, false); break; } case PROC_RPN_SET: { CALCULATOR->setRPNRegister(CALCULATOR->tmp_rpnindex, mstruct, false); break; } case PROC_RPN_OPERATION_1: { if(CALCULATOR->RPNStackSize() > 0) { CALCULATOR->setRPNRegister(1, mstruct, false); } else { CALCULATOR->RPNStackEnter(mstruct, false); } break; } case PROC_RPN_OPERATION_2: { if(CALCULATOR->RPNStackSize() > 1) { CALCULATOR->deleteRPNRegister(1); } if(CALCULATOR->RPNStackSize() > 0) { CALCULATOR->setRPNRegister(1, mstruct, false); } else { CALCULATOR->RPNStackEnter(mstruct, false); } break; } case PROC_NO_COMMAND: {} } CALCULATOR->b_busy = false; } return NULL; } void *print_proc(void *pipe) { pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); FILE *print_pipe = (FILE*) pipe; while(true) { void *x = NULL; fread(&x, sizeof(void*), 1, print_pipe); const MathStructure *mstruct = (const MathStructure*) x; MathStructure mstruct2(*mstruct); mstruct2.format(); CALCULATOR->tmp_print_result = mstruct2.print(CALCULATOR->tmp_printoptions); CALCULATOR->b_busy = false; } return NULL; } Calculator::Calculator() { #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); #endif has_gnomevfs = -1; exchange_rates_warning_issued = false; setPrecision(DEFAULT_PRECISION); addStringAlternative(SIGN_POWER_1, "^(1)"); addStringAlternative(SIGN_POWER_2, "^(2)"); addStringAlternative(SIGN_POWER_3, "^(3)"); addStringAlternative(SIGN_INFINITY, "infinity"); addStringAlternative(SIGN_DIVISION, DIVISION); addStringAlternative(SIGN_DIVISION_SLASH, DIVISION); addStringAlternative(SIGN_MULTIPLICATION, MULTIPLICATION); addStringAlternative(SIGN_MULTIDOT, MULTIPLICATION); addStringAlternative(SIGN_MULTIBULLET, MULTIPLICATION); addStringAlternative(SIGN_SMALLCIRCLE, MULTIPLICATION); addStringAlternative(SIGN_MINUS, MINUS); addStringAlternative(SIGN_PLUS, PLUS); addStringAlternative(SIGN_NOT_EQUAL, " " NOT EQUALS); addStringAlternative(SIGN_GREATER_OR_EQUAL, GREATER EQUALS); addStringAlternative(SIGN_LESS_OR_EQUAL, LESS EQUALS); addStringAlternative("(+infinity)", "plus_infinity"); addStringAlternative("(-infinity)", "minus_infinity"); addStringAlternative(";", COMMA); addStringAlternative("\t", SPACE); addStringAlternative("\n", SPACE); addStringAlternative("**", POWER); per_str = _("per"); per_str_len = per_str.length(); times_str = _("times"); times_str_len = times_str.length(); plus_str = _("plus"); plus_str_len = plus_str.length(); minus_str = _("minus"); minus_str_len = minus_str.length(); and_str = _("and"); and_str_len = and_str.length(); AND_str = "AND"; AND_str_len = AND_str.length(); or_str = _("or"); or_str_len = or_str.length(); OR_str = "OR"; OR_str_len = OR_str.length(); XOR_str = "XOR"; XOR_str_len = OR_str.length(); saved_locale = strdup(setlocale(LC_NUMERIC, NULL)); struct lconv *lc = localeconv(); place_currency_code_before = lc->int_p_cs_precedes; place_currency_code_before_negative = lc->int_n_cs_precedes; place_currency_sign_before = lc->p_cs_precedes; place_currency_sign_before_negative = lc->n_cs_precedes; default_dot_as_separator = strcmp(lc->thousands_sep, ".") == 0; if(strcmp(lc->decimal_point, ",") == 0) { DOT_STR = ","; DOT_S = ".,"; COMMA_STR = ";"; COMMA_S = ";"; } else { DOT_STR = "."; DOT_S = "."; COMMA_STR = ","; COMMA_S = ",;"; } setlocale(LC_NUMERIC, "C"); NAME_NUMBER_PRE_S = "_#"; NAME_NUMBER_PRE_STR = "_"; string str = _(" to "); local_to = (str != " to "); ids_i = 0; decimal_null_prefix = new DecimalPrefix(0, "", ""); binary_null_prefix = new BinaryPrefix(0, "", ""); m_undefined.setUndefined(); m_empty_vector.clearVector(); m_empty_matrix.clearMatrix(); m_zero.clear(); m_one.set(1, 1); m_minus_one.set(-1, 1); nr_zero.clear(); nr_one.set(1, 1); nr_minus_one.set(-1, 1); no_evaluation.approximation = APPROXIMATION_EXACT; no_evaluation.structuring = STRUCTURING_NONE; no_evaluation.sync_units = false; save_printoptions.decimalpoint_sign = "."; save_printoptions.comma_sign = ","; save_printoptions.use_reference_names = true; save_printoptions.show_ending_zeroes = true; save_printoptions.number_fraction_format = FRACTION_DECIMAL_EXACT; save_printoptions.short_multiplication = false; default_assumptions = new Assumptions; default_assumptions->setType(ASSUMPTION_TYPE_REAL); default_assumptions->setSign(ASSUMPTION_SIGN_UNKNOWN); u_rad = NULL; u_gra = NULL; u_deg = NULL; b_save_called = false; ILLEGAL_IN_NAMES = DOT_S + RESERVED OPERATORS SPACES PARENTHESISS VECTOR_WRAPS; ILLEGAL_IN_NAMES_MINUS_SPACE_STR = DOT_S + RESERVED OPERATORS PARENTHESISS VECTOR_WRAPS; ILLEGAL_IN_UNITNAMES = ILLEGAL_IN_NAMES + NUMBERS; b_argument_errors = true; calculator = this; srand48(time(0)); addBuiltinVariables(); addBuiltinFunctions(); addBuiltinUnits(); disable_errors_ref = 0; b_busy = false; b_gnuplot_open = false; gnuplot_pipe = NULL; calculate_thread_stopped = true; pthread_attr_init(&calculate_thread_attr); int pipe_wr[] = {0, 0}; pipe(pipe_wr); calculate_pipe_r = fdopen(pipe_wr[0], "r"); calculate_pipe_w = fdopen(pipe_wr[1], "w"); print_thread_stopped = true; pthread_attr_init(&print_thread_attr); pipe(pipe_wr); print_pipe_r = fdopen(pipe_wr[0], "r"); print_pipe_w = fdopen(pipe_wr[1], "w"); } Calculator::~Calculator() { closeGnuplot(); } Unit *Calculator::getGraUnit() { if(!u_gra) u_gra = getUnit("gra"); if(!u_gra) { CALCULATOR->error(true, _("Gradians unit is missing. Creating one for this session."), NULL); u_gra = addUnit(new AliasUnit(_("Angle/Plane Angle"), "gra", "gradians", "gradian", "Gradian", getRadUnit(), "pi/200", 1, "", false, true, true)); } return u_gra; } Unit *Calculator::getRadUnit() { if(!u_rad) u_rad = getUnit("rad"); if(!u_rad) { CALCULATOR->error(true, _("Radians unit is missing. Creating one for this session."), NULL); u_rad = addUnit(new Unit(_("Angle/Plane Angle"), "rad", "radians", "radian", "Radian", false, true, true)); } return u_rad; } Unit *Calculator::getDegUnit() { if(!u_deg) u_deg = getUnit("deg"); if(!u_deg) { CALCULATOR->error(true, _("Degrees unit is missing. Creating one for this session."), NULL); u_deg = addUnit(new AliasUnit(_("Angle/Plane Angle"), "deg", "degrees", "degree", "Degree", getRadUnit(), "pi/180", 1, "", false, true, true)); } return u_deg; } bool Calculator::utf8_pos_is_valid_in_name(char *pos) { if(is_in(ILLEGAL_IN_NAMES, pos[0])) { return false; } if((unsigned char) pos[0] >= 0xC0) { string str; str += pos[0]; while((unsigned char) pos[1] >= 0x80 && (unsigned char) pos[1] <= 0xBF) { str += pos[1]; pos++; } return str != SIGN_DIVISION && str != SIGN_DIVISION_SLASH && str != SIGN_MULTIPLICATION && str != SIGN_MULTIDOT && str != SIGN_SMALLCIRCLE && str != SIGN_MULTIBULLET && str != SIGN_MINUS && str != SIGN_PLUS && str != SIGN_NOT_EQUAL && str != SIGN_GREATER_OR_EQUAL && str != SIGN_LESS_OR_EQUAL; } return true; } bool Calculator::showArgumentErrors() const { return b_argument_errors; } void Calculator::beginTemporaryStopMessages() { disable_errors_ref++; stopped_errors_count.push_back(0); stopped_warnings_count.push_back(0); stopped_messages_count.push_back(0); } int Calculator::endTemporaryStopMessages(int *message_count, int *warning_count) { if(disable_errors_ref <= 0) return -1; disable_errors_ref--; int ret = stopped_errors_count[disable_errors_ref]; if(message_count) *message_count = stopped_messages_count[disable_errors_ref]; if(warning_count) *warning_count = stopped_warnings_count[disable_errors_ref]; stopped_errors_count.pop_back(); stopped_warnings_count.pop_back(); stopped_messages_count.pop_back(); return ret; } Variable *Calculator::getVariable(size_t index) const { if(index < variables.size()) { return variables[index]; } return NULL; } bool Calculator::hasVariable(Variable *v) { for(size_t i = 0; i < variables.size(); i++) { if(variables[i] == v) return true; } return false; } bool Calculator::hasUnit(Unit *u) { for(size_t i = 0; i < units.size(); i++) { if(units[i] == u) return true; } return false; } bool Calculator::hasFunction(MathFunction *f) { for(size_t i = 0; i < functions.size(); i++) { if(functions[i] == f) return true; } return false; } bool Calculator::stillHasVariable(Variable *v) { for(vector::iterator it = deleted_variables.begin(); it != deleted_variables.end(); ++it) { if(*it == v) return false; } return true; } bool Calculator::stillHasUnit(Unit *u) { for(vector::iterator it = deleted_units.begin(); it != deleted_units.end(); ++it) { if(*it == u) return false; } return true; } bool Calculator::stillHasFunction(MathFunction *f) { for(vector::iterator it = deleted_functions.begin(); it != deleted_functions.end(); ++it) { if(*it == f) return false; } return true; } void Calculator::saveFunctionCalled() { b_save_called = true; } bool Calculator::checkSaveFunctionCalled() { if(b_save_called) { b_save_called = false; return true; } return false; } ExpressionItem *Calculator::getActiveExpressionItem(ExpressionItem *item) { if(!item) return NULL; for(size_t i = 1; i <= item->countNames(); i++) { ExpressionItem *item2 = getActiveExpressionItem(item->getName(i).name, item); if(item2) { return item2; } } return NULL; } ExpressionItem *Calculator::getActiveExpressionItem(string name, ExpressionItem *item) { if(name.empty()) return NULL; for(size_t index = 0; index < variables.size(); index++) { if(variables[index] != item && variables[index]->isActive() && variables[index]->hasName(name)) { return variables[index]; } } for(size_t index = 0; index < functions.size(); index++) { if(functions[index] != item && functions[index]->isActive() && functions[index]->hasName(name)) { return functions[index]; } } for(size_t i = 0; i < units.size(); i++) { if(units[i] != item && units[i]->isActive() && units[i]->hasName(name)) { return units[i]; } } return NULL; } ExpressionItem *Calculator::getInactiveExpressionItem(string name, ExpressionItem *item) { if(name.empty()) return NULL; for(size_t index = 0; index < variables.size(); index++) { if(variables[index] != item && !variables[index]->isActive() && variables[index]->hasName(name)) { return variables[index]; } } for(size_t index = 0; index < functions.size(); index++) { if(functions[index] != item && !functions[index]->isActive() && functions[index]->hasName(name)) { return functions[index]; } } for(size_t i = 0; i < units.size(); i++) { if(units[i] != item && !units[i]->isActive() && units[i]->hasName(name)) { return units[i]; } } return NULL; } ExpressionItem *Calculator::getExpressionItem(string name, ExpressionItem *item) { if(name.empty()) return NULL; Variable *v = getVariable(name); if(v && v != item) return v; MathFunction *f = getFunction(name); if(f && f != item) return f; Unit *u = getUnit(name); if(u && u != item) return u; u = getCompositeUnit(name); if(u && u != item) return u; return NULL; } Unit *Calculator::getUnit(size_t index) const { if(index < units.size()) { return units[index]; } return NULL; } MathFunction *Calculator::getFunction(size_t index) const { if(index < functions.size()) { return functions[index]; } return NULL; } void Calculator::setDefaultAssumptions(Assumptions *ass) { if(default_assumptions) delete default_assumptions; default_assumptions = ass; } Assumptions *Calculator::defaultAssumptions() { return default_assumptions; } Prefix *Calculator::getPrefix(size_t index) const { if(index < prefixes.size()) { return prefixes[index]; } return NULL; } Prefix *Calculator::getPrefix(string name_) const { for(size_t i = 0; i < prefixes.size(); i++) { if(prefixes[i]->shortName(false) == name_ || prefixes[i]->longName(false) == name_ || prefixes[i]->unicodeName(false) == name_) { return prefixes[i]; } } return NULL; } DecimalPrefix *Calculator::getExactDecimalPrefix(int exp10, int exp) const { for(size_t i = 0; i < decimal_prefixes.size(); i++) { if(decimal_prefixes[i]->exponent(exp) == exp10) { return decimal_prefixes[i]; } else if(decimal_prefixes[i]->exponent(exp) > exp10) { break; } } return NULL; } BinaryPrefix *Calculator::getExactBinaryPrefix(int exp2, int exp) const { for(size_t i = 0; i < binary_prefixes.size(); i++) { if(binary_prefixes[i]->exponent(exp) == exp2) { return binary_prefixes[i]; } else if(binary_prefixes[i]->exponent(exp) > exp2) { break; } } return NULL; } Prefix *Calculator::getExactPrefix(const Number &o, int exp) const { ComparisonResult c; for(size_t i = 0; i < prefixes.size(); i++) { c = o.compare(prefixes[i]->value(exp)); if(c == COMPARISON_RESULT_EQUAL) { return prefixes[i]; } else if(c == COMPARISON_RESULT_GREATER) { break; } } return NULL; } DecimalPrefix *Calculator::getNearestDecimalPrefix(int exp10, int exp) const { if(decimal_prefixes.size() <= 0) return NULL; int i = 0; if(exp < 0) { i = decimal_prefixes.size() - 1; } while((exp < 0 && i >= 0) || (exp >= 0 && i < (int) decimal_prefixes.size())) { if(decimal_prefixes[i]->exponent(exp) == exp10) { return decimal_prefixes[i]; } else if(decimal_prefixes[i]->exponent(exp) > exp10) { if(i == 0) { return decimal_prefixes[i]; } else if(exp10 - decimal_prefixes[i - 1]->exponent(exp) < decimal_prefixes[i]->exponent(exp) - exp10) { return decimal_prefixes[i - 1]; } else { return decimal_prefixes[i]; } } if(exp < 0) { i--; } else { i++; } } return decimal_prefixes[decimal_prefixes.size() - 1]; } DecimalPrefix *Calculator::getBestDecimalPrefix(int exp10, int exp, bool all_prefixes) const { if(decimal_prefixes.size() <= 0 || exp10 == 0) return NULL; int i = 0; if(exp < 0) { i = decimal_prefixes.size() - 1; } DecimalPrefix *p = NULL, *p_prev = NULL; int exp10_1, exp10_2; while((exp < 0 && i >= 0) || (exp >= 0 && i < (int) decimal_prefixes.size())) { if(all_prefixes || decimal_prefixes[i]->exponent() % 3 == 0) { p = decimal_prefixes[i]; if(p_prev && p_prev->exponent() >= 0 != p->exponent() >= 0 && p_prev->exponent() != 0) { if(exp < 0) { i++; } else { i--; } p = decimal_null_prefix; } if(p->exponent(exp) == exp10) { if(p == decimal_null_prefix) return NULL; return p; } else if(p->exponent(exp) > exp10) { if(i == 0) { if(p == decimal_null_prefix) return NULL; return p; } exp10_1 = exp10; if(p_prev) { exp10_1 -= p_prev->exponent(exp); } exp10_2 = p->exponent(exp); exp10_2 -= exp10; exp10_2 *= 2; exp10_2 += 2; if(exp10_1 < exp10_2) { if(p_prev == decimal_null_prefix) return NULL; return p_prev; } else { return p; } } p_prev = p; } if(exp < 0) { i--; } else { i++; } } return p_prev; } DecimalPrefix *Calculator::getBestDecimalPrefix(const Number &exp10, const Number &exp, bool all_prefixes) const { if(decimal_prefixes.size() <= 0 || exp10.isZero()) return NULL; int i = 0; ComparisonResult c; if(exp.isNegative()) { i = decimal_prefixes.size() - 1; } DecimalPrefix *p = NULL, *p_prev = NULL; Number exp10_1, exp10_2; while((exp.isNegative() && i >= 0) || (!exp.isNegative() && i < (int) decimal_prefixes.size())) { if(all_prefixes || decimal_prefixes[i]->exponent() % 3 == 0) { p = decimal_prefixes[i]; if(p_prev && p_prev->exponent() >= 0 != p->exponent() >= 0 && p_prev->exponent() != 0) { if(exp.isNegative()) { i++; } else { i--; } p = decimal_null_prefix; } c = exp10.compare(p->exponent(exp)); if(c == COMPARISON_RESULT_EQUAL) { if(p == decimal_null_prefix) return NULL; return p; } else if(c == COMPARISON_RESULT_GREATER) { if(i == 0) { if(p == decimal_null_prefix) return NULL; return p; } exp10_1 = exp10; if(p_prev) { exp10_1 -= p_prev->exponent(exp); } exp10_2 = p->exponent(exp); exp10_2 -= exp10; exp10_2 *= 2; exp10_2 += 2; if(exp10_1.isLessThan(exp10_2)) { if(p_prev == decimal_null_prefix) return NULL; return p_prev; } else { return p; } } p_prev = p; } if(exp.isNegative()) { i--; } else { i++; } } return p_prev; } BinaryPrefix *Calculator::getNearestBinaryPrefix(int exp2, int exp) const { if(binary_prefixes.size() <= 0) return NULL; int i = 0; if(exp < 0) { i = binary_prefixes.size() - 1; } while((exp < 0 && i >= 0) || (exp >= 0 && i < (int) binary_prefixes.size())) { if(binary_prefixes[i]->exponent(exp) == exp2) { return binary_prefixes[i]; } else if(binary_prefixes[i]->exponent(exp) > exp2) { if(i == 0) { return binary_prefixes[i]; } else if(exp2 - binary_prefixes[i - 1]->exponent(exp) < binary_prefixes[i]->exponent(exp) - exp2) { return binary_prefixes[i - 1]; } else { return binary_prefixes[i]; } } if(exp < 0) { i--; } else { i++; } } return binary_prefixes[binary_prefixes.size() - 1]; } BinaryPrefix *Calculator::getBestBinaryPrefix(int exp2, int exp) const { if(binary_prefixes.size() <= 0 || exp2 == 0) return NULL; int i = 0; if(exp < 0) { i = binary_prefixes.size() - 1; } BinaryPrefix *p = NULL, *p_prev = NULL; int exp2_1, exp2_2; while((exp < 0 && i >= 0) || (exp >= 0 && i < (int) binary_prefixes.size())) { p = binary_prefixes[i]; if(p_prev && p_prev->exponent() >= 0 != p->exponent() >= 0 && p_prev->exponent() != 0) { if(exp < 0) { i++; } else { i--; } p = binary_null_prefix; } if(p->exponent(exp) == exp2) { if(p == binary_null_prefix) return NULL; return p; } else if(p->exponent(exp) > exp2) { if(i == 0) { if(p == binary_null_prefix) return NULL; return p; } exp2_1 = exp2; if(p_prev) { exp2_1 -= p_prev->exponent(exp); } exp2_2 = p->exponent(exp); exp2_2 -= exp2; exp2_2 *= 2; exp2_2 += 2; if(exp2_1 < exp2_2) { if(p_prev == binary_null_prefix) return NULL; return p_prev; } else { return p; } } p_prev = p; if(exp < 0) { i--; } else { i++; } } return p_prev; } BinaryPrefix *Calculator::getBestBinaryPrefix(const Number &exp2, const Number &exp) const { if(binary_prefixes.size() <= 0 || exp2.isZero()) return NULL; int i = 0; ComparisonResult c; if(exp.isNegative()) { i = binary_prefixes.size() - 1; } BinaryPrefix *p = NULL, *p_prev = NULL; Number exp2_1, exp2_2; while((exp.isNegative() && i >= 0) || (!exp.isNegative() && i < (int) binary_prefixes.size())) { p = binary_prefixes[i]; if(p_prev && p_prev->exponent() >= 0 != p->exponent() >= 0 && p_prev->exponent() != 0) { if(exp.isNegative()) { i++; } else { i--; } p = binary_null_prefix; } c = exp2.compare(p->exponent(exp)); if(c == COMPARISON_RESULT_EQUAL) { if(p == binary_null_prefix) return NULL; return p; } else if(c == COMPARISON_RESULT_GREATER) { if(i == 0) { if(p == binary_null_prefix) return NULL; return p; } exp2_1 = exp2; if(p_prev) { exp2_1 -= p_prev->exponent(exp); } exp2_2 = p->exponent(exp); exp2_2 -= exp2; exp2_2 *= 2; exp2_2 += 2; if(exp2_1.isLessThan(exp2_2)) { if(p_prev == binary_null_prefix) return NULL; return p_prev; } else { return p; } } p_prev = p; if(exp.isNegative()) { i--; } else { i++; } } return p_prev; } Prefix *Calculator::addPrefix(Prefix *p) { if(p->type() == PREFIX_DECIMAL) { decimal_prefixes.push_back((DecimalPrefix*) p); } else if(p->type() == PREFIX_BINARY) { binary_prefixes.push_back((BinaryPrefix*) p); } prefixes.push_back(p); prefixNameChanged(p, true); return p; } void Calculator::prefixNameChanged(Prefix *p, bool new_item) { size_t l2; if(!new_item) delPrefixUFV(p); if(!p->longName(false).empty()) { l2 = p->longName(false).length(); if(l2 > UFV_LENGTHS) { size_t i = 0, l; for(vector::iterator it = ufvl.begin(); ; ++it) { l = 0; if(it != ufvl.end()) { if(ufvl_t[i] == 'v') l = ((Variable*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'f') l = ((MathFunction*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'u') l = ((Unit*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'p') l = ((Prefix*) (*it))->shortName(false).length(); else if(ufvl_t[i] == 'P') l = ((Prefix*) (*it))->longName(false).length(); else if(ufvl_t[i] == 'q') l = ((Prefix*) (*it))->unicodeName(false).length(); } if(it == ufvl.end()) { ufvl.push_back((void*) p); ufvl_t.push_back('P'); ufvl_i.push_back(1); break; } else if(l <= l2) { ufvl.insert(it, (void*) p); ufvl_t.insert(ufvl_t.begin() + i, 'P'); ufvl_i.insert(ufvl_i.begin() + i, 1); break; } i++; } } else if(l2 > 0) { l2--; ufv[0][l2].push_back((void*) p); ufv_i[0][l2].push_back(1); } } if(!p->shortName(false).empty()) { l2 = p->shortName(false).length(); if(l2 > UFV_LENGTHS) { size_t i = 0, l; for(vector::iterator it = ufvl.begin(); ; ++it) { l = 0; if(it != ufvl.end()) { if(ufvl_t[i] == 'v') l = ((Variable*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'f') l = ((MathFunction*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'u') l = ((Unit*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'p') l = ((Prefix*) (*it))->shortName(false).length(); else if(ufvl_t[i] == 'P') l = ((Prefix*) (*it))->longName(false).length(); else if(ufvl_t[i] == 'q') l = ((Prefix*) (*it))->unicodeName(false).length(); } if(it == ufvl.end()) { ufvl.push_back((void*) p); ufvl_t.push_back('p'); ufvl_i.push_back(1); break; } else if(l <= l2) { ufvl.insert(it, (void*) p); ufvl_t.insert(ufvl_t.begin() + i, 'p'); ufvl_i.insert(ufvl_i.begin() + i, 1); break; } i++; } } else if(l2 > 0) { l2--; ufv[0][l2].push_back((void*) p); ufv_i[0][l2].push_back(2); } } if(!p->unicodeName(false).empty()) { l2 = p->unicodeName(false).length(); if(l2 > UFV_LENGTHS) { size_t i = 0, l; for(vector::iterator it = ufvl.begin(); ; ++it) { l = 0; if(it != ufvl.end()) { if(ufvl_t[i] == 'v') l = ((Variable*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'f') l = ((MathFunction*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'u') l = ((Unit*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'p') l = ((Prefix*) (*it))->shortName(false).length(); else if(ufvl_t[i] == 'P') l = ((Prefix*) (*it))->longName(false).length(); else if(ufvl_t[i] == 'q') l = ((Prefix*) (*it))->unicodeName(false).length(); } if(it == ufvl.end()) { ufvl.push_back((void*) p); ufvl_t.push_back('q'); ufvl_i.push_back(1); break; } else if(l <= l2) { ufvl.insert(it, (void*) p); ufvl_t.insert(ufvl_t.begin() + i, 'q'); ufvl_i.insert(ufvl_i.begin() + i, 1); break; } i++; } } else if(l2 > 0) { l2--; ufv[0][l2].push_back((void*) p); ufv_i[0][l2].push_back(3); } } } void Calculator::setPrecision(int precision) { if(precision <= 0) precision = DEFAULT_PRECISION; /* if(precision < 10) { cln::default_float_format = float_format(precision + (10 - precision) + 5); */ if(precision < cln::float_format_lfloat_min) { cln::default_float_format = cln::float_format(cln::float_format_lfloat_min + 5); } else { cln::default_float_format = cln::float_format(precision + 5); } i_precision = precision; } int Calculator::getPrecision() const { return i_precision; } const string &Calculator::getDecimalPoint() const {return DOT_STR;} const string &Calculator::getComma() const {return COMMA_STR;} string Calculator::localToString() const { return _(" to "); } void Calculator::setLocale() { setlocale(LC_NUMERIC, saved_locale); lconv *locale = localeconv(); if(strcmp(locale->decimal_point, ",") == 0) { DOT_STR = ","; DOT_S = ".,"; COMMA_STR = ";"; COMMA_S = ";"; } else { DOT_STR = "."; DOT_S = "."; COMMA_STR = ","; COMMA_S = ",;"; } setlocale(LC_NUMERIC, "C"); } void Calculator::useDecimalComma() { DOT_STR = ","; DOT_S = ".,"; COMMA_STR = ";"; COMMA_S = ";"; } void Calculator::useDecimalPoint() { DOT_STR = "."; DOT_S = "."; COMMA_STR = ","; COMMA_S = ",;"; } void Calculator::unsetLocale() { COMMA_STR = ","; COMMA_S = ",;"; DOT_STR = "."; DOT_S = "."; } size_t Calculator::addId(MathStructure *mstruct, bool persistent) { size_t id = 0; if(freed_ids.size() > 0) { id = freed_ids.back(); freed_ids.pop_back(); } else { ids_i++; id = ids_i; } ids_p[id] = persistent; id_structs[id] = mstruct; return id; } size_t Calculator::parseAddId(MathFunction *f, const string &str, const ParseOptions &po, bool persistent) { size_t id = 0; if(freed_ids.size() > 0) { id = freed_ids.back(); freed_ids.pop_back(); } else { ids_i++; id = ids_i; } ids_p[id] = persistent; id_structs[id] = new MathStructure(); f->parse(*id_structs[id], str, po); return id; } size_t Calculator::parseAddIdAppend(MathFunction *f, const MathStructure &append_mstruct, const string &str, const ParseOptions &po, bool persistent) { size_t id = 0; if(freed_ids.size() > 0) { id = freed_ids.back(); freed_ids.pop_back(); } else { ids_i++; id = ids_i; } ids_p[id] = persistent; id_structs[id] = new MathStructure(); f->parse(*id_structs[id], str, po); id_structs[id]->addChild(append_mstruct); return id; } size_t Calculator::parseAddVectorId(const string &str, const ParseOptions &po, bool persistent) { size_t id = 0; if(freed_ids.size() > 0) { id = freed_ids.back(); freed_ids.pop_back(); } else { ids_i++; id = ids_i; } ids_p[id] = persistent; id_structs[id] = new MathStructure(); f_vector->args(str, *id_structs[id], po); return id; } MathStructure *Calculator::getId(size_t id) { if(id_structs.find(id) != id_structs.end()) { if(ids_p[id]) { return new MathStructure(*id_structs[id]); } else { MathStructure *mstruct = id_structs[id]; freed_ids.push_back(id); id_structs.erase(id); ids_p.erase(id); return mstruct; } } return NULL; } void Calculator::delId(size_t id) { if(ids_p.find(id) != ids_p.end()) { freed_ids.push_back(id); id_structs[id]->unref(); id_structs.erase(id); ids_p.erase(id); } } void Calculator::resetVariables() { variables.clear(); addBuiltinVariables(); } void Calculator::resetFunctions() { functions.clear(); addBuiltinFunctions(); } void Calculator::resetUnits() { units.clear(); addBuiltinUnits(); } void Calculator::reset() { resetVariables(); resetFunctions(); resetUnits(); } void Calculator::addBuiltinVariables() { v_e = (KnownVariable*) addVariable(new EVariable()); v_pi = (KnownVariable*) addVariable(new PiVariable()); Number nr(1, 1); MathStructure mstruct; mstruct.number().setImaginaryPart(nr); v_i = (KnownVariable*) addVariable(new KnownVariable("", "i", mstruct, "Imaginary i (sqrt(-1))", false, true)); mstruct.number().setInfinity(); v_inf = (KnownVariable*) addVariable(new KnownVariable("", "infinity", mstruct, "Infinity", false, true)); mstruct.number().setPlusInfinity(); v_pinf = (KnownVariable*) addVariable(new KnownVariable("", "plus_infinity", mstruct, "+Infinity", false, true)); mstruct.number().setMinusInfinity(); v_minf = (KnownVariable*) addVariable(new KnownVariable("", "minus_infinity", mstruct, "-Infinity", false, true)); mstruct.setUndefined(); v_undef = (KnownVariable*) addVariable(new KnownVariable("", "undefined", mstruct, "Undefined", false, true)); addVariable(new EulerVariable()); addVariable(new CatalanVariable()); v_x = (UnknownVariable*) addVariable(new UnknownVariable("", "x", "", true, false)); v_y = (UnknownVariable*) addVariable(new UnknownVariable("", "y", "", true, false)); v_z = (UnknownVariable*) addVariable(new UnknownVariable("", "z", "", true, false)); } void Calculator::addBuiltinFunctions() { f_vector = addFunction(new VectorFunction()); f_sort = addFunction(new SortFunction()); f_rank = addFunction(new RankFunction()); f_limits = addFunction(new LimitsFunction()); //f_component = addFunction(new ComponentFunction()); f_dimension = addFunction(new DimensionFunction()); f_merge_vectors = addFunction(new MergeVectorsFunction()); f_matrix = addFunction(new MatrixFunction()); f_matrix_to_vector = addFunction(new MatrixToVectorFunction()); f_area = addFunction(new AreaFunction()); f_rows = addFunction(new RowsFunction()); f_columns = addFunction(new ColumnsFunction()); f_row = addFunction(new RowFunction()); f_column = addFunction(new ColumnFunction()); f_elements = addFunction(new ElementsFunction()); f_element = addFunction(new ElementFunction()); f_transpose = addFunction(new TransposeFunction()); f_identity = addFunction(new IdentityFunction()); f_determinant = addFunction(new DeterminantFunction()); f_permanent = addFunction(new PermanentFunction()); f_adjoint = addFunction(new AdjointFunction()); f_cofactor = addFunction(new CofactorFunction()); f_inverse = addFunction(new InverseFunction()); f_factorial = addFunction(new FactorialFunction()); f_factorial2 = addFunction(new DoubleFactorialFunction()); f_multifactorial = addFunction(new MultiFactorialFunction()); f_binomial = addFunction(new BinomialFunction()); f_xor = addFunction(new XorFunction()); f_bitxor = addFunction(new BitXorFunction()); f_even = addFunction(new EvenFunction()); f_odd = addFunction(new OddFunction()); f_shift = addFunction(new ShiftFunction()); f_abs = addFunction(new AbsFunction()); f_signum = addFunction(new SignumFunction()); f_gcd = addFunction(new GcdFunction()); f_lcm = addFunction(new LcmFunction()); f_round = addFunction(new RoundFunction()); f_floor = addFunction(new FloorFunction()); f_ceil = addFunction(new CeilFunction()); f_trunc = addFunction(new TruncFunction()); f_int = addFunction(new IntFunction()); f_frac = addFunction(new FracFunction()); f_rem = addFunction(new RemFunction()); f_mod = addFunction(new ModFunction()); f_polynomial_unit = addFunction(new PolynomialUnitFunction()); f_polynomial_primpart = addFunction(new PolynomialPrimpartFunction()); f_polynomial_content = addFunction(new PolynomialContentFunction()); f_coeff = addFunction(new CoeffFunction()); f_lcoeff = addFunction(new LCoeffFunction()); f_tcoeff = addFunction(new TCoeffFunction()); f_degree = addFunction(new DegreeFunction()); f_ldegree = addFunction(new LDegreeFunction()); f_re = addFunction(new ReFunction()); f_im = addFunction(new ImFunction()); //f_arg = addFunction(new ArgFunction()); f_numerator = addFunction(new NumeratorFunction()); f_denominator = addFunction(new DenominatorFunction()); f_sqrt = addFunction(new SqrtFunction()); f_sq = addFunction(new SquareFunction()); f_exp = addFunction(new ExpFunction()); f_ln = addFunction(new LogFunction()); f_logn = addFunction(new LognFunction()); f_lambert_w = addFunction(new LambertWFunction()); f_sin = addFunction(new SinFunction()); f_cos = addFunction(new CosFunction()); f_tan = addFunction(new TanFunction()); f_asin = addFunction(new AsinFunction()); f_acos = addFunction(new AcosFunction()); f_atan = addFunction(new AtanFunction()); f_sinh = addFunction(new SinhFunction()); f_cosh = addFunction(new CoshFunction()); f_tanh = addFunction(new TanhFunction()); f_asinh = addFunction(new AsinhFunction()); f_acosh = addFunction(new AcoshFunction()); f_atanh = addFunction(new AtanhFunction()); f_radians_to_default_angle_unit = addFunction(new RadiansToDefaultAngleUnitFunction()); f_zeta = addFunction(new ZetaFunction()); f_gamma = addFunction(new GammaFunction()); f_beta = addFunction(new BetaFunction()); f_total = addFunction(new TotalFunction()); f_percentile = addFunction(new PercentileFunction()); f_min = addFunction(new MinFunction()); f_max = addFunction(new MaxFunction()); f_mode = addFunction(new ModeFunction()); f_rand = addFunction(new RandFunction()); f_isodate = addFunction(new ISODateFunction()); f_localdate = addFunction(new LocalDateFunction()); f_timestamp = addFunction(new TimestampFunction()); f_stamptodate = addFunction(new TimestampToDateFunction()); f_days = addFunction(new DaysFunction()); f_yearfrac = addFunction(new YearFracFunction()); f_week = addFunction(new WeekFunction()); f_weekday = addFunction(new WeekdayFunction()); f_month = addFunction(new MonthFunction()); f_day = addFunction(new DayFunction()); f_year = addFunction(new YearFunction()); f_yearday = addFunction(new YeardayFunction()); f_time = addFunction(new TimeFunction()); f_add_days = addFunction(new AddDaysFunction()); f_add_months = addFunction(new AddMonthsFunction()); f_add_years = addFunction(new AddYearsFunction()); f_base = addFunction(new BaseFunction()); f_bin = addFunction(new BinFunction()); f_oct = addFunction(new OctFunction()); f_hex = addFunction(new HexFunction()); f_roman = addFunction(new RomanFunction()); f_ascii = addFunction(new AsciiFunction()); f_char = addFunction(new CharFunction()); f_length = addFunction(new LengthFunction()); f_concatenate = addFunction(new ConcatenateFunction()); f_replace = addFunction(new ReplaceFunction()); f_stripunits = addFunction(new StripUnitsFunction()); f_genvector = addFunction(new GenerateVectorFunction()); f_for = addFunction(new ForFunction()); f_sum = addFunction(new SumFunction()); f_product = addFunction(new ProductFunction()); f_process = addFunction(new ProcessFunction()); f_process_matrix = addFunction(new ProcessMatrixFunction()); f_csum = addFunction(new CustomSumFunction()); f_function = addFunction(new FunctionFunction()); f_select = addFunction(new SelectFunction()); f_title = addFunction(new TitleFunction()); f_if = addFunction(new IFFunction()); f_is_number = addFunction(new IsNumberFunction()); f_is_real = addFunction(new IsRealFunction()); f_is_rational = addFunction(new IsRationalFunction()); f_is_integer = addFunction(new IsIntegerFunction()); f_represents_number = addFunction(new RepresentsNumberFunction()); f_represents_real = addFunction(new RepresentsRealFunction()); f_represents_rational = addFunction(new RepresentsRationalFunction()); f_represents_integer = addFunction(new RepresentsIntegerFunction()); f_error = addFunction(new ErrorFunction()); f_warning = addFunction(new WarningFunction()); f_message = addFunction(new MessageFunction()); f_save = addFunction(new SaveFunction()); f_load = addFunction(new LoadFunction()); f_export = addFunction(new ExportFunction()); f_register = addFunction(new RegisterFunction()); f_stack = addFunction(new StackFunction()); f_diff = addFunction(new DeriveFunction()); f_integrate = addFunction(new IntegrateFunction()); f_solve = addFunction(new SolveFunction()); f_multisolve = addFunction(new SolveMultipleFunction()); f_uncertainty = addFunction(new UncertaintyFunction()); /*void *plugin = dlopen("/home/nq/Source/qalculate/plugins/pluginfunction.so", RTLD_NOW); if(plugin) { CREATEPLUG_PROC createproc = (CREATEPLUG_PROC) dlsym(plugin, "createPlugin"); if (dlerror() != NULL) { dlclose(plugin); printf( "dlsym error\n"); } else { createproc(); } } else { printf( "dlopen error\n"); }*/ } void Calculator::addBuiltinUnits() { u_euro = addUnit(new Unit(_("Currency"), "EUR", "euros", "euro", "European Euros", false, true, true)); } void Calculator::error(bool critical, const char *TEMPLATE, ...) { if(disable_errors_ref > 0) { stopped_messages_count[disable_errors_ref - 1]++; if(critical) { stopped_errors_count[disable_errors_ref - 1]++; } else { stopped_warnings_count[disable_errors_ref - 1]++; } return; } string error_str = TEMPLATE; va_list ap; va_start(ap, TEMPLATE); size_t i = 0; while(true) { i = error_str.find("%", i); if(i == string::npos || i + 1 == error_str.length()) break; switch(error_str[i + 1]) { case 's': { const char *str = va_arg(ap, const char*); if(!str) { i++; } else { error_str.replace(i, 2, str); i += strlen(str); } break; } case 'c': { char c = (char) va_arg(ap, int); if(c > 0) { error_str.replace(i, 2, 1, c); } i++; break; } default: { i++; break; } } } va_end(ap); bool dup_error = false; for(i = 0; i < messages.size(); i++) { if(error_str == messages[i].message()) { dup_error = true; break; } } if(!dup_error) { if(critical) messages.push_back(CalculatorMessage(error_str, MESSAGE_ERROR)); else messages.push_back(CalculatorMessage(error_str, MESSAGE_WARNING)); } } void Calculator::message(MessageType mtype, const char *TEMPLATE, ...) { if(disable_errors_ref > 0) { stopped_messages_count[disable_errors_ref - 1]++; if(mtype == MESSAGE_ERROR) { stopped_errors_count[disable_errors_ref - 1]++; } else if(mtype == MESSAGE_WARNING) { stopped_warnings_count[disable_errors_ref - 1]++; } return; } string error_str = TEMPLATE; va_list ap; va_start(ap, TEMPLATE); size_t i = 0; while(true) { i = error_str.find("%", i); if(i == string::npos || i + 1 == error_str.length()) break; switch(error_str[i + 1]) { case 's': { const char *str = va_arg(ap, const char*); if(!str) { i++; } else { error_str.replace(i, 2, str); i += strlen(str); } break; } case 'c': { char c = (char) va_arg(ap, int); if(c > 0) { error_str.replace(i, 2, 1, c); } i++; break; } default: { i++; break; } } } va_end(ap); bool dup_error = false; for(i = 0; i < messages.size(); i++) { if(error_str == messages[i].message()) { dup_error = true; break; } } if(!dup_error) { messages.push_back(CalculatorMessage(error_str, mtype)); } } CalculatorMessage* Calculator::message() { if(!messages.empty()) { return &messages[0]; } return NULL; } CalculatorMessage* Calculator::nextMessage() { if(!messages.empty()) { messages.erase(messages.begin()); if(!messages.empty()) { return &messages[0]; } } return NULL; } void Calculator::deleteName(string name_, ExpressionItem *object) { Variable *v2 = getVariable(name_); if(v2 == object) { return; } if(v2 != NULL) { v2->destroy(); } else { MathFunction *f2 = getFunction(name_); if(f2 == object) return; if(f2 != NULL) { f2->destroy(); } } deleteName(name_, object); } void Calculator::deleteUnitName(string name_, Unit *object) { Unit *u2 = getUnit(name_); if(u2) { if(u2 != object) { u2->destroy(); } return; } u2 = getCompositeUnit(name_); if(u2) { if(u2 != object) { u2->destroy(); } } deleteUnitName(name_, object); } void Calculator::saveState() { } void Calculator::restoreState() { } void Calculator::clearBuffers() { for(Sgi::hash_map::iterator it = ids_p.begin(); it != ids_p.end(); ++it) { if(!it->second) { freed_ids.push_back(it->first); id_structs.erase(it->first); ids_p.erase(it); } } } void Calculator::abort() { if(calculate_thread_stopped) { b_busy = false; } else { pthread_cancel(calculate_thread); restoreState(); stopped_messages_count.clear(); stopped_warnings_count.clear(); stopped_errors_count.clear(); disable_errors_ref = 0; clearBuffers(); if(tmp_rpn_mstruct) tmp_rpn_mstruct->unref(); tmp_rpn_mstruct = NULL; b_busy = false; pthread_create(&calculate_thread, &calculate_thread_attr, calculate_proc, calculate_pipe_r); } } void Calculator::abort_this() { restoreState(); stopped_messages_count.clear(); stopped_warnings_count.clear(); stopped_errors_count.clear(); disable_errors_ref = 0; clearBuffers(); if(tmp_rpn_mstruct) tmp_rpn_mstruct->unref(); tmp_rpn_mstruct = NULL; b_busy = false; calculate_thread_stopped = true; pthread_exit(PTHREAD_CANCELED); } bool Calculator::busy() { return b_busy; } void Calculator::terminateThreads() { if(!calculate_thread_stopped) { pthread_cancel(calculate_thread); } if(!print_thread_stopped) { pthread_cancel(print_thread); } } string Calculator::localizeExpression(string str) const { if(DOT_STR == DOT && COMMA_STR == COMMA) return str; vector q_begin; vector q_end; size_t i3 = 0; while(true) { i3 = str.find_first_of("\"\'", i3); if(i3 == string::npos) { break; } q_begin.push_back(i3); i3 = str.find(str[i3], i3 + 1); if(i3 == string::npos) { q_end.push_back(str.length() - 1); break; } q_end.push_back(i3); i3++; } if(COMMA_STR != COMMA) { size_t ui = str.find(COMMA); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] && ui >= q_begin[ui2]) { ui = str.find(COMMA, q_end[ui2] + 1); b = true; break; } } if(!b) { str.replace(ui, strlen(COMMA), COMMA_STR); ui = str.find(COMMA, ui + COMMA_STR.length()); } } } if(DOT_STR != DOT) { size_t ui = str.find(DOT); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] && ui >= q_begin[ui2]) { ui = str.find(DOT, q_end[ui2] + 1); b = true; break; } } if(!b) { str.replace(ui, strlen(DOT), DOT_STR); ui = str.find(DOT, ui + DOT_STR.length()); } } } return str; } string Calculator::unlocalizeExpression(string str, const ParseOptions &po) const { if(DOT_STR == DOT && COMMA_STR == COMMA) return str; vector q_begin; vector q_end; size_t i3 = 0; while(true) { i3 = str.find_first_of("\"\'", i3); if(i3 == string::npos) { break; } q_begin.push_back(i3); i3 = str.find(str[i3], i3 + 1); if(i3 == string::npos) { q_end.push_back(str.length() - 1); break; } q_end.push_back(i3); i3++; } if(DOT_STR != DOT) { if(po.dot_as_separator) { size_t ui = str.find(DOT); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] && ui >= q_begin[ui2]) { ui = str.find(DOT, q_end[ui2] + 1); b = true; break; } } if(!b) { str.replace(ui, strlen(DOT), SPACE); ui = str.find(DOT, ui + strlen(SPACE)); } } } size_t ui = str.find(DOT_STR); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] && ui >= q_begin[ui2]) { ui = str.find(DOT_STR, q_end[ui2] + 1); b = true; break; } } if(!b) { str.replace(ui, DOT_STR.length(), DOT); ui = str.find(DOT_STR, ui + strlen(DOT)); } } } if(COMMA_STR != COMMA) { size_t ui = str.find(COMMA_STR); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] && ui >= q_begin[ui2]) { ui = str.find(COMMA_STR, q_end[ui2] + 1); b = true; break; } } if(!b) { str.replace(ui, COMMA_STR.length(), COMMA); ui = str.find(COMMA_STR, ui + strlen(COMMA)); } } } return str; } bool Calculator::calculateRPNRegister(size_t index, int msecs, const EvaluationOptions &eo) { if(index <= 0 || index > rpn_stack.size()) return false; return calculateRPN(new MathStructure(*rpn_stack[rpn_stack.size() - index]), PROC_RPN_SET, index, msecs, eo); } bool Calculator::calculateRPN(MathStructure *mstruct, int command, size_t index, int msecs, const EvaluationOptions &eo) { saveState(); b_busy = true; if(calculate_thread_stopped) { pthread_create(&calculate_thread, &calculate_thread_attr, calculate_proc, calculate_pipe_r); calculate_thread_stopped = false; } bool had_msecs = msecs > 0; tmp_evaluationoptions = eo; tmp_proc_command = command; tmp_rpnindex = index; tmp_rpn_mstruct = mstruct; bool b_parse = false; fwrite(&b_parse, sizeof(bool), 1, calculate_pipe_w); void *x = (void*) mstruct; fwrite(&x, sizeof(void*), 1, calculate_pipe_w); fflush(calculate_pipe_w); struct timespec rtime; rtime.tv_sec = 0; rtime.tv_nsec = 1000000; while(msecs > 0 && b_busy) { nanosleep(&rtime, NULL); msecs -= 1; } if(had_msecs && b_busy) { abort(); return false; } return true; } bool Calculator::calculateRPN(string str, int command, size_t index, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) { MathStructure *mstruct = new MathStructure(); saveState(); b_busy = true; if(calculate_thread_stopped) { pthread_create(&calculate_thread, &calculate_thread_attr, calculate_proc, calculate_pipe_r); calculate_thread_stopped = false; } bool had_msecs = msecs > 0; expression_to_calculate = str; tmp_evaluationoptions = eo; tmp_proc_command = command; tmp_rpnindex = index; tmp_rpn_mstruct = mstruct; tmp_parsedstruct = parsed_struct; tmp_tostruct = to_struct; tmp_maketodivision = make_to_division; bool b_parse = true; fwrite(&b_parse, sizeof(bool), 1, calculate_pipe_w); void *x = (void*) mstruct; fwrite(&x, sizeof(void*), 1, calculate_pipe_w); fflush(calculate_pipe_w); struct timespec rtime; rtime.tv_sec = 0; rtime.tv_nsec = 1000000; while(msecs > 0 && b_busy) { nanosleep(&rtime, NULL); msecs -= 1; } if(had_msecs && b_busy) { abort(); return false; } return true; } bool Calculator::calculateRPN(MathOperation op, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct) { MathStructure *mstruct; if(rpn_stack.size() == 0) { mstruct = new MathStructure(); mstruct->add(m_zero, op); if(parsed_struct) parsed_struct->clear(); } else if(rpn_stack.size() == 1) { if(parsed_struct) { parsed_struct->clear(); if(op == OPERATION_SUBTRACT) { parsed_struct->transform(STRUCT_ADDITION, *rpn_stack.back()); (*parsed_struct)[1].transform(STRUCT_NEGATE); } else if(op == OPERATION_DIVIDE) { parsed_struct->transform(STRUCT_DIVISION, *rpn_stack.back()); } else { parsed_struct->add(*rpn_stack.back(), op); } } mstruct = new MathStructure(); mstruct->add(*rpn_stack.back(), op); } else { if(parsed_struct) { parsed_struct->set(*rpn_stack[rpn_stack.size() - 2]); if(op == OPERATION_SUBTRACT) { parsed_struct->transform(STRUCT_ADDITION, *rpn_stack.back()); (*parsed_struct)[1].transform(STRUCT_NEGATE); } else if(op == OPERATION_DIVIDE) { parsed_struct->transform(STRUCT_DIVISION, *rpn_stack.back()); } else { parsed_struct->add(*rpn_stack.back(), op); } } mstruct = new MathStructure(*rpn_stack[rpn_stack.size() - 2]); mstruct->add(*rpn_stack.back(), op); } return calculateRPN(mstruct, PROC_RPN_OPERATION_2, 0, msecs, eo); } bool Calculator::calculateRPN(MathFunction *f, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct) { MathStructure *mstruct = new MathStructure(f, NULL); if(f->args() != 0) { if(rpn_stack.size() == 0) mstruct->addChild(m_zero); else mstruct->addChild(*rpn_stack.back()); f->appendDefaultValues(*mstruct); if(f->getArgumentDefinition(1) && f->getArgumentDefinition(1)->type() == ARGUMENT_TYPE_ANGLE) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { (*mstruct)[0].multiply(getDegUnit()); break; } case ANGLE_UNIT_GRADIANS: { (*mstruct)[0].multiply(getGraUnit()); break; } case ANGLE_UNIT_RADIANS: { (*mstruct)[0].multiply(getRadUnit()); break; } default: {} } } } if(parsed_struct) parsed_struct->set(*mstruct); return calculateRPN(mstruct, PROC_RPN_OPERATION_1, 0, msecs, eo); } bool Calculator::calculateRPNBitwiseNot(int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct) { MathStructure *mstruct; if(rpn_stack.size() == 0) { mstruct = new MathStructure(); mstruct->setBitwiseNot(); } else { mstruct = new MathStructure(*rpn_stack.back()); mstruct->setBitwiseNot(); } if(parsed_struct) parsed_struct->set(*mstruct); return calculateRPN(mstruct, PROC_RPN_OPERATION_1, 0, msecs, eo); } bool Calculator::calculateRPNLogicalNot(int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct) { MathStructure *mstruct; if(rpn_stack.size() == 0) { mstruct = new MathStructure(); mstruct->setLogicalNot(); } else { mstruct = new MathStructure(*rpn_stack.back()); mstruct->setLogicalNot(); } if(parsed_struct) parsed_struct->set(*rpn_stack.back()); return calculateRPN(mstruct, PROC_RPN_OPERATION_1, 0, msecs, eo); } MathStructure *Calculator::calculateRPN(MathOperation op, const EvaluationOptions &eo, MathStructure *parsed_struct) { MathStructure *mstruct; if(rpn_stack.size() == 0) { mstruct = new MathStructure(); mstruct->add(m_zero, op); if(parsed_struct) parsed_struct->clear(); } else if(rpn_stack.size() == 1) { if(parsed_struct) { parsed_struct->clear(); if(op == OPERATION_SUBTRACT) { parsed_struct->transform(STRUCT_ADDITION, *rpn_stack.back()); (*parsed_struct)[1].transform(STRUCT_NEGATE); } else if(op == OPERATION_DIVIDE) { parsed_struct->transform(STRUCT_DIVISION, *rpn_stack.back()); } else { parsed_struct->add(*rpn_stack.back(), op); } } mstruct = new MathStructure(); mstruct->add(*rpn_stack.back(), op); } else { if(parsed_struct) { parsed_struct->set(*rpn_stack[rpn_stack.size() - 2]); if(op == OPERATION_SUBTRACT) { parsed_struct->transform(STRUCT_ADDITION, *rpn_stack.back()); (*parsed_struct)[1].transform(STRUCT_NEGATE); } else if(op == OPERATION_DIVIDE) { parsed_struct->transform(STRUCT_DIVISION, *rpn_stack.back()); } else { parsed_struct->add(*rpn_stack.back(), op); } } mstruct = new MathStructure(*rpn_stack[rpn_stack.size() - 2]); mstruct->add(*rpn_stack.back(), op); } mstruct->eval(eo); autoConvert(*mstruct, *mstruct, eo); if(rpn_stack.size() > 1) { rpn_stack.back()->unref(); rpn_stack.erase(rpn_stack.begin() + (rpn_stack.size() - 1)); } if(rpn_stack.size() > 0) { rpn_stack.back()->unref(); rpn_stack.back() = mstruct; } else { rpn_stack.push_back(mstruct); } return rpn_stack.back(); } MathStructure *Calculator::calculateRPN(MathFunction *f, const EvaluationOptions &eo, MathStructure *parsed_struct) { MathStructure *mstruct = new MathStructure(f, NULL); if(f->args() != 0) { if(rpn_stack.size() == 0) mstruct->addChild(m_zero); else mstruct->addChild(*rpn_stack.back()); f->appendDefaultValues(*mstruct); if(f->getArgumentDefinition(1) && f->getArgumentDefinition(1)->type() == ARGUMENT_TYPE_ANGLE) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { (*mstruct)[0].multiply(getDegUnit()); break; } case ANGLE_UNIT_GRADIANS: { (*mstruct)[0].multiply(getGraUnit()); break; } case ANGLE_UNIT_RADIANS: { (*mstruct)[0].multiply(getRadUnit()); break; } default: {} } } } if(parsed_struct) parsed_struct->set(*mstruct); mstruct->eval(eo); autoConvert(*mstruct, *mstruct, eo); if(rpn_stack.size() == 0) { rpn_stack.push_back(mstruct); } else { rpn_stack.back()->unref(); rpn_stack.back() = mstruct; } return rpn_stack.back(); } MathStructure *Calculator::calculateRPNBitwiseNot(const EvaluationOptions &eo, MathStructure *parsed_struct) { MathStructure *mstruct; if(rpn_stack.size() == 0) { mstruct = new MathStructure(); mstruct->setBitwiseNot(); } else { mstruct = new MathStructure(*rpn_stack.back()); mstruct->setBitwiseNot(); } if(parsed_struct) parsed_struct->set(*mstruct); mstruct->eval(eo); autoConvert(*mstruct, *mstruct, eo); if(rpn_stack.size() == 0) { rpn_stack.push_back(mstruct); } else { rpn_stack.back()->unref(); rpn_stack.back() = mstruct; } return rpn_stack.back(); } MathStructure *Calculator::calculateRPNLogicalNot(const EvaluationOptions &eo, MathStructure *parsed_struct) { MathStructure *mstruct; if(rpn_stack.size() == 0) { mstruct = new MathStructure(); mstruct->setLogicalNot(); } else { mstruct = new MathStructure(*rpn_stack.back()); mstruct->setLogicalNot(); } if(parsed_struct) parsed_struct->set(*mstruct); mstruct->eval(eo); autoConvert(*mstruct, *mstruct, eo); if(rpn_stack.size() == 0) { rpn_stack.push_back(mstruct); } else { rpn_stack.back()->unref(); rpn_stack.back() = mstruct; } return rpn_stack.back(); } bool Calculator::RPNStackEnter(MathStructure *mstruct, int msecs, const EvaluationOptions &eo) { return calculateRPN(mstruct, PROC_RPN_ADD, 0, msecs, eo); } bool Calculator::RPNStackEnter(string str, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) { return calculateRPN(str, PROC_RPN_ADD, 0, msecs, eo, parsed_struct, to_struct, make_to_division); } void Calculator::RPNStackEnter(MathStructure *mstruct, bool eval, const EvaluationOptions &eo) { if(eval) { mstruct->eval(); autoConvert(*mstruct, *mstruct, eo); } rpn_stack.push_back(mstruct); } void Calculator::RPNStackEnter(string str, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) { rpn_stack.push_back(new MathStructure(calculate(str, eo, parsed_struct, to_struct, make_to_division))); } bool Calculator::setRPNRegister(size_t index, MathStructure *mstruct, int msecs, const EvaluationOptions &eo) { if(mstruct == NULL) { deleteRPNRegister(index); return true; } if(index <= 0 || index > rpn_stack.size()) return false; return calculateRPN(mstruct, PROC_RPN_SET, index, msecs, eo); } bool Calculator::setRPNRegister(size_t index, string str, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) { if(index <= 0 || index > rpn_stack.size()) return false; return calculateRPN(str, PROC_RPN_OPERATION_2, index, msecs, eo, parsed_struct, to_struct, make_to_division); } void Calculator::setRPNRegister(size_t index, MathStructure *mstruct, bool eval, const EvaluationOptions &eo) { if(mstruct == NULL) { deleteRPNRegister(index); return; } if(eval) { mstruct->eval(); autoConvert(*mstruct, *mstruct, eo); } if(index <= 0 || index > rpn_stack.size()) return; index = rpn_stack.size() - index; rpn_stack[index]->unref(); rpn_stack[index] = mstruct; } void Calculator::setRPNRegister(size_t index, string str, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) { if(index <= 0 || index > rpn_stack.size()) return; index = rpn_stack.size() - index; MathStructure *mstruct = new MathStructure(calculate(str, eo, parsed_struct, to_struct, make_to_division)); rpn_stack[index]->unref(); rpn_stack[index] = mstruct; } void Calculator::deleteRPNRegister(size_t index) { if(index <= 0 || index > rpn_stack.size()) return; index = rpn_stack.size() - index; rpn_stack[index]->unref(); rpn_stack.erase(rpn_stack.begin() + index); } MathStructure *Calculator::getRPNRegister(size_t index) const { if(index > 0 && index <= rpn_stack.size()) { index = rpn_stack.size() - index; return rpn_stack[index]; } return NULL; } size_t Calculator::RPNStackSize() const { return rpn_stack.size(); } void Calculator::clearRPNStack() { for(size_t i = 0; i < rpn_stack.size(); i++) { rpn_stack[i]->unref(); } rpn_stack.clear(); } void Calculator::moveRPNRegister(size_t old_index, size_t new_index) { if(old_index == new_index) return; if(old_index > 0 && old_index <= rpn_stack.size()) { old_index = rpn_stack.size() - old_index; MathStructure *mstruct = rpn_stack[old_index]; if(new_index > rpn_stack.size()) { new_index = 0; } else if(new_index <= 1) { rpn_stack.push_back(mstruct); rpn_stack.erase(rpn_stack.begin() + old_index); return; } else { new_index = rpn_stack.size() - new_index; } if(new_index > old_index) { rpn_stack.erase(rpn_stack.begin() + old_index); rpn_stack.insert(rpn_stack.begin() + new_index, mstruct); } else if(new_index < old_index) { rpn_stack.insert(rpn_stack.begin() + new_index, mstruct); rpn_stack.erase(rpn_stack.begin() + (old_index + 1)); } } } void Calculator::moveRPNRegisterUp(size_t index) { if(index > 1 && index <= rpn_stack.size()) { index = rpn_stack.size() - index; MathStructure *mstruct = rpn_stack[index]; rpn_stack.erase(rpn_stack.begin() + index); index++; if(index == rpn_stack.size()) rpn_stack.push_back(mstruct); else rpn_stack.insert(rpn_stack.begin() + index, mstruct); } } void Calculator::moveRPNRegisterDown(size_t index) { if(index > 0 && index < rpn_stack.size()) { index = rpn_stack.size() - index; MathStructure *mstruct = rpn_stack[index]; rpn_stack.erase(rpn_stack.begin() + index); index--; rpn_stack.insert(rpn_stack.begin() + index, mstruct); } } bool Calculator::calculate(MathStructure *mstruct, string str, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) { mstruct->set(string(_("calculating..."))); saveState(); b_busy = true; if(calculate_thread_stopped) { pthread_create(&calculate_thread, &calculate_thread_attr, calculate_proc, calculate_pipe_r); calculate_thread_stopped = false; } bool had_msecs = msecs > 0; expression_to_calculate = str; tmp_evaluationoptions = eo; tmp_proc_command = PROC_NO_COMMAND; tmp_rpn_mstruct = NULL; tmp_parsedstruct = parsed_struct; tmp_tostruct = to_struct; tmp_maketodivision = make_to_division; bool b_parse = true; fwrite(&b_parse, sizeof(bool), 1, calculate_pipe_w); void *x = (void*) mstruct; fwrite(&x, sizeof(void*), 1, calculate_pipe_w); fflush(calculate_pipe_w); struct timespec rtime; rtime.tv_sec = 0; rtime.tv_nsec = 1000000; while(msecs > 0 && b_busy) { nanosleep(&rtime, NULL); msecs -= 1; } if(had_msecs && b_busy) { abort(); mstruct->set(string(_("aborted"))); return false; } return true; } bool Calculator::separateToExpression(string &str, string &to_str, const EvaluationOptions &eo) const { to_str = ""; size_t i = 0; if(eo.parse_options.units_enabled && (i = str.find(_(" to "))) != string::npos) { size_t l = strlen(_(" to ")); to_str = str.substr(i + l, str.length() - i - l); remove_blank_ends(to_str); if(!to_str.empty()) { str = str.substr(0, i); return true; } } else if(local_to && eo.parse_options.units_enabled && (i = str.find(" to ")) != string::npos) { size_t l = strlen(" to "); to_str = str.substr(i + l, str.length() - i - l); remove_blank_ends(to_str); if(!to_str.empty()) { str = str.substr(0, i); return true; } } return false; } MathStructure Calculator::calculate(string str, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) { string str2; separateToExpression(str, str2, eo); MathStructure mstruct; parse(&mstruct, str, eo.parse_options); if(parsed_struct) { beginTemporaryStopMessages(); ParseOptions po = eo.parse_options; po.preserve_format = true; parse(parsed_struct, str, po); endTemporaryStopMessages(); } mstruct.eval(eo); if(!str2.empty()) { Unit *u = getUnit(str2); if(u) { if(to_struct) to_struct->set(u); return convert(mstruct, u, eo); } for(size_t i = 0; i < signs.size(); i++) { if(str2 == signs[i]) { u = getUnit(real_signs[i]); break; } } if(u) { if(to_struct) to_struct->set(u); return convert(mstruct, u, eo); } CompositeUnit cu("", "temporary_composite_convert", "", str2); if(to_struct) to_struct->set(cu.generateMathStructure(make_to_division)); if(cu.countUnits() > 0) return convertToCompositeUnit(mstruct, &cu, eo); } else { if(to_struct) to_struct->setUndefined(); switch(eo.auto_post_conversion) { case POST_CONVERSION_BEST: { return convertToBestUnit(mstruct, eo); } case POST_CONVERSION_BASE: { return convertToBaseUnits(mstruct, eo); } default: {} } } return mstruct; } string Calculator::printMathStructureTimeOut(const MathStructure &mstruct, int msecs, const PrintOptions &po) { tmp_printoptions = po; saveState(); b_busy = true; if(print_thread_stopped) { pthread_create(&print_thread, &print_thread_attr, print_proc, print_pipe_r); print_thread_stopped = false; } void *x = (void*) &mstruct; fwrite(&x, sizeof(void*), 1, print_pipe_w); fflush(print_pipe_w); struct timespec rtime; rtime.tv_sec = 0; rtime.tv_nsec = 1000000; while(msecs > 0 && b_busy) { nanosleep(&rtime, NULL); msecs -= 1; } if(b_busy) { pthread_cancel(print_thread); restoreState(); clearBuffers(); b_busy = false; pthread_create(&print_thread, &print_thread_attr, print_proc, print_pipe_r); tmp_print_result = _("timed out"); } return tmp_print_result; } MathStructure Calculator::convert(double value, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo) { return convert(value, from_unit, to_unit, eo); } MathStructure Calculator::convert(string str, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo) { MathStructure mstruct; parse(&mstruct, str, eo.parse_options); mstruct *= from_unit; mstruct.eval(eo); mstruct.convert(to_unit, true); mstruct.divide(to_unit, true); mstruct.eval(eo); return mstruct; } MathStructure Calculator::convert(const MathStructure &mstruct, Unit *to_unit, const EvaluationOptions &eo, bool always_convert) { if(to_unit->subtype() == SUBTYPE_COMPOSITE_UNIT) return convertToCompositeUnit(mstruct, (CompositeUnit*) to_unit, eo, always_convert); if(to_unit->subtype() != SUBTYPE_ALIAS_UNIT || (((AliasUnit*) to_unit)->baseUnit()->subtype() != SUBTYPE_COMPOSITE_UNIT && ((AliasUnit*) to_unit)->baseExponent() == 1)) { MathStructure mstruct_new(mstruct); if(!mstruct_new.convert(to_unit, true)) { mstruct_new = mstruct; } else { mstruct_new.eval(eo); return mstruct_new; } } MathStructure mstruct_new(mstruct); if(mstruct_new.isAddition()) { for(size_t i = 0; i < mstruct_new.size(); i++) { mstruct_new[i] = convert(mstruct_new[i], to_unit, eo, false); } mstruct_new.childrenUpdated(); EvaluationOptions eo2 = eo; //eo2.calculate_functions = false; eo2.sync_units = false; eo2.keep_prefixes = true; mstruct_new.eval(eo2); } else { bool b = false; if(mstruct_new.convert(to_unit) || always_convert) { b = true; } else if(to_unit->subtype() == SUBTYPE_ALIAS_UNIT && ((AliasUnit*) to_unit)->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { CompositeUnit *cu = (CompositeUnit*) ((AliasUnit*) to_unit)->baseUnit(); switch(mstruct.type()) { case STRUCT_UNIT: { if(cu->containsRelativeTo(mstruct_new.unit())) { b = true; } break; } case STRUCT_MULTIPLICATION: { for(size_t i = 1; i <= mstruct_new.countChildren(); i++) { if(mstruct_new.getChild(i)->isUnit() && cu->containsRelativeTo(mstruct_new.getChild(i)->unit())) { b = true; break; } if(mstruct_new.getChild(i)->isPower() && mstruct_new.getChild(i)->base()->isUnit() && cu->containsRelativeTo(mstruct_new.getChild(i)->base()->unit())) { b = true; break; } } break; } case STRUCT_POWER: { if(mstruct_new.base()->isUnit() && cu->containsRelativeTo(mstruct_new.base()->unit())) { b = true; } break; } default: {} } } if(b) { mstruct_new.divide(to_unit); EvaluationOptions eo2 = eo; //eo2.calculate_functions = false; eo2.sync_units = true; eo2.keep_prefixes = false; mstruct_new.eval(eo2); if(mstruct_new.isOne()) mstruct_new.set(to_unit); else mstruct_new.multiply(to_unit, true); eo2.sync_units = false; eo2.keep_prefixes = true; mstruct_new.eval(eo2); } } return mstruct_new; } MathStructure Calculator::convertToBaseUnits(const MathStructure &mstruct, const EvaluationOptions &eo) { MathStructure mstruct_new(mstruct); for(size_t i = 0; i < units.size(); i++) { if(units[i]->subtype() == SUBTYPE_BASE_UNIT) { mstruct_new.convert(units[i], true); } } EvaluationOptions eo2 = eo; //eo2.calculate_functions = false; mstruct_new.eval(eo2); return mstruct_new; } Unit *Calculator::getBestUnit(Unit *u, bool allow_only_div) { switch(u->subtype()) { case SUBTYPE_BASE_UNIT: { return u; } case SUBTYPE_ALIAS_UNIT: { AliasUnit *au = (AliasUnit*) u; if(au->baseExponent() == 1 && au->baseUnit()->subtype() == SUBTYPE_BASE_UNIT) { return (Unit*) au->baseUnit(); } else if(au->firstBaseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT || au->firstBaseExponent() != 1) { return u; } else { return getBestUnit((Unit*) au->firstBaseUnit()); } } case SUBTYPE_COMPOSITE_UNIT: { CompositeUnit *cu = (CompositeUnit*) u; int exp, b_exp; int points = 0; bool minus = false; int new_points; int new_points_m; int max_points = 0; for(size_t i = 1; i <= cu->countUnits(); i++) { cu->get(i, &exp); if(exp < 0) { max_points -= exp; } else { max_points += exp; } } Unit *best_u = NULL; Unit *bu; AliasUnit *au; for(size_t i = 0; i < units.size(); i++) { if(units[i]->subtype() == SUBTYPE_BASE_UNIT && (points == 0 || (points == 1 && minus))) { new_points = 0; for(size_t i2 = 1; i2 <= cu->countUnits(); i2++) { if(cu->get(i2)->baseUnit() == units[i]) { points = 1; best_u = units[i]; minus = false; break; } } } else if(!units[i]->isSIUnit()) { } else if(units[i]->subtype() == SUBTYPE_ALIAS_UNIT) { au = (AliasUnit*) units[i]; bu = (Unit*) au->baseUnit(); b_exp = au->baseExponent(); new_points = 0; new_points_m = 0; if(b_exp != 1 || bu->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(bu->subtype() == SUBTYPE_BASE_UNIT) { for(size_t i2 = 1; i2 <= cu->countUnits(); i2++) { if(cu->get(i2, &exp) == bu) { bool m = false; if(b_exp < 0 && exp < 0) { b_exp = -b_exp; exp = -exp; } else if(b_exp < 0) { b_exp = -b_exp; m = true; } else if(exp < 0) { exp = -exp; m = true; } new_points = exp - b_exp; if(new_points < 0) { new_points = -new_points; } new_points = exp - new_points; if(!allow_only_div && m && new_points >= max_points) { new_points = -1; } if(new_points > points || (!m && minus && new_points == points)) { points = new_points; minus = m; best_u = units[i]; } break; } } } else if(au->firstBaseExponent() != 1 || au->firstBaseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { MathStructure cu_mstruct = ((CompositeUnit*) bu)->generateMathStructure(); cu_mstruct.raise(b_exp); cu_mstruct = convertToBaseUnits(cu_mstruct); if(cu_mstruct.isMultiplication()) { for(size_t i2 = 1; i2 <= cu_mstruct.countChildren(); i2++) { bu = NULL; if(cu_mstruct.getChild(i2)->isUnit()) { bu = cu_mstruct.getChild(i2)->unit(); b_exp = 1; } else if(cu_mstruct.getChild(i2)->isPower() && cu_mstruct.getChild(i2)->base()->isUnit() && cu_mstruct.getChild(i2)->exponent()->isNumber() && cu_mstruct.getChild(i2)->exponent()->number().isInteger()) { bu = cu_mstruct.getChild(i2)->base()->unit(); b_exp = cu_mstruct.getChild(i2)->exponent()->number().intValue(); } if(bu) { bool b = false; for(size_t i3 = 1; i3 <= cu->countUnits(); i3++) { if(cu->get(i3, &exp) == bu) { b = true; bool m = false; if(exp < 0 && b_exp > 0) { new_points -= b_exp; exp = -exp; m = true; } else if(exp > 0 && b_exp < 0) { new_points += b_exp; b_exp = -b_exp; m = true; } else { if(b_exp < 0) new_points_m += b_exp; else new_points_m -= b_exp; } if(exp < 0) { exp = -exp; b_exp = -b_exp; } if(exp >= b_exp) { if(m) new_points_m += exp - (exp - b_exp); else new_points += exp - (exp - b_exp); } else { if(m) new_points_m += exp - (b_exp - exp); else new_points += exp - (b_exp - exp); } break; } } if(!b) { if(b_exp < 0) b_exp = -b_exp; new_points -= b_exp; new_points_m -= b_exp; } } } if(!allow_only_div && new_points_m >= max_points) { new_points_m = -1; } if(new_points > points && new_points >= new_points_m) { minus = false; points = new_points; best_u = au; } else if(new_points_m > points || (new_points_m == points && minus)) { minus = true; points = new_points_m; best_u = au; } } } } } if(points >= max_points && !minus) break; } best_u = getBestUnit(best_u); if(points > 1 && points < max_points - 1) { CompositeUnit *cu_new = new CompositeUnit("", "temporary_composite_convert"); bool return_cu = minus; if(minus) { cu_new->add(best_u, -1); } else { cu_new->add(best_u); } MathStructure cu_mstruct = ((CompositeUnit*) u)->generateMathStructure(); if(minus) cu_mstruct *= best_u; else cu_mstruct /= best_u; cu_mstruct = convertToBaseUnits(cu_mstruct); CompositeUnit *cu2 = new CompositeUnit("", "temporary_composite_convert_to_best_unit"); bool b = false; for(size_t i = 1; i <= cu_mstruct.countChildren(); i++) { if(cu_mstruct.getChild(i)->isUnit()) { b = true; cu2->add(cu_mstruct.getChild(i)->unit()); } else if(cu_mstruct.getChild(i)->isPower() && cu_mstruct.getChild(i)->base()->isUnit() && cu_mstruct.getChild(i)->exponent()->isNumber() && cu_mstruct.getChild(i)->exponent()->number().isInteger()) { b = true; cu2->add(cu_mstruct.getChild(i)->base()->unit(), cu_mstruct.getChild(i)->exponent()->number().intValue()); } } if(b) { Unit *u2 = getBestUnit(cu2, true); b = false; if(u2->subtype() == SUBTYPE_COMPOSITE_UNIT) { for(size_t i3 = 1; i3 <= ((CompositeUnit*) u2)->countUnits(); i3++) { Unit *cu_unit = ((CompositeUnit*) u2)->get(i3, &exp); for(size_t i4 = 1; i4 <= cu_new->countUnits(); i4++) { if(cu_new->get(i4, &b_exp) == cu_unit) { b = true; cu_new->setExponent(i4, b_exp + exp); break; } } if(!b) cu_new->add(cu_unit, exp); } return_cu = true; delete u2; } else if(u2->subtype() == SUBTYPE_ALIAS_UNIT) { return_cu = true; for(size_t i3 = 1; i3 <= cu_new->countUnits(); i3++) { if(cu_new->get(i3, &exp) == u2) { b = true; cu_new->setExponent(i3, exp + 1); break; } } if(!b) cu_new->add(u2); } } delete cu2; if(return_cu) { return cu_new; } else { delete cu_new; return best_u; } } if(minus) { CompositeUnit *cu_new = new CompositeUnit("", "temporary_composite_convert"); cu_new->add(best_u, -1); return cu_new; } else { return best_u; } } } return u; } MathStructure Calculator::convertToBestUnit(const MathStructure &mstruct, const EvaluationOptions &eo) { EvaluationOptions eo2 = eo; //eo2.calculate_functions = false; eo2.sync_units = false; switch(mstruct.type()) { case STRUCT_BITWISE_XOR: {} case STRUCT_BITWISE_OR: {} case STRUCT_BITWISE_AND: {} case STRUCT_BITWISE_NOT: {} case STRUCT_LOGICAL_XOR: {} case STRUCT_LOGICAL_OR: {} case STRUCT_LOGICAL_AND: {} case STRUCT_LOGICAL_NOT: {} case STRUCT_COMPARISON: {} case STRUCT_FUNCTION: {} case STRUCT_VECTOR: {} case STRUCT_ADDITION: { MathStructure mstruct_new(mstruct); for(size_t i = 0; i < mstruct_new.size(); i++) { mstruct_new[i] = convertToBestUnit(mstruct_new[i], eo); } mstruct_new.childrenUpdated(); mstruct_new.eval(eo2); return mstruct_new; } case STRUCT_POWER: { MathStructure mstruct_new(mstruct); if(mstruct_new.base()->isUnit() && mstruct_new.exponent()->isNumber() && mstruct_new.exponent()->number().isInteger()) { CompositeUnit *cu = new CompositeUnit("", "temporary_composite_convert_to_best_unit"); cu->add(mstruct_new.base()->unit(), mstruct_new.exponent()->number().intValue()); mstruct_new = convert(mstruct_new, getBestUnit(cu), eo, true); delete cu; } else { mstruct_new[0] = convertToBestUnit(mstruct_new[0], eo); mstruct_new[1] = convertToBestUnit(mstruct_new[1], eo); mstruct_new.childrenUpdated(); mstruct_new.eval(eo2); } return mstruct_new; } case STRUCT_UNIT: { return convert(mstruct, getBestUnit(mstruct.unit()), eo, true); } case STRUCT_MULTIPLICATION: { MathStructure mstruct_new(convertToBaseUnits(mstruct, eo)); CompositeUnit *cu = new CompositeUnit("", "temporary_composite_convert_to_best_unit"); bool b = false; for(size_t i = 1; i <= mstruct_new.countChildren(); i++) { if(mstruct_new.getChild(i)->isUnit()) { b = true; cu->add(mstruct_new.getChild(i)->unit()); } else if(mstruct_new.getChild(i)->isPower() && mstruct_new.getChild(i)->base()->isUnit() && mstruct_new.getChild(i)->exponent()->isNumber() && mstruct_new.getChild(i)->exponent()->number().isInteger()) { b = true; cu->add(mstruct_new.getChild(i)->base()->unit(), mstruct_new.getChild(i)->exponent()->number().intValue()); } else { mstruct_new[i - 1] = convertToBestUnit(mstruct_new[i - 1], eo); mstruct_new.childUpdated(i); } } if(b) mstruct_new = convert(mstruct_new, getBestUnit(cu), eo, true); delete cu; mstruct_new.eval(eo2); return mstruct_new; } default: {} } return mstruct; } MathStructure Calculator::convertToCompositeUnit(const MathStructure &mstruct, CompositeUnit *cu, const EvaluationOptions &eo, bool always_convert) { if(cu->countUnits() == 0) return mstruct; MathStructure mstruct_cu(cu->generateMathStructure()); MathStructure mstruct_new(mstruct); if(mstruct_new.isAddition()) { for(size_t i = 0; i < mstruct_new.size(); i++) { mstruct_new[i] = convertToCompositeUnit(mstruct_new[i], cu, eo, false); } mstruct_new.childrenUpdated(); EvaluationOptions eo2 = eo; //eo2.calculate_functions = false; eo2.sync_units = false; eo2.keep_prefixes = true; mstruct_new.eval(eo2); } else { bool b = false; if(mstruct_new.convert(cu, true) || always_convert) { b = true; } else { switch(mstruct_new.type()) { case STRUCT_UNIT: { if(cu->containsRelativeTo(mstruct_new.unit())) { b = true; } break; } case STRUCT_MULTIPLICATION: { for(size_t i = 1; i <= mstruct_new.countChildren(); i++) { if(mstruct_new.getChild(i)->isUnit() && cu->containsRelativeTo(mstruct_new.getChild(i)->unit())) { b = true; } if(mstruct_new.getChild(i)->isPower() && mstruct_new.getChild(i)->base()->isUnit() && cu->containsRelativeTo(mstruct_new.getChild(i)->base()->unit())) { b = true; } } break; } case STRUCT_POWER: { if(mstruct_new.base()->isUnit() && cu->containsRelativeTo(mstruct_new.base()->unit())) { b = true; } break; } default: {} } } if(b) { mstruct_new.divide(mstruct_cu); EvaluationOptions eo2 = eo; //eo2.calculate_functions = false; eo2.sync_units = true; eo2.keep_prefixes = false; mstruct_new.eval(eo2); if(mstruct_new.isOne()) mstruct_new = mstruct_cu; else mstruct_new.multiply(mstruct_cu, true); eo2.sync_units = false; eo2.keep_prefixes = true; mstruct_new.eval(eo2); } } return mstruct_new; } MathStructure Calculator::convert(const MathStructure &mstruct, string composite_, const EvaluationOptions &eo) { remove_blank_ends(composite_); if(composite_.empty()) return mstruct; Unit *u = getUnit(composite_); if(u) return convert(mstruct, u, eo); for(size_t i = 0; i < signs.size(); i++) { if(composite_ == signs[i]) { u = getUnit(real_signs[i]); break; } } if(u) return convert(mstruct, u, eo); CompositeUnit cu("", "temporary_composite_convert", "", composite_); return convertToCompositeUnit(mstruct, &cu, eo); } Unit* Calculator::addUnit(Unit *u, bool force, bool check_names) { if(check_names) { for(size_t i = 1; i <= u->countNames(); i++) { u->setName(getName(u->getName(i).name, u, force), i); } } if(!u->isLocal() && units.size() > 0 && units[units.size() - 1]->isLocal()) { units.insert(units.begin(), u); } else { units.push_back(u); } unitNameChanged(u, true); for(vector::iterator it = deleted_units.begin(); it != deleted_units.end(); ++it) { if(*it == u) { deleted_units.erase(it); break; } } u->setRegistered(true); u->setChanged(false); return u; } void Calculator::delPrefixUFV(Prefix *object) { int i = 0; for(vector::iterator it = ufvl.begin(); ; ++it) { del_ufvl: if(it == ufvl.end()) { break; } if(*it == object) { it = ufvl.erase(it); ufvl_t.erase(ufvl_t.begin() + i); ufvl_i.erase(ufvl_i.begin() + i); if(it == ufvl.end()) break; goto del_ufvl; } i++; } for(size_t i2 = 0; i2 < UFV_LENGTHS; i2++) { i = 0; for(vector::iterator it = ufv[0][i2].begin(); ; ++it) { del_ufv: if(it == ufv[0][i2].end()) { break; } if(*it == object) { it = ufv[0][i2].erase(it); ufv_i[0][i2].erase(ufv_i[0][i2].begin() + i); if(it == ufv[0][i2].end()) break; goto del_ufv; } i++; } } } void Calculator::delUFV(ExpressionItem *object) { int i = 0; for(vector::iterator it = ufvl.begin(); ; ++it) { del_ufvl: if(it == ufvl.end()) { break; } if(*it == object) { it = ufvl.erase(it); ufvl_t.erase(ufvl_t.begin() + i); ufvl_i.erase(ufvl_i.begin() + i); if(it == ufvl.end()) break; goto del_ufvl; } i++; } int i3 = 0; switch(object->type()) { case TYPE_FUNCTION: {i3 = 1; break;} case TYPE_UNIT: {i3 = 2; break;} case TYPE_VARIABLE: {i3 = 3; break;} } for(size_t i2 = 0; i2 < UFV_LENGTHS; i2++) { i = 0; for(vector::iterator it = ufv[i3][i2].begin(); ; ++it) { del_ufv: if(it == ufv[i3][i2].end()) { break; } if(*it == object) { it = ufv[i3][i2].erase(it); ufv_i[i3][i2].erase(ufv_i[i3][i2].begin() + i); if(it == ufv[i3][i2].end()) break; goto del_ufv; } i++; } } } Unit* Calculator::getUnit(string name_) { if(name_.empty()) return NULL; for(size_t i = 0; i < units.size(); i++) { if(units[i]->subtype() != SUBTYPE_COMPOSITE_UNIT && (units[i]->hasName(name_))) { return units[i]; } } return NULL; } Unit* Calculator::getActiveUnit(string name_) { if(name_.empty()) return NULL; for(size_t i = 0; i < units.size(); i++) { if(units[i]->isActive() && units[i]->subtype() != SUBTYPE_COMPOSITE_UNIT && units[i]->hasName(name_)) { return units[i]; } } return NULL; } Unit* Calculator::getCompositeUnit(string internal_name_) { if(internal_name_.empty()) return NULL; for(size_t i = 0; i < units.size(); i++) { if(units[i]->subtype() == SUBTYPE_COMPOSITE_UNIT && units[i]->hasName(internal_name_)) { return units[i]; } } return NULL; } Variable* Calculator::addVariable(Variable *v, bool force, bool check_names) { if(check_names) { for(size_t i = 1; i <= v->countNames(); i++) { v->setName(getName(v->getName(i).name, v, force), i); } } if(!v->isLocal() && variables.size() > 0 && variables[variables.size() - 1]->isLocal()) { variables.insert(variables.begin(), v); } else { variables.push_back(v); } variableNameChanged(v, true); for(vector::iterator it = deleted_variables.begin(); it != deleted_variables.end(); ++it) { if(*it == v) { deleted_variables.erase(it); break; } } v->setRegistered(true); v->setChanged(false); return v; } void Calculator::expressionItemDeactivated(ExpressionItem *item) { delUFV(item); } void Calculator::expressionItemActivated(ExpressionItem *item) { ExpressionItem *item2 = getActiveExpressionItem(item); if(item2) { item2->setActive(false); } nameChanged(item); } void Calculator::expressionItemDeleted(ExpressionItem *item) { switch(item->type()) { case TYPE_VARIABLE: { for(vector::iterator it = variables.begin(); it != variables.end(); ++it) { if(*it == item) { variables.erase(it); deleted_variables.push_back((Variable*) item); break; } } break; } case TYPE_FUNCTION: { for(vector::iterator it = functions.begin(); it != functions.end(); ++it) { if(*it == item) { functions.erase(it); deleted_functions.push_back((MathFunction*) item); break; } } if(item->subtype() == SUBTYPE_DATA_SET) { for(vector::iterator it = data_sets.begin(); it != data_sets.end(); ++it) { if(*it == item) { data_sets.erase(it); break; } } } break; } case TYPE_UNIT: { for(vector::iterator it = units.begin(); it != units.end(); ++it) { if(*it == item) { units.erase(it); deleted_units.push_back((Unit*) item); break; } } break; } } delUFV(item); } void Calculator::nameChanged(ExpressionItem *item, bool new_item) { if(!item->isActive() || item->countNames() == 0) return; if(item->type() == TYPE_UNIT && ((Unit*) item)->subtype() == SUBTYPE_COMPOSITE_UNIT) { return; } size_t l2; if(!new_item) delUFV(item); for(size_t i2 = 1; i2 <= item->countNames(); i2++) { l2 = item->getName(i2).name.length(); if(l2 > UFV_LENGTHS) { size_t i = 0, l = 0; for(vector::iterator it = ufvl.begin(); ; ++it) { if(it != ufvl.end()) { if(ufvl_t[i] == 'v') l = ((Variable*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'f') l = ((MathFunction*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'u') l = ((Unit*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'p') l = ((Prefix*) (*it))->shortName(false).length(); else if(ufvl_t[i] == 'P') l = ((Prefix*) (*it))->longName(false).length(); else if(ufvl_t[i] == 'q') l = ((Prefix*) (*it))->unicodeName(false).length(); } if(it == ufvl.end()) { ufvl.push_back((void*) item); switch(item->type()) { case TYPE_VARIABLE: {ufvl_t.push_back('v'); break;} case TYPE_FUNCTION: {ufvl_t.push_back('f'); break;} case TYPE_UNIT: {ufvl_t.push_back('u'); break;} } ufvl_i.push_back(i2); break; } else { if(l < l2 || (item->type() == TYPE_VARIABLE && l == l2 && ufvl_t[i] == 'v') || (item->type() == TYPE_FUNCTION && l == l2 && (ufvl_t[i] != 'p' && ufvl_t[i] != 'P' && ufvl_t[i] != 'q')) || (item->type() == TYPE_UNIT && l == l2 && (ufvl_t[i] != 'p' && ufvl_t[i] != 'P' && ufvl_t[i] != 'q' && ufvl_t[i] != 'f')) ) { ufvl.insert(it, (void*) item); switch(item->type()) { case TYPE_VARIABLE: {ufvl_t.insert(ufvl_t.begin() + i, 'v'); break;} case TYPE_FUNCTION: {ufvl_t.insert(ufvl_t.begin() + i, 'f'); break;} case TYPE_UNIT: {ufvl_t.insert(ufvl_t.begin() + i, 'u'); break;} } ufvl_i.insert(ufvl_i.begin() + i, i2); break; } } i++; } } else if(l2 > 0) { l2--; switch(item->type()) { case TYPE_VARIABLE: { ufv[3][l2].push_back((void*) item); ufv_i[3][l2].push_back(i2); break; } case TYPE_FUNCTION: { ufv[1][l2].push_back((void*) item); ufv_i[1][l2].push_back(i2); break; } case TYPE_UNIT: { ufv[2][l2].push_back((void*) item); ufv_i[2][l2].push_back(i2); break; } } } } } void Calculator::variableNameChanged(Variable *v, bool new_item) { nameChanged(v, new_item); } void Calculator::functionNameChanged(MathFunction *f, bool new_item) { nameChanged(f, new_item); } void Calculator::unitNameChanged(Unit *u, bool new_item) { nameChanged(u, new_item); } Variable* Calculator::getVariable(string name_) { if(name_.empty()) return NULL; for(size_t i = 0; i < variables.size(); i++) { if(variables[i]->hasName(name_)) { return variables[i]; } } return NULL; } Variable* Calculator::getActiveVariable(string name_) { if(name_.empty()) return NULL; for(size_t i = 0; i < variables.size(); i++) { if(variables[i]->isActive() && variables[i]->hasName(name_)) { return variables[i]; } } return NULL; } ExpressionItem* Calculator::addExpressionItem(ExpressionItem *item, bool force) { switch(item->type()) { case TYPE_VARIABLE: { return addVariable((Variable*) item, force); } case TYPE_FUNCTION: { if(item->subtype() == item->subtype() == SUBTYPE_DATA_SET) return addDataSet((DataSet*) item, force); else return addFunction((MathFunction*) item, force); } case TYPE_UNIT: { return addUnit((Unit*) item, force); } } return NULL; } MathFunction* Calculator::addFunction(MathFunction *f, bool force, bool check_names) { if(check_names) { for(size_t i = 1; i <= f->countNames(); i++) { f->setName(getName(f->getName(i).name, f, force), i); } } if(!f->isLocal() && functions.size() > 0 && functions[functions.size() - 1]->isLocal()) { functions.insert(functions.begin(), f); } else { functions.push_back(f); } functionNameChanged(f, true); for(vector::iterator it = deleted_functions.begin(); it != deleted_functions.end(); ++it) { if(*it == f) { deleted_functions.erase(it); break; } } f->setRegistered(true); f->setChanged(false); return f; } DataSet* Calculator::addDataSet(DataSet *dc, bool force, bool check_names) { addFunction(dc, force, check_names); data_sets.push_back(dc); return dc; } DataSet* Calculator::getDataSet(size_t index) { if(index > 0 && index <= data_sets.size()) { return data_sets[index - 1]; } return 0; } DataSet* Calculator::getDataSet(string name) { if(name.empty()) return NULL; for(size_t i = 0; i < data_sets.size(); i++) { if(data_sets[i]->hasName(name)) { return data_sets[i]; } } return NULL; } MathFunction* Calculator::getFunction(string name_) { if(name_.empty()) return NULL; for(size_t i = 0; i < functions.size(); i++) { if(functions[i]->hasName(name_)) { return functions[i]; } } return NULL; } MathFunction* Calculator::getActiveFunction(string name_) { if(name_.empty()) return NULL; for(size_t i = 0; i < functions.size(); i++) { if(functions[i]->isActive() && functions[i]->hasName(name_)) { return functions[i]; } } return NULL; } bool Calculator::variableNameIsValid(const string &name_) { return name_.find_first_of(ILLEGAL_IN_NAMES) == string::npos && !is_in(NUMBERS, name_[0]); } bool Calculator::functionNameIsValid(const string &name_) { return name_.find_first_of(ILLEGAL_IN_NAMES) == string::npos && !is_in(NUMBERS, name_[0]); } bool Calculator::unitNameIsValid(const string &name_) { return name_.find_first_of(ILLEGAL_IN_UNITNAMES) == string::npos; } bool Calculator::variableNameIsValid(const char *name_) { if(is_in(NUMBERS, name_[0])) return false; for(size_t i = 0; name_[i] != '\0'; i++) { if(is_in(ILLEGAL_IN_NAMES, name_[i])) return false; } return true; } bool Calculator::functionNameIsValid(const char *name_) { if(is_in(NUMBERS, name_[0])) return false; for(size_t i = 0; name_[i] != '\0'; i++) { if(is_in(ILLEGAL_IN_NAMES, name_[i])) return false; } return true; } bool Calculator::unitNameIsValid(const char *name_) { for(size_t i = 0; name_[i] != '\0'; i++) { if(is_in(ILLEGAL_IN_UNITNAMES, name_[i])) return false; } return true; } #define VERSION_BEFORE(i1, i2, i3) (version_numbers[0] < i1 || (version_numbers[0] == i1 && (version_numbers[1] < i2 || (version_numbers[1] == i2 && version_numbers[2] < i3)))) bool Calculator::variableNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs) { return variableNameIsValid(name_.c_str(), version_numbers, is_user_defs); } bool Calculator::functionNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs) { return functionNameIsValid(name_.c_str(), version_numbers, is_user_defs); } bool Calculator::unitNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs) { return unitNameIsValid(name_.c_str(), version_numbers, is_user_defs); } bool Calculator::variableNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) { if(is_in(NUMBERS, name_[0])) return false; bool b = false; for(size_t i = 0; name_[i] != '\0'; i++) { if(is_in(ILLEGAL_IN_NAMES, name_[i])) { if(is_user_defs && VERSION_BEFORE(0, 8, 1) && name_[i] == BITWISE_NOT_CH) { b = true; } else { return false; } } } if(b) { error(true, _("\"%s\" is not allowed in names anymore. Please change the name of \"%s\", or the variable will be lost."), BITWISE_NOT, name_, NULL); } return true; } bool Calculator::functionNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) { if(is_in(NUMBERS, name_[0])) return false; bool b = false; for(size_t i = 0; name_[i] != '\0'; i++) { if(is_in(ILLEGAL_IN_NAMES, name_[i])) { if(is_user_defs && VERSION_BEFORE(0, 8, 1) && name_[i] == BITWISE_NOT_CH) { b = true; } else { return false; } } } if(b) { error(true, _("\"%s\" is not allowed in names anymore. Please change the name \"%s\", or the function will be lost."), BITWISE_NOT, name_, NULL); } return true; } bool Calculator::unitNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) { bool b = false; for(size_t i = 0; name_[i] != '\0'; i++) { if(is_in(ILLEGAL_IN_UNITNAMES, name_[i])) { if(is_user_defs && VERSION_BEFORE(0, 8, 1) && name_[i] == BITWISE_NOT_CH) { b = true; } else { return false; } } } if(b) { error(true, _("\"%s\" is not allowed in names anymore. Please change the name \"%s\", or the unit will be lost."), BITWISE_NOT, name_, NULL); } return true; } string Calculator::convertToValidVariableName(string name_) { size_t i = 0; while(true) { i = name_.find_first_of(ILLEGAL_IN_NAMES_MINUS_SPACE_STR, i); if(i == string::npos) break; name_.erase(name_.begin() + i); } gsub(SPACE, UNDERSCORE, name_); while(is_in(NUMBERS, name_[0])) { name_.erase(name_.begin()); } return name_; } string Calculator::convertToValidFunctionName(string name_) { return convertToValidVariableName(name_); } string Calculator::convertToValidUnitName(string name_) { size_t i = 0; string stmp = ILLEGAL_IN_NAMES_MINUS_SPACE_STR + NUMBERS; while(true) { i = name_.find_first_of(stmp, i); if(i == string::npos) break; name_.erase(name_.begin() + i); } gsub(SPACE, UNDERSCORE, name_); return name_; } bool Calculator::nameTaken(string name, ExpressionItem *object) { if(name.empty()) return false; if(object) { switch(object->type()) { case TYPE_VARIABLE: {} case TYPE_UNIT: { for(size_t index = 0; index < variables.size(); index++) { if(variables[index]->isActive() && variables[index]->hasName(name)) { return variables[index] != object; } } for(size_t i = 0; i < units.size(); i++) { if(units[i]->isActive() && units[i]->hasName(name)) { return units[i] != object; } } break; } case TYPE_FUNCTION: { for(size_t index = 0; index < functions.size(); index++) { if(functions[index]->isActive() && functions[index]->hasName(name)) { return functions[index] != object; } } break; } } } else { return getActiveExpressionItem(name) != NULL; } return false; } bool Calculator::variableNameTaken(string name, Variable *object) { if(name.empty()) return false; for(size_t index = 0; index < variables.size(); index++) { if(variables[index]->isActive() && variables[index]->hasName(name)) { return variables[index] != object; } } for(size_t i = 0; i < units.size(); i++) { if(units[i]->isActive() && units[i]->hasName(name)) { return true; } } return false; } bool Calculator::unitNameTaken(string name, Unit *object) { if(name.empty()) return false; for(size_t index = 0; index < variables.size(); index++) { if(variables[index]->isActive() && variables[index]->hasName(name)) { return true; } } for(size_t i = 0; i < units.size(); i++) { if(units[i]->isActive() && units[i]->hasName(name)) { return units[i] == object; } } return false; } bool Calculator::functionNameTaken(string name, MathFunction *object) { if(name.empty()) return false; for(size_t index = 0; index < functions.size(); index++) { if(functions[index]->isActive() && functions[index]->hasName(name)) { return functions[index] != object; } } return false; } bool Calculator::unitIsUsedByOtherUnits(const Unit *u) const { const Unit *u2; for(size_t i = 0; i < units.size(); i++) { if(units[i] != u) { u2 = units[i]; while(u2->subtype() == SUBTYPE_ALIAS_UNIT) { u2 = ((AliasUnit*) u2)->firstBaseUnit(); if(u2 == u) { return true; } } } } return false; } bool compare_name(const string &name, const string &str, const size_t &name_length, const size_t &str_index) { if(name_length == 0) return false; if(name[0] != str[str_index]) return false; if(name_length == 1) return true; for(size_t i = 1; i < name_length; i++) { if(name[i] != str[str_index + i]) return false; } return true; } bool compare_name_no_case(const string &name, const string &str, const size_t &name_length, const size_t &str_index) { if(name_length == 0) return false; if(name[0] < 0 && name_length > 1) { if(str[str_index] >= 0) return false; size_t i2 = 1; while(i2 < name_length && name[i2] < 0) { if(str[str_index + i2] >= 0) return false; i2++; } gchar *gstr1 = g_utf8_strdown(name.c_str(), i2); gchar *gstr2 = g_utf8_strdown(str.c_str() + (sizeof(char) * str_index), i2); if(strcmp(gstr1, gstr2) != 0) return false; g_free(gstr1); g_free(gstr2); } else if(name[0] != str[str_index] && !((name[0] >= 'a' && name[0] <= 'z') && name[0] - 32 == str[str_index]) && !((name[0] <= 'Z' && name[0] >= 'A') && name[0] + 32 == str[str_index])) { return false; } if(name_length == 1) return true; size_t i = 1; while(name[i - 1] < 0 && i <= name_length) { i++; } for(; i < name_length; i++) { if(name[i] < 0 && i + 1 < name_length) { if(str[str_index + i] >= 0) return false; size_t i2 = 1; while(i2 + i < name_length && name[i2 + i] < 0) { if(str[str_index + i2 + i] >= 0) return false; i2++; } gchar *gstr1 = g_utf8_strdown(name.c_str() + (sizeof(char) * i), i2); gchar *gstr2 = g_utf8_strdown(str.c_str() + (sizeof(char) * (str_index + i)), i2); if(strcmp(gstr1, gstr2) != 0) return false; g_free(gstr1); g_free(gstr2); i += i2 - 1; } else if(name[i] != str[str_index + i] && !((name[i] >= 'a' && name[i] <= 'z') && name[i] - 32 == str[str_index + i]) && !((name[i] <= 'Z' && name[i] >= 'A') && name[i] + 32 == str[str_index + i])) { return false; } } return true; } void Calculator::parseSigns(string &str) const { vector q_begin; vector q_end; size_t quote_index = 0; while(true) { quote_index = str.find_first_of("\"\'", quote_index); if(quote_index == string::npos) { break; } q_begin.push_back(quote_index); quote_index = str.find(str[quote_index], quote_index + 1); if(quote_index == string::npos) { q_end.push_back(str.length() - 1); break; } q_end.push_back(quote_index); quote_index++; } int index_shift = 0; for(size_t i = 0; i < signs.size(); i++) { size_t ui = str.find(signs[i]); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] + index_shift && ui >= q_begin[ui2] + index_shift) { ui = str.find(signs[i], q_end[ui2] + 1 + index_shift); b = true; break; } } if(!b) { index_shift += real_signs[i].length() - signs[i].length(); str.replace(ui, signs[i].length(), real_signs[i]); ui = str.find(signs[i], ui + real_signs[i].length()); } } } } MathStructure Calculator::parse(string str, const ParseOptions &po) { MathStructure mstruct; parse(&mstruct, str, po); return mstruct; } void Calculator::parse(MathStructure *mstruct, string str, const ParseOptions &parseoptions) { ParseOptions po = parseoptions; MathStructure *unended_function = po.unended_function; po.unended_function = NULL; mstruct->clear(); const string *name = NULL; string stmp, stmp2; parseSigns(str); if(po.brackets_as_parentheses) { gsub(LEFT_VECTOR_WRAP, LEFT_PARENTHESIS, str); gsub(RIGHT_VECTOR_WRAP, RIGHT_PARENTHESIS, str); } size_t isave = 0; if((isave = str.find(":=", 1)) != string::npos) { string name = str.substr(0, isave); string value = str.substr(isave + 2, str.length() - (isave + 2)); str = value; str += COMMA; str += name; f_save->parse(*mstruct, str, po); return; } if(po.base >= 2 && po.base <= 10 && po.default_dataset != NULL && str.length() > 1) { size_t str_index = str.find(DOT_CH, 1); while(str_index != string::npos) { if(str_index + 1 < str.length() && ((is_not_in(NUMBERS NOT_IN_NAMES, str[str_index + 1]) && is_not_in(NOT_IN_NAMES, str[str_index - 1])) || (is_not_in(NOT_IN_NAMES, str[str_index + 1]) && is_not_in(NUMBERS NOT_IN_NAMES, str[str_index - 1])))) { size_t dot_index = str.find_first_of(NOT_IN_NAMES DOT, str_index + 1); if(dot_index != string::npos && str[dot_index] == DOT_CH) { str_index = dot_index; } else { size_t property_index = str.find_last_of(NOT_IN_NAMES, str_index - 1); if(property_index == string::npos) { str.insert(0, 1, '.'); str.insert(0, po.default_dataset->referenceName()); str_index += po.default_dataset->referenceName().length() + 1; } else { str.insert(property_index + 1, 1, '.'); str.insert(property_index + 1, po.default_dataset->referenceName()); str_index += po.default_dataset->referenceName().length() + 1; } } } str_index = str.find(DOT_CH, str_index + 1); } } for(size_t str_index = 0; str_index < str.length(); str_index++) { if(str[str_index] == LEFT_VECTOR_WRAP_CH) { int i4 = 1; size_t i3 = str_index; while(true) { i3 = str.find_first_of(LEFT_VECTOR_WRAP RIGHT_VECTOR_WRAP, i3 + 1); if(i3 == string::npos) { for(; i4 > 0; i4--) { str += RIGHT_VECTOR_WRAP; } i3 = str.length() - 1; } else if(str[i3] == LEFT_VECTOR_WRAP_CH) { i4++; } else if(str[i3] == RIGHT_VECTOR_WRAP_CH) { i4--; if(i4 > 0) { size_t i5 = str.find_first_not_of(SPACE, i3 + 1); if(i5 != string::npos && str[i5] == LEFT_VECTOR_WRAP_CH) { str.insert(i5, COMMA); } } } if(i4 == 0) { stmp2 = str.substr(str_index + 1, i3 - str_index - 1); stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(parseAddVectorId(stmp2, po)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, i3 + 1 - str_index, stmp); str_index += stmp.length() - 1; break; } } } else if(str[str_index] == '\"' || str[str_index] == '\'') { if(str_index == str.length() - 1) { str.erase(str_index, 1); } else { size_t i = str.find(str[str_index], str_index + 1); size_t name_length; if(i == string::npos) { i = str.length(); name_length = i - str_index; } else { name_length = i - str_index + 1; } stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; MathStructure *mstruct = new MathStructure(str.substr(str_index + 1, i - str_index - 1)); stmp += i2s(addId(mstruct)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length() - 1; } } else if(po.base >= 2 && po.base <= 10 && str[str_index] == '!' && po.functions_enabled) { if(str_index > 0 && (str.length() - str_index == 1 || str[str_index + 1] != EQUALS_CH)) { stmp = ""; size_t i5 = str.find_last_not_of(SPACE, str_index - 1); size_t i3; if(i5 == string::npos) { } else if(str[i5] == RIGHT_PARENTHESIS_CH) { if(i5 == 0) { stmp2 = str.substr(0, i5 + 1); } else { i3 = i5 - 1; size_t i4 = 1; while(true) { i3 = str.find_last_of(LEFT_PARENTHESIS RIGHT_PARENTHESIS, i3); if(i3 == string::npos) { stmp2 = str.substr(0, i5 + 1); break; } if(str[i3] == RIGHT_PARENTHESIS_CH) { i4++; } else { i4--; if(i4 == 0) { stmp2 = str.substr(i3, i5 + 1 - i3); break; } } if(i3 == 0) { stmp2 = str.substr(0, i5 + 1); break; } i3--; } } } else if(str[i5] == ID_WRAP_RIGHT_CH && (i3 = str.find_last_of(ID_WRAP_LEFT, i5 - 1)) != string::npos) { stmp2 = str.substr(i3, i5 + 1 - i3); } else if(is_not_in(RESERVED OPERATORS SPACES VECTOR_WRAPS PARENTHESISS COMMAS, str[i5])) { i3 = str.find_last_of(RESERVED OPERATORS SPACES VECTOR_WRAPS PARENTHESISS COMMAS, i5); if(i3 == string::npos) { stmp2 = str.substr(0, i5 + 1); } else { stmp2 = str.substr(i3 + 1, i5 - i3); } } if(!stmp2.empty()) { stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; int ifac = 1; i3 = str_index + 1; size_t i4 = i3; while((i3 = str.find_first_not_of(SPACE, i3)) != string::npos && str[i3] == '!') { ifac++; i3++; i4 = i3; } if(ifac == 2) stmp += i2s(parseAddId(f_factorial2, stmp2, po)); else if(ifac == 1) stmp += i2s(parseAddId(f_factorial, stmp2, po)); else stmp += i2s(parseAddIdAppend(f_multifactorial, MathStructure(ifac, 1), stmp2, po)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(i5 - stmp2.length() + 1, stmp2.length() + i4 - i5 - 1, stmp); str_index = stmp.length() + i5 - stmp2.length(); } } } else if(str[str_index] == SPACE_CH) { size_t i = str.find(SPACE, str_index + 1); if(i != string::npos) { i -= str_index + 1; if(i == per_str_len && compare_name_no_case(per_str, str, per_str_len, str_index + 1)) { str.replace(str_index + 1, i, DIVISION); str_index++; } else if(i == times_str_len && compare_name_no_case(times_str, str, times_str_len, str_index + 1)) { str.replace(str_index + 1, i, MULTIPLICATION); str_index++; } else if(i == plus_str_len && compare_name_no_case(plus_str, str, plus_str_len, str_index + 1)) { str.replace(str_index + 1, i, PLUS); str_index++; } else if(i == minus_str_len && compare_name_no_case(minus_str, str, minus_str_len, str_index + 1)) { str.replace(str_index + 1, i, MINUS); str_index++; } else if(i == and_str_len && compare_name_no_case(and_str, str, and_str_len, str_index + 1)) { str.replace(str_index + 1, i, LOGICAL_AND); str_index++; } else if(i == AND_str_len && compare_name_no_case(AND_str, str, AND_str_len, str_index + 1)) { str.replace(str_index + 1, i, LOGICAL_AND); str_index++; } else if(i == or_str_len && compare_name_no_case(or_str, str, or_str_len, str_index + 1)) { str.replace(str_index + 1, i, LOGICAL_OR); str_index++; } else if(i == OR_str_len && compare_name_no_case(OR_str, str, OR_str_len, str_index + 1)) { str.replace(str_index + 1, i, LOGICAL_OR); str_index++; // } else if(compare_name_no_case(XOR_str, str, XOR_str_len, str_index + 1)) { } } } else if(str_index > 0 && po.base >= 2 && po.base <= 10 && is_in(EXPS, str[str_index]) && str_index + 1 < str.length() && (is_in(NUMBERS, str[str_index + 1]) || (is_in(PLUS MINUS, str[str_index + 1]) && str_index + 2 < str.length() && is_in(NUMBERS, str[str_index + 2]))) && is_in(NUMBER_ELEMENTS, str[str_index - 1])) { //don't do anything when e is used instead of E for EXP } else if(po.base == BASE_DECIMAL && str[str_index] == '0' && (str_index == 0 || is_in(OPERATORS SPACE, str[str_index - 1]))) { if(str_index + 2 < str.length() && (str[str_index + 1] == 'x' || str[str_index + 1] == 'X') && is_in(NUMBER_ELEMENTS "abcdefABCDEF", str[str_index + 2])) { //hexadecimal number 0x... size_t i = str.find_first_not_of(SPACE NUMBER_ELEMENTS "abcdefABCDEF", str_index + 2); size_t name_length; if(i == string::npos) i = str.length(); name_length = i - str_index; ParseOptions po_hex = po; po_hex.base = BASE_HEXADECIMAL; stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; MathStructure *mstruct = new MathStructure(Number(str.substr(str_index, i - str_index), po_hex)); stmp += i2s(addId(mstruct)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length() - 1; } else if(str_index + 2 < str.length() && (str[str_index + 1] == 'b' || str[str_index + 1] == 'B') && is_in("01", str[str_index + 2])) { //binary number 0b... size_t i = str.find_first_not_of(SPACE NUMBER_ELEMENTS, str_index + 2); size_t name_length; if(i == string::npos) i = str.length(); name_length = i - str_index; ParseOptions po_bin = po; po_bin.base = BASE_BINARY; stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; MathStructure *mstruct = new MathStructure(Number(str.substr(str_index, i - str_index), po_bin)); stmp += i2s(addId(mstruct)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length() - 1; } else if(str_index + 2 < str.length() && (str[str_index + 1] == 'o' || str[str_index + 1] == 'O') && is_in(NUMBERS, str[str_index + 2])) { //octal number 0o... size_t i = str.find_first_not_of(SPACE NUMBER_ELEMENTS, str_index + 2); size_t name_length; if(i == string::npos) i = str.length(); name_length = i - str_index; ParseOptions po_oct = po; po_oct.base = BASE_OCTAL; stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; MathStructure *mstruct = new MathStructure(Number(str.substr(str_index, i - str_index), po_oct)); stmp += i2s(addId(mstruct)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length() - 1; /*} else if(str_index + 1 < str.length() && is_in("123456789", str[str_index + 1])) { //octal number 0... size_t i = str.find_first_not_of(SPACE NUMBER_ELEMENTS, str_index + 1); size_t name_length; if(i == string::npos) i = str.length(); name_length = i - str_index; ParseOptions po_oct = po; po_oct.base = BASE_OCTAL; stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; MathStructure *mstruct = new MathStructure(Number(str.substr(str_index, i - str_index), po_oct)); stmp += i2s(addId(mstruct)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length() - 1;*/ } } else if(po.base >= 2 && po.base <= 10 && is_not_in(NUMBERS NOT_IN_NAMES, str[str_index])) { bool p_mode = false; void *best_p_object = NULL; Prefix *best_p = NULL; size_t best_pl = 0; size_t best_pnl = 0; bool moved_forward = false; const string *found_function_name = NULL; bool case_sensitive = false; size_t found_function_name_length = 0; void *found_function = NULL, *object = NULL; int vt2 = -1; size_t ufv_index; size_t name_length; size_t vt3 = 0; char ufvt = 0; size_t last_name_char = str.find_first_of(NOT_IN_NAMES, str_index + 1); if(last_name_char == string::npos) { last_name_char = str.length() - 1; } else { last_name_char--; } size_t last_unit_char = str.find_last_not_of(NUMBERS, last_name_char); size_t name_chars_left = last_name_char - str_index + 1; size_t unit_chars_left = last_unit_char - str_index + 1; if(name_chars_left <= UFV_LENGTHS) { ufv_index = name_chars_left - 1; vt2 = 0; } else { ufv_index = 0; } Prefix *p = NULL; while(vt2 < 4) { name = NULL; p = NULL; switch(vt2) { case -1: { if(ufv_index < ufvl.size()) { switch(ufvl_t[ufv_index]) { case 'v': { if(po.variables_enabled && !p_mode) { name = &((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).name; case_sensitive = ((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).case_sensitive; name_length = name->length(); if(name_length < found_function_name_length) { name = NULL; } else if(po.limit_implicit_multiplication) { if(name_length != name_chars_left && name_length != unit_chars_left) name = NULL; } else if(name_length > name_chars_left) { name = NULL; } } break; } case 'f': { if(po.functions_enabled && !found_function_name && !p_mode) { name = &((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).name; case_sensitive = ((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).case_sensitive; name_length = name->length(); if(po.limit_implicit_multiplication) { if(name_length != name_chars_left && name_length != unit_chars_left) name = NULL; } else if(name_length > name_chars_left || name_length < found_function_name_length) { name = NULL; } } break; } case 'u': { if(po.units_enabled && !p_mode) { name = &((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).name; case_sensitive = ((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).case_sensitive; name_length = name->length(); if(name_length < found_function_name_length) { name = NULL; } else if(po.limit_implicit_multiplication || ((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).plural) { if(name_length != unit_chars_left) name = NULL; } else if(name_length > unit_chars_left) { name = NULL; } } break; } case 'p': { if(!p && po.units_enabled) { name = &((Prefix*) ufvl[ufv_index])->shortName(); name_length = name->length(); if(name_length >= unit_chars_left || name_length < found_function_name_length) { name = NULL; } } case_sensitive = true; break; } case 'P': { if(!p && po.units_enabled) { name = &((Prefix*) ufvl[ufv_index])->longName(); name_length = name->length(); if(name_length >= unit_chars_left || name_length < found_function_name_length) { name = NULL; } } case_sensitive = false; break; } case 'q': { if(!p && po.units_enabled) { name = &((Prefix*) ufvl[ufv_index])->unicodeName(); name_length = name->length(); if(name_length >= unit_chars_left || name_length < found_function_name_length) { name = NULL; } } case_sensitive = true; break; } } ufvt = ufvl_t[ufv_index]; object = ufvl[ufv_index]; ufv_index++; break; } else { if(found_function_name) { vt2 = 4; break; } vt2 = 0; vt3 = 0; if(po.limit_implicit_multiplication && unit_chars_left <= UFV_LENGTHS) { ufv_index = unit_chars_left - 1; } else { ufv_index = UFV_LENGTHS - 1; } } } case 0: { if(po.units_enabled && ufv_index < unit_chars_left - 1 && vt3 < ufv[vt2][ufv_index].size()) { object = ufv[vt2][ufv_index][vt3]; switch(ufv_i[vt2][ufv_index][vt3]) { case 1: { ufvt = 'P'; name = &((Prefix*) object)->longName(); name_length = name->length(); case_sensitive = false; break; } case 2: { ufvt = 'p'; name = &((Prefix*) object)->shortName(); name_length = name->length(); case_sensitive = true; break; } case 3: { ufvt = 'q'; name = &((Prefix*) object)->unicodeName(); name_length = name->length(); case_sensitive = true; break; } } vt3++; break; } vt2 = 1; vt3 = 0; } case 1: { if(!found_function_name && po.functions_enabled && !p_mode && (!po.limit_implicit_multiplication || ufv_index + 1 == unit_chars_left || ufv_index + 1 == name_chars_left) && vt3 < ufv[vt2][ufv_index].size()) { object = ufv[vt2][ufv_index][vt3]; ufvt = 'f'; name = &((MathFunction*) object)->getName(ufv_i[vt2][ufv_index][vt3]).name; name_length = name->length(); case_sensitive = ((MathFunction*) object)->getName(ufv_i[vt2][ufv_index][vt3]).case_sensitive; vt3++; break; } vt2 = 2; vt3 = 0; } case 2: { if(po.units_enabled && !p_mode && (!po.limit_implicit_multiplication || ufv_index + 1 == unit_chars_left) && ufv_index < unit_chars_left && vt3 < ufv[vt2][ufv_index].size()) { object = ufv[vt2][ufv_index][vt3]; if(ufv_index + 1 == unit_chars_left || !((Unit*) object)->getName(ufv_i[vt2][ufv_index][vt3]).plural) { ufvt = 'u'; name = &((Unit*) object)->getName(ufv_i[vt2][ufv_index][vt3]).name; name_length = name->length(); case_sensitive = ((Unit*) object)->getName(ufv_i[vt2][ufv_index][vt3]).case_sensitive; } vt3++; break; } vt2 = 3; vt3 = 0; } case 3: { if(po.variables_enabled && !p_mode && (!po.limit_implicit_multiplication || ufv_index + 1 == unit_chars_left || ufv_index + 1 == name_chars_left) && vt3 < ufv[vt2][ufv_index].size()) { object = ufv[vt2][ufv_index][vt3]; ufvt = 'v'; name = &((Variable*) object)->getName(ufv_i[vt2][ufv_index][vt3]).name; name_length = name->length(); case_sensitive = ((Variable*) object)->getName(ufv_i[vt2][ufv_index][vt3]).case_sensitive; vt3++; break; } if(ufv_index == 0 || found_function_name) { vt2 = 4; } else { ufv_index--; vt3 = 0; vt2 = 0; } } } if(name && name_length >= found_function_name_length && ((case_sensitive && compare_name(*name, str, name_length, str_index)) || (!case_sensitive && compare_name_no_case(*name, str, name_length, str_index)))) { moved_forward = false; switch(ufvt) { case 'v': { stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(addId(new MathStructure((Variable*) object))); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length(); moved_forward = true; break; } case 'f': { if(((ExpressionItem*) object)->subtype() == SUBTYPE_DATA_SET && str[str_index + name_length] == DOT_CH) { str[str_index + name_length] = LEFT_PARENTHESIS_CH; size_t dot2_index = str.find(DOT_CH, str_index + name_length + 1); str[dot2_index] = COMMA_CH; size_t end_index = str.find_first_of(NOT_IN_NAMES, dot2_index + 1); if(end_index == string::npos) str += RIGHT_PARENTHESIS_CH; else str.insert(end_index, 1, RIGHT_PARENTHESIS_CH); } size_t not_space_index; if((not_space_index = str.find_first_not_of(SPACES, str_index + name_length)) == string::npos || str[not_space_index] != LEFT_PARENTHESIS_CH) { found_function = object; found_function_name = name; found_function_name_length = name_length; break; } set_function: MathFunction *f = (MathFunction*) object; int i4 = -1; size_t i6; if(f->args() == 0) { size_t i7 = str.find_first_not_of(SPACES, str_index + name_length); if(i7 != string::npos && str[i7] == LEFT_PARENTHESIS_CH) { i7 = str.find_first_not_of(SPACES, i7 + 1); if(i7 != string::npos && str[i7] == RIGHT_PARENTHESIS_CH) { i4 = i7 - str_index + 1; } } stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(parseAddId(f, empty_string, po)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; if(i4 < 0) i4 = name_length; } else if(po.rpn && f->args() == 1 && str_index > 0 && str[str_index - 1] == SPACE_CH && (str_index + name_length >= str.length() || str[str_index + name_length] != LEFT_PARENTHESIS_CH) && (i6 = str.find_last_not_of(SPACE, str_index - 1)) != string::npos) { size_t i7 = str.rfind(SPACE, i6); if(i7 == string::npos) { stmp2 = str.substr(0, i6 + 1); } else { stmp2 = str.substr(i7 + 1, i6 - i7); } stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; if(f == f_vector) stmp += i2s(parseAddVectorId(stmp2, po)); else stmp += i2s(parseAddId(f, stmp2, po)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; if(i7 == string::npos) { str.replace(0, str_index + name_length, stmp); } else { str.replace(i7 + 1, str_index + name_length - i7 - 1, stmp); } str_index += name_length; moved_forward = true; } else { bool b = false, b_unended_function = false; size_t i5 = 1; i6 = 0; while(!b) { if(i6 + str_index + name_length >= str.length()) { b = true; i5 = 2; i6++; b_unended_function = true; break; } else { char c = str[str_index + name_length + i6]; if(c == LEFT_PARENTHESIS_CH) { if(i5 < 2) b = true; else i5++; } else if(c == RIGHT_PARENTHESIS_CH) { if(i5 <= 2) b = true; else i5--; } else if(c == ' ') { if(i5 == 2) b = true; } else if(i5 < 2) { i5 = 2; } } i6++; } if(b && i5 >= 2) { stmp2 = str.substr(str_index + name_length, i6 - 1); stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; if(b_unended_function && unended_function) { po.unended_function = unended_function; } if(f == f_vector) { stmp += i2s(parseAddVectorId(stmp2, po)); } else { stmp += i2s(parseAddId(f, stmp2, po)); } po.unended_function = NULL; stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; i4 = i6 + 1 + name_length - 2; b = false; } size_t i9 = i6; if(b) { b = false; i6 = i6 + 1 + str_index + name_length; size_t i7 = i6 - 1; size_t i8 = i7; while(true) { i5 = str.find(RIGHT_PARENTHESIS_CH, i7); if(i5 == string::npos) { b_unended_function = true; //str.append(1, RIGHT_PARENTHESIS_CH); //i5 = str.length() - 1; i5 = str.length(); } if(i5 < (i6 = str.find(LEFT_PARENTHESIS_CH, i8)) || i6 == string::npos) { i6 = i5; b = true; break; } i7 = i5 + 1; i8 = i6 + 1; } if(!b) { b_unended_function = false; } } if(b) { stmp2 = str.substr(str_index + name_length + i9, i6 - (str_index + name_length + i9)); stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; if(b_unended_function && unended_function) { po.unended_function = unended_function; } if(f == f_vector) { stmp += i2s(parseAddVectorId(stmp2, po)); } else { stmp += i2s(parseAddId(f, stmp2, po)); } po.unended_function = NULL; stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; i4 = i6 + 1 - str_index; } } if(i4 > 0) { str.replace(str_index, i4, stmp); str_index += stmp.length(); moved_forward = true; } break; } case 'u': { replace_text_by_unit_place: if(str.length() > str_index + name_length && is_in(NUMBERS, str[str_index + name_length]) && !((Unit*) object)->isCurrency()) { str.insert(str_index + name_length, 1, POWER_CH); } stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(addId(new MathStructure((Unit*) object, p))); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length(); moved_forward = true; p = NULL; break; } case 'p': {} case 'q': {} case 'P': { if(str_index + name_length == str.length() || is_in(NOT_IN_NAMES, str[str_index + name_length])) { break; } p = (Prefix*) object; str_index += name_length; unit_chars_left = last_unit_char - str_index + 1; size_t name_length_old = name_length; int index = 0; if(unit_chars_left > UFV_LENGTHS) { for(size_t ufv_index2 = 0; ufv_index2 < ufvl.size(); ufv_index2++) { name = NULL; switch(ufvl_t[ufv_index2]) { case 'u': { name = &((Unit*) ufvl[ufv_index2])->getName(ufvl_i[ufv_index2]).name; case_sensitive = ((Unit*) ufvl[ufv_index2])->getName(ufvl_i[ufv_index2]).case_sensitive; name_length = name->length(); if(po.limit_implicit_multiplication || ((Unit*) ufvl[ufv_index2])->getName(ufvl_i[ufv_index2]).plural) { if(name_length != unit_chars_left) name = NULL; } else if(name_length > unit_chars_left) { name = NULL; } break; } } if(name && ((case_sensitive && compare_name(*name, str, name_length, str_index)) || (!case_sensitive && compare_name_no_case(*name, str, name_length, str_index)))) { if((!p_mode && name_length_old > 1) || (p_mode && (name_length + name_length_old > best_pl || ((ufvt != 'P' || !((Unit*) ufvl[ufv_index2])->getName(ufvl_i[ufv_index2]).abbreviation) && name_length + name_length_old == best_pl)))) { p_mode = true; best_p = p; best_p_object = ufvl[ufv_index2]; best_pl = name_length + name_length_old; best_pnl = name_length_old; index = -1; break; } if(!p_mode) { str.erase(str_index - name_length_old, name_length_old); str_index -= name_length_old; object = ufvl[ufv_index2]; goto replace_text_by_unit_place; } } } } if(index < 0) { } else if(UFV_LENGTHS >= unit_chars_left) { index = unit_chars_left - 1; } else if(po.limit_implicit_multiplication) { index = -1; } else { index = UFV_LENGTHS - 1; } for(; index >= 0; index--) { for(size_t ufv_index2 = 0; ufv_index2 < ufv[2][index].size(); ufv_index2++) { name = &((Unit*) ufv[2][index][ufv_index2])->getName(ufv_i[2][index][ufv_index2]).name; case_sensitive = ((Unit*) ufv[2][index][ufv_index2])->getName(ufv_i[2][index][ufv_index2]).case_sensitive; name_length = name->length(); if(index + 1 == (int) unit_chars_left || !((Unit*) ufv[2][index][ufv_index2])->getName(ufv_i[2][index][ufv_index2]).plural) { if(name_length <= unit_chars_left && ((case_sensitive && compare_name(*name, str, name_length, str_index)) || (!case_sensitive && compare_name_no_case(*name, str, name_length, str_index)))) { if((!p_mode && name_length_old > 1) || (p_mode && (name_length + name_length_old > best_pl || ((ufvt != 'P' || !((Unit*) ufv[2][index][ufv_index2])->getName(ufv_i[2][index][ufv_index2]).abbreviation) && name_length + name_length_old == best_pl)))) { p_mode = true; best_p = p; best_p_object = ufv[2][index][ufv_index2]; best_pl = name_length + name_length_old; best_pnl = name_length_old; index = -1; } if(!p_mode) { str.erase(str_index - name_length_old, name_length_old); str_index -= name_length_old; object = ufv[2][index][ufv_index2]; goto replace_text_by_unit_place; } } } } if(po.limit_implicit_multiplication || (p_mode && index + 1 + name_length_old < best_pl)) { break; } } str_index -= name_length_old; unit_chars_left = last_unit_char - str_index + 1; break; } } if(moved_forward) { str_index--; break; } } } if(!moved_forward && p_mode) { object = best_p_object; p = best_p; str.erase(str_index, best_pnl); name_length = best_pl - best_pnl; goto replace_text_by_unit_place; } else if(!moved_forward && found_function) { object = found_function; name = found_function_name; name_length = found_function_name_length; goto set_function; } if(!moved_forward) { if(po.limit_implicit_multiplication) { if(po.unknowns_enabled && (unit_chars_left > 1 || (str[str_index] != EXP_CH && str[str_index] != EXP2_CH))) { stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(addId(new MathStructure(str.substr(str_index, unit_chars_left)))); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, unit_chars_left, stmp); str_index += stmp.length() - 1; } else { str_index += unit_chars_left - 1; } } else if(po.unknowns_enabled && str[str_index] != EXP_CH && str[str_index] != EXP2_CH) { size_t i = 1; if(str[str_index + 1] < 0) { i++; while(i <= unit_chars_left && (unsigned char) str[str_index + i] >= 0x80 && (unsigned char) str[str_index + i] <= 0xBF) { i++; } } stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(addId(new MathStructure(str.substr(str_index, i)))); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, i, stmp); str_index += stmp.length() - 1; } } } } size_t comma_i = str.find(COMMA, 0); while(comma_i != string::npos) { int i3 = 1; size_t left_par_i = comma_i; while(left_par_i > 0) { left_par_i = str.find_last_of(LEFT_PARENTHESIS RIGHT_PARENTHESIS, left_par_i - 1); if(left_par_i == string::npos) break; if(str[left_par_i] == LEFT_PARENTHESIS_CH) { i3--; if(i3 == 0) break; } else if(str[left_par_i] == RIGHT_PARENTHESIS_CH) { i3++; } } if(i3 > 0) { str.insert(0, i3, LEFT_PARENTHESIS_CH); comma_i += i3; i3 = 0; left_par_i = 0; } if(i3 == 0) { i3 = 1; size_t right_par_i = comma_i; while(true) { right_par_i = str.find_first_of(LEFT_PARENTHESIS RIGHT_PARENTHESIS, right_par_i + 1); if(right_par_i == string::npos) { for(; i3 > 0; i3--) { str += RIGHT_PARENTHESIS; } right_par_i = str.length() - 1; } else if(str[right_par_i] == LEFT_PARENTHESIS_CH) { i3++; } else if(str[right_par_i] == RIGHT_PARENTHESIS_CH) { i3--; } if(i3 == 0) { stmp2 = str.substr(left_par_i + 1, right_par_i - left_par_i - 1); stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(parseAddVectorId(stmp2, po)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(left_par_i, right_par_i + 1 - left_par_i, stmp); comma_i = left_par_i + stmp.length() - 1; break; } } } comma_i = str.find(COMMA, comma_i + 1); } if(po.rpn) { size_t rpn_i = str.find(SPACE, 0); while(rpn_i != string::npos) { if(rpn_i == 0 || is_in(OPERATORS, str[rpn_i - 1]) || rpn_i + 1 == str.length() || is_in(SPACE OPERATORS, str[rpn_i + 1])) { str.erase(rpn_i, 1); } else { rpn_i++; } rpn_i = str.find(SPACE, rpn_i); } } else { size_t space_i = str.find(SPACE, 1); while(space_i != string::npos) { size_t after_space_i = str.find_first_not_of(SPACE, space_i + 1); if(after_space_i == string::npos) break; bool b1 = is_in(ID_WRAP_RIGHT RIGHT_PARENTHESIS, str[space_i - 1]); bool b2 = b1 ? is_not_in(OPERATORS, str[after_space_i]) : is_in(ID_WRAP_LEFT LEFT_PARENTHESIS, str[after_space_i]); if(b2 && !b1) b1 = is_not_in(OPERATORS, str[space_i - 1]); if(b1 && b2) { str[space_i] = MULTIPLICATION_CH; } space_i = str.find(SPACE, after_space_i); } remove_blanks(str); } parseOperators(mstruct, str, po); } bool Calculator::parseNumber(MathStructure *mstruct, string str, const ParseOptions &po) { mstruct->clear(); if(str.empty()) return false; if(str.find_first_not_of(OPERATORS SPACE) == string::npos) { if(disable_errors_ref > 0) { stopped_messages_count[disable_errors_ref - 1]++; stopped_warnings_count[disable_errors_ref - 1]++; } else { error(false, _("Misplaced operator(s) \"%s\" ignored"), str.c_str(), NULL); } return false; } int minus_count = 0; bool has_sign = false, had_non_sign = false; size_t i = 0; while(i < str.length()) { if(!had_non_sign && str[i] == MINUS_CH) { has_sign = true; minus_count++; str.erase(i, 1); } else if(!had_non_sign && str[i] == PLUS_CH) { has_sign = true; str.erase(i, 1); } else if(str[i] == SPACE_CH) { str.erase(i, 1); } else if(str[i] == COMMA_CH && DOT_S == ".") { str.erase(i, 1); } else if(is_in(OPERATORS, str[i])) { if(disable_errors_ref > 0) { stopped_messages_count[disable_errors_ref - 1]++; stopped_warnings_count[disable_errors_ref - 1]++; } else { error(false, _("Misplaced '%c' ignored"), str[i], NULL); } str.erase(i, 1); } else { had_non_sign = true; i++; } } if(str.empty()) { if(minus_count % 2 == 1 && !po.preserve_format) { mstruct->set(-1, 1); } else if(has_sign) { mstruct->set(1, 1); if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } } return false; } if(str[0] == ID_WRAP_LEFT_CH && str.length() > 2 && str[str.length() - 1] == ID_WRAP_RIGHT_CH) { int id = s2i(str.substr(1, str.length() - 2)); MathStructure *m_temp = getId((size_t) id); if(!m_temp) { mstruct->setUndefined(); error(true, _("Internal id %s does not exist."), i2s(id).c_str(), NULL); return true; } mstruct->set_nocopy(*m_temp); m_temp->unref(); if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } else if(minus_count % 2 == 1) { mstruct->negate(); } return true; } size_t itmp; if(po.base >= 2 && po.base <= 10 && (itmp = str.find_first_not_of(NUMBER_ELEMENTS MINUS, 0)) != string::npos) { if(itmp == 0) { error(true, _("\"%s\" is not a valid variable/function/unit."), str.c_str(), NULL); if(minus_count % 2 == 1 && !po.preserve_format) { mstruct->set(-1, 1); } else if(has_sign) { mstruct->set(1, 1); if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } } return false; } else { string stmp = str.substr(itmp, str.length() - itmp); error(true, _("Trailing characters \"%s\" (not a valid variable/function/unit) in number \"%s\" was ignored."), stmp.c_str(), str.c_str(), NULL); str.erase(itmp, str.length() - itmp); } } Number nr(str, po); if(!po.preserve_format && minus_count % 2 == 1) { nr.negate(); } mstruct->set(nr); if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } return true; } bool Calculator::parseAdd(string &str, MathStructure *mstruct, const ParseOptions &po) { if(str.length() > 0) { size_t i; if(po.base >= 2 && po.base <= 10) { i = str.find_first_of(SPACE MULTIPLICATION_2 OPERATORS PARENTHESISS EXPS ID_WRAP_LEFT, 1); } else { i = str.find_first_of(SPACE MULTIPLICATION_2 OPERATORS PARENTHESISS ID_WRAP_LEFT, 1); } if(i == string::npos && str[0] != LOGICAL_NOT_CH && str[0] != BITWISE_NOT_CH && !(str[0] == ID_WRAP_LEFT_CH && str.find(ID_WRAP_RIGHT) < str.length() - 1)) { return parseNumber(mstruct, str, po); } else { return parseOperators(mstruct, str, po); } } return false; } bool Calculator::parseAdd(string &str, MathStructure *mstruct, const ParseOptions &po, MathOperation s) { if(str.length() > 0) { size_t i; if(po.base >= 2 && po.base <= 10) { i = str.find_first_of(SPACE MULTIPLICATION_2 OPERATORS PARENTHESISS EXPS ID_WRAP_LEFT, 1); } else { i = str.find_first_of(SPACE MULTIPLICATION_2 OPERATORS PARENTHESISS ID_WRAP_LEFT, 1); } if(i == string::npos && str[0] != LOGICAL_NOT_CH && str[0] != BITWISE_NOT_CH && !(str[0] == ID_WRAP_LEFT_CH && str.find(ID_WRAP_RIGHT) < str.length() - 1)) { if(s == OPERATION_EXP10 && po.read_precision == ALWAYS_READ_PRECISION) { ParseOptions po2 = po; po2.read_precision = READ_PRECISION_WHEN_DECIMALS; MathStructure *mstruct2 = new MathStructure(); if(!parseNumber(mstruct2, str, po2)) { mstruct2->unref(); return false; } if(s == OPERATION_DIVIDE && po.preserve_format) { mstruct->transform_nocopy(STRUCT_DIVISION, mstruct2); } else if(s == OPERATION_SUBTRACT && po.preserve_format) { mstruct2->transform(STRUCT_NEGATE); mstruct->add_nocopy(mstruct2, OPERATION_ADD, true); } else { mstruct->add_nocopy(mstruct2, s, true); } } else { MathStructure *mstruct2 = new MathStructure(); if(!parseNumber(mstruct2, str, po)) { mstruct2->unref(); return false; } if(s == OPERATION_DIVIDE && po.preserve_format) { mstruct->transform_nocopy(STRUCT_DIVISION, mstruct2); } else if(s == OPERATION_SUBTRACT && po.preserve_format) { mstruct2->transform(STRUCT_NEGATE); mstruct->add_nocopy(mstruct2, OPERATION_ADD, true); } else { mstruct->add_nocopy(mstruct2, s, true); } } } else { MathStructure *mstruct2 = new MathStructure(); if(!parseOperators(mstruct2, str, po)) { mstruct2->unref(); return false; } if(s == OPERATION_DIVIDE && po.preserve_format) { mstruct->transform_nocopy(STRUCT_DIVISION, mstruct2); } else if(s == OPERATION_SUBTRACT && po.preserve_format) { mstruct2->transform(STRUCT_NEGATE); mstruct->add_nocopy(mstruct2, OPERATION_ADD, true); } else { mstruct->add_nocopy(mstruct2, s, true); } } } return true; } bool Calculator::parseOperators(MathStructure *mstruct, string str, const ParseOptions &po) { string save_str = str; mstruct->clear(); size_t i = 0, i2 = 0, i3 = 0; string str2, str3; while(true) { //find first right parenthesis and then the last left parenthesis before i2 = str.find(RIGHT_PARENTHESIS_CH); if(i2 == string::npos) { i = str.rfind(LEFT_PARENTHESIS_CH); if(i == string::npos) { //if no parenthesis break break; } else { //right parenthesis missing -- append str += RIGHT_PARENTHESIS_CH; i2 = str.length() - 1; } } else { if(i2 > 0) { i = str.rfind(LEFT_PARENTHESIS_CH, i2 - 1); } else { i = string::npos; } if(i == string::npos) { //left parenthesis missing -- prepend str.insert(str.begin(), 1, LEFT_PARENTHESIS_CH); i = 0; i2++; } } while(true) { //remove unnecessary double parenthesis and the found parenthesis if(i > 0 && i2 + 1 < str.length() && str[i - 1] == LEFT_PARENTHESIS_CH && str[i2 + 1] == RIGHT_PARENTHESIS_CH) { str.erase(str.begin() + (i - 1)); i--; i2--; str.erase(str.begin() + (i2 + 1)); } else { break; } } if(i > 0 && is_not_in(MULTIPLICATION_2 OPERATORS PARENTHESISS SPACE, str[i - 1]) && (po.base > 10 || po.base < 2 || (str[i - 1] != EXP_CH && str[i - 1] != EXP2_CH))) { if(po.rpn) { str.insert(i2 + 1, MULTIPLICATION); str.insert(i, SPACE); i++; i2++; } else { str.insert(i, MULTIPLICATION_2); i++; i2++; } } if(i2 + 1 < str.length() && is_not_in(MULTIPLICATION_2 OPERATORS PARENTHESISS SPACE, str[i2 + 1]) && (po.base > 10 || po.base < 2 || (str[i2 + 1] != EXP_CH && str[i2 + 1] != EXP2_CH))) { if(po.rpn) { i3 = str.find(SPACE, i2 + 1); if(i3 == string::npos) { str += MULTIPLICATION; } else { str.replace(i3, 1, MULTIPLICATION); } str.insert(i2 + 1, SPACE); } else { str.insert(i2 + 1, MULTIPLICATION_2); } } if(po.rpn && i > 0 && i2 + 1 == str.length() && is_not_in(PARENTHESISS SPACE, str[i - 1])) { str += MULTIPLICATION_CH; } str2 = str.substr(i + 1, i2 - (i + 1)); MathStructure *mstruct2 = new MathStructure(); if(str2.empty()) { CALCULATOR->error(false, "Empty expression in parentheses interpreted as zero.", NULL); } else { parseOperators(mstruct2, str2, po); } str2 = ID_WRAP_LEFT; str2 += i2s(addId(mstruct2)); str2 += ID_WRAP_RIGHT; str.replace(i, i2 - i + 1, str2); mstruct->clear(); } if((i = str.find(LOGICAL_AND, 1)) != string::npos && i + 2 != str.length()) { bool b = false; while(i != string::npos && i + 2 != str.length()) { str2 = str.substr(0, i); str = str.substr(i + 2, str.length() - (i + 2)); if(b) { parseAdd(str2, mstruct, po, OPERATION_LOGICAL_AND); } else { parseAdd(str2, mstruct, po); b = true; } i = str.find(LOGICAL_AND, 1); } if(b) { parseAdd(str, mstruct, po, OPERATION_LOGICAL_AND); } else { parseAdd(str, mstruct, po); } return true; } if((i = str.find(LOGICAL_OR, 1)) != string::npos && i + 2 != str.length()) { bool b = false; while(i != string::npos && i + 2 != str.length()) { str2 = str.substr(0, i); str = str.substr(i + 2, str.length() - (i + 2)); if(b) { parseAdd(str2, mstruct, po, OPERATION_LOGICAL_OR); } else { parseAdd(str2, mstruct, po); b = true; } i = str.find(LOGICAL_OR, 1); } if(b) { parseAdd(str, mstruct, po, OPERATION_LOGICAL_OR); } else { parseAdd(str, mstruct, po); } return true; } if(str[0] == LOGICAL_NOT_CH) { str.erase(str.begin()); parseAdd(str, mstruct, po); mstruct->setLogicalNot(); return true; } if((i = str.find_first_of(LESS GREATER EQUALS NOT, 0)) != string::npos) { while(i != string::npos && (str[i] == LESS_CH && i + 1 < str.length() && str[i + 1] == LESS_CH) || (str[i] == GREATER_CH && i + 1 < str.length() && str[i + 1] == GREATER_CH)) { i = str.find_first_of(LESS GREATER NOT EQUALS, i + 2); } } if(i != string::npos) { bool b = false; bool c = false; while(i != string::npos && str[i] == NOT_CH && str.length() > i + 1 && str[i + 1] == NOT_CH) { i++; if(i + 1 == str.length()) { c = true; } } MathOperation s = OPERATION_ADD; while(!c) { while(i != string::npos && (str[i] == LESS_CH && i + 1 < str.length() && str[i + 1] == LESS_CH) || (str[i] == GREATER_CH && i + 1 < str.length() && str[i + 1] == GREATER_CH)) { i = str.find_first_of(LESS GREATER NOT EQUALS, i + 2); while(i != string::npos && str[i] == NOT_CH && str.length() > i + 1 && str[i + 1] == NOT_CH) { i++; if(i + 1 == str.length()) { i = string::npos; } } } if(i == string::npos) { str2 = str.substr(0, str.length()); } else { str2 = str.substr(0, i); } if(b) { switch(i3) { case EQUALS_CH: {s = OPERATION_EQUALS; break;} case GREATER_CH: {s = OPERATION_GREATER; break;} case LESS_CH: {s = OPERATION_LESS; break;} case GREATER_CH * EQUALS_CH: {s = OPERATION_EQUALS_GREATER; break;} case LESS_CH * EQUALS_CH: {s = OPERATION_EQUALS_LESS; break;} case GREATER_CH * LESS_CH: {s = OPERATION_NOT_EQUALS; break;} } parseAdd(str2, mstruct, po, s); } if(i == string::npos) { return true; } if(!b) { parseAdd(str2, mstruct, po); b = true; } if(str.length() > i + 1 && is_in(LESS GREATER NOT EQUALS, str[i + 1])) { if(str[i] == str[i + 1]) { i3 = str[i]; } else { i3 = str[i] * str[i + 1]; if(i3 == NOT_CH * EQUALS_CH) { i3 = GREATER_CH * LESS_CH; } else if(i3 == NOT_CH * LESS_CH) { i3 = GREATER_CH; } else if(i3 == NOT_CH * GREATER_CH) { i3 = LESS_CH; } } i++; } else { i3 = str[i]; } str = str.substr(i + 1, str.length() - (i + 1)); i = str.find_first_of(LESS GREATER NOT EQUALS, 0); while(i != string::npos && str[i] == NOT_CH && str.length() > i + 1 && str[i + 1] == NOT_CH) { i++; if(i + 1 == str.length()) { i = string::npos; } } } } if((i = str.find(BITWISE_OR, 1)) != string::npos && i + 1 != str.length()) { bool b = false; while(i != string::npos && i + 1 != str.length()) { str2 = str.substr(0, i); str = str.substr(i + 1, str.length() - (i + 1)); if(b) { parseAdd(str2, mstruct, po, OPERATION_BITWISE_OR); } else { parseAdd(str2, mstruct, po); b = true; } i = str.find(BITWISE_OR, 1); } if(b) { parseAdd(str, mstruct, po, OPERATION_BITWISE_OR); } else { parseAdd(str, mstruct, po); } return true; } if((i = str.find(BITWISE_AND, 1)) != string::npos && i + 1 != str.length()) { bool b = false; while(i != string::npos && i + 1 != str.length()) { str2 = str.substr(0, i); str = str.substr(i + 1, str.length() - (i + 1)); if(b) { parseAdd(str2, mstruct, po, OPERATION_BITWISE_AND); } else { parseAdd(str2, mstruct, po); b = true; } i = str.find(BITWISE_AND, 1); } if(b) { parseAdd(str, mstruct, po, OPERATION_BITWISE_AND); } else { parseAdd(str, mstruct, po); } return true; } i = str.find(SHIFT_LEFT, 1); i2 = str.find(SHIFT_RIGHT, 1); if(i != string::npos && i + 2 != str.length() && (i2 == string::npos || i < i2)) { MathStructure mstruct1, mstruct2; str2 = str.substr(0, i); str = str.substr(i + 2, str.length() - (i + 2)); parseAdd(str2, &mstruct1, po); parseAdd(str, &mstruct2, po); mstruct->set(f_shift, &mstruct1, &mstruct2, NULL); return true; } i = i2; if(i != string::npos && i + 2 != str.length()) { MathStructure mstruct1, mstruct2; str2 = str.substr(0, i); str = str.substr(i + 2, str.length() - (i + 2)); parseAdd(str2, &mstruct1, po); parseAdd(str, &mstruct2, po); if(po.preserve_format) mstruct2.transform(STRUCT_NEGATE); else mstruct2.negate(); mstruct->set(f_shift, &mstruct1, &mstruct2, NULL); return true; } if(str[0] == BITWISE_NOT_CH) { str.erase(str.begin()); parseAdd(str, mstruct, po); mstruct->setBitwiseNot(); return true; } i = 0; i3 = 0; if(po.rpn) { ParseOptions po2 = po; po2.rpn = false; vector mstack; bool b = false; char last_operator = 0; while(true) { i = str.find_first_of(OPERATORS SPACE, i3 + 1); if(i == string::npos) { if(!b) { parseAdd(str, mstruct, po2); return true; } if(i3 != 0) { str2 = str.substr(i3 + 1, str.length() - i3 - 1); } else { str2 = str.substr(i3, str.length() - i3); } remove_blank_ends(str2); if(!str2.empty()) { error(false, _("RPN syntax error. Values left at the end of the RPN expression."), NULL); } else if(mstack.size() > 1) { if(last_operator == 0) { error(false, _("Unused stack values."), NULL); } else { while(mstack.size() > 1) { switch(last_operator) { case PLUS_CH: { mstack[mstack.size() - 2]->add_nocopy(mstack.back()); mstack.pop_back(); break; } case MINUS_CH: { if(po.preserve_format) { mstack.back()->transform(STRUCT_NEGATE); mstack[mstack.size() - 2]->add_nocopy(mstack.back()); } else { mstack[mstack.size() - 2]->subtract_nocopy(mstack.back()); } mstack.pop_back(); break; } case MULTIPLICATION_CH: { mstack[mstack.size() - 2]->multiply_nocopy(mstack.back()); mstack.pop_back(); break; } case DIVISION_CH: { if(po.preserve_format) { mstack[mstack.size() - 2]->transform_nocopy(STRUCT_DIVISION, mstack.back()); } else { mstack[mstack.size() - 2]->divide_nocopy(mstack.back()); } mstack.pop_back(); break; } case POWER_CH: { mstack[mstack.size() - 2]->raise_nocopy(mstack.back()); mstack.pop_back(); break; } default: { error(true, _("RPN syntax error. Operator '%c' not supported."), last_operator, NULL); mstack.pop_back(); break; } } } } } mstruct->set_nocopy(*mstack.back()); while(!mstack.empty()) { mstack.back()->unref(); mstack.pop_back(); } return true; } b = true; if(i3 != 0) { str2 = str.substr(i3 + 1, i - i3 - 1); } else { str2 = str.substr(i3, i - i3); } remove_blank_ends(str2); if(!str2.empty()) { mstack.push_back(new MathStructure()); parseAdd(str2, mstack.back(), po2); } if(str[i] != SPACE_CH) { if(mstack.size() < 1) { error(true, _("RPN syntax error. Stack is empty."), NULL); } else if(mstack.size() < 2) { error(false, _("RPN syntax error. Operator ignored as there where only one stack value."), NULL); } else { switch(str[i]) { case PLUS_CH: { mstack[mstack.size() - 2]->add_nocopy(mstack.back()); mstack.pop_back(); break; } case MINUS_CH: { if(po.preserve_format) { mstack.back()->transform(STRUCT_NEGATE); mstack[mstack.size() - 2]->add_nocopy(mstack.back()); } else { mstack[mstack.size() - 2]->subtract_nocopy(mstack.back()); } mstack.pop_back(); break; } case MULTIPLICATION_CH: { mstack[mstack.size() - 2]->multiply_nocopy(mstack.back()); mstack.pop_back(); break; } case DIVISION_CH: { if(po.preserve_format) { mstack[mstack.size() - 2]->transform_nocopy(STRUCT_DIVISION, mstack.back()); } else { mstack[mstack.size() - 2]->divide_nocopy(mstack.back()); } mstack.pop_back(); break; } case POWER_CH: { mstack[mstack.size() - 2]->raise_nocopy(mstack.back()); mstack.pop_back(); break; } default: { error(true, _("RPN syntax error. Operator '%c' not supported."), str[i], NULL); mstack.pop_back(); break; } } last_operator = str[i]; } } i3 = i; } } if((i = str.find_first_of(PLUS MINUS, 1)) != string::npos && i + 1 != str.length()) { bool b = false, c = false; bool min = false; while(i != string::npos && i + 1 != str.length()) { if(is_not_in(MULTIPLICATION_2 OPERATORS EXPS, str[i - 1])) { str2 = str.substr(0, i); if(!c && b) { if(min) { parseAdd(str2, mstruct, po, OPERATION_SUBTRACT); } else { parseAdd(str2, mstruct, po, OPERATION_ADD); } } else { if(!b && str2.empty()) { c = true; } else { parseAdd(str2, mstruct, po); if(c && min) { if(po.preserve_format) mstruct->transform(STRUCT_NEGATE); else mstruct->negate(); } c = false; } b = true; } min = str[i] == MINUS_CH; str = str.substr(i + 1, str.length() - (i + 1)); i = str.find_first_of(PLUS MINUS, 1); } else { i = str.find_first_of(PLUS MINUS, i + 1); } } if(b) { if(c) { b = parseAdd(str, mstruct, po); if(min) { if(po.preserve_format) mstruct->transform(STRUCT_NEGATE); else mstruct->negate(); } return b; } else { if(min) { parseAdd(str, mstruct, po, OPERATION_SUBTRACT); } else { parseAdd(str, mstruct, po, OPERATION_ADD); } } return true; } } if((i = str.find_first_of(MULTIPLICATION DIVISION, 0)) != string::npos && i + 1 != str.length()) { bool b = false; bool div = false; while(i != string::npos && i + 1 != str.length()) { if(i < 1) { if(i < 1 && str.find_first_not_of(MULTIPLICATION_2 OPERATORS EXPS) == string::npos) { if(disable_errors_ref > 0) { stopped_messages_count[disable_errors_ref - 1]++; stopped_warnings_count[disable_errors_ref - 1]++; } else { error(false, _("Misplaced operator(s) \"%s\" ignored"), str.c_str(), NULL); } return b; } i = 1; while(i < str.length() && is_in(MULTIPLICATION DIVISION, str[i])) { i++; } if(disable_errors_ref > 0) { stopped_messages_count[disable_errors_ref - 1]++; stopped_warnings_count[disable_errors_ref - 1]++; } else { error(false, _("Misplaced operator(s) \"%s\" ignored"), str.substr(0, i).c_str(), NULL); } str = str.substr(i, str.length() - i); i = str.find_first_of(MULTIPLICATION DIVISION, 0); } else { str2 = str.substr(0, i); if(b) { if(div) { parseAdd(str2, mstruct, po, OPERATION_DIVIDE); } else { parseAdd(str2, mstruct, po, OPERATION_MULTIPLY); } } else { parseAdd(str2, mstruct, po); b = true; } if(is_in(MULTIPLICATION DIVISION, str[i + 1])) { i2 = 1; while(i2 + i + 1 != str.length() && is_in(MULTIPLICATION DIVISION, str[i2 + i + 1])) { i2++; } if(disable_errors_ref > 0) { stopped_messages_count[disable_errors_ref - 1]++; stopped_warnings_count[disable_errors_ref - 1]++; } else { error(false, _("Misplaced operator(s) \"%s\" ignored"), str.substr(i, i2).c_str(), NULL); } i += i2; } div = str[i] == DIVISION_CH; str = str.substr(i + 1, str.length() - (i + 1)); i = str.find_first_of(MULTIPLICATION DIVISION, 0); } } if(b) { if(div) { parseAdd(str, mstruct, po, OPERATION_DIVIDE); } else { parseAdd(str, mstruct, po, OPERATION_MULTIPLY); } return true; } } if(str.empty()) return false; if(str.find_first_not_of(OPERATORS SPACE) == string::npos) { if(disable_errors_ref > 0) { stopped_messages_count[disable_errors_ref - 1]++; stopped_warnings_count[disable_errors_ref - 1]++; } else { error(false, _("Misplaced operator(s) \"%s\" ignored"), str.c_str(), NULL); } return false; } i = 0; bool ret = true; bool has_sign = false; int minus_count = 0; while(i < str.length()) { if(str[i] == MINUS_CH) { has_sign = true; minus_count++; str.erase(i, 1); } else if(str[i] == PLUS_CH) { has_sign = true; str.erase(i, 1); } else if(str[i] == SPACE_CH) { str.erase(i, 1); } else if(is_in(OPERATORS, str[i])) { if(disable_errors_ref > 0) { stopped_messages_count[disable_errors_ref - 1]++; stopped_warnings_count[disable_errors_ref - 1]++; } else { error(false, _("Misplaced '%c' ignored"), str[i], NULL); } str.erase(i, 1); } else { break; } } if(str.empty()) { if(minus_count % 2 == 1 && !po.preserve_format) { mstruct->set(-1, 1); } else if(has_sign) { mstruct->set(1, 1); if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } } return false; } if((i = str.find(MULTIPLICATION_2_CH, 1)) != string::npos && i + 1 != str.length()) { bool b = false; while(i != string::npos && i + 1 != str.length()) { str2 = str.substr(0, i); str = str.substr(i + 1, str.length() - (i + 1)); if(b) { parseAdd(str2, mstruct, po, OPERATION_MULTIPLY); } else { parseAdd(str2, mstruct, po); b = true; } i = str.find(MULTIPLICATION_2_CH, 1); } if(b) { parseAdd(str, mstruct, po, OPERATION_MULTIPLY); if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } else if(minus_count % 2 == 1) { mstruct->negate(); } return true; } } if((i = str.find(POWER_CH, 1)) != string::npos && i + 1 != str.length()) { str2 = str.substr(0, i); str = str.substr(i + 1, str.length() - (i + 1)); parseAdd(str2, mstruct, po); parseAdd(str, mstruct, po, OPERATION_RAISE); } else if(po.base >= 2 && po.base <= 10 && (i = str.find_first_of(EXPS, 1)) != string::npos && i + 1 != str.length()) { str2 = str.substr(0, i); str = str.substr(i + 1, str.length() - (i + 1)); parseAdd(str2, mstruct, po); parseAdd(str, mstruct, po, OPERATION_EXP10); } else if((i = str.find(ID_WRAP_LEFT_CH, 1)) != string::npos && i + 1 != str.length() && str.find(ID_WRAP_RIGHT_CH, i + 1) && str.find_first_not_of(PLUS MINUS, 0) != i) { str2 = str.substr(0, i); str = str.substr(i, str.length() - i); parseAdd(str2, mstruct, po); parseAdd(str, mstruct, po, OPERATION_MULTIPLY); } else if(str.length() > 0 && str[0] == ID_WRAP_LEFT_CH && (i = str.find(ID_WRAP_RIGHT_CH, 1)) != string::npos && i + 1 != str.length()) { str2 = str.substr(0, i + 1); str = str.substr(i + 1, str.length() - (i + 1)); parseAdd(str2, mstruct, po); parseAdd(str, mstruct, po, OPERATION_MULTIPLY); } else { ret = parseNumber(mstruct, str, po); } if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } else if(minus_count % 2 == 1) { mstruct->negate(); } return ret; } string Calculator::getName(string name, ExpressionItem *object, bool force, bool always_append) { ExpressionItem *item = NULL; if(!object) { } else if(object->type() == TYPE_FUNCTION) { item = getActiveFunction(name); } else { item = getActiveVariable(name); if(!item) { item = getActiveUnit(name); } if(!item) { item = getCompositeUnit(name); } } if(item && force && !name.empty() && item != object && object) { if(!item->isLocal()) { bool b = item->hasChanged(); if(object->isActive()) { item->setActive(false); } if(!object->isLocal()) { item->setChanged(b); } } else { if(object->isActive()) { item->destroy(); } } return name; } int i2 = 1; bool changed = false; if(name.empty()) { name = "var"; always_append = true; item = NULL; changed = true; } string stmp = name; if(always_append) { stmp += NAME_NUMBER_PRE_STR; stmp += "1"; } if(changed || (item && item != object)) { if(item) { i2++; stmp = name; stmp += NAME_NUMBER_PRE_STR; stmp += i2s(i2); } while(true) { if(!object) { item = getActiveFunction(stmp); if(!item) { item = getActiveVariable(stmp); } if(!item) { item = getActiveUnit(stmp); } if(!item) { item = getCompositeUnit(stmp); } } else if(object->type() == TYPE_FUNCTION) { item = getActiveFunction(stmp); } else { item = getActiveVariable(stmp); if(!item) { item = getActiveUnit(stmp); } if(!item) { item = getCompositeUnit(stmp); } } if(item && item != object) { i2++; stmp = name; stmp += NAME_NUMBER_PRE_STR; stmp += i2s(i2); } else { break; } } } if(i2 > 1 && !always_append) { error(false, _("Name \"%s\" is in use. Replacing with \"%s\"."), name.c_str(), stmp.c_str(), NULL); } return stmp; } bool Calculator::loadGlobalDefinitions() { string dir = PACKAGE_DATA_DIR; string filename; dir += "/qalculate/"; filename = dir; filename += "prefixes.xml"; bool b = true; if(!loadDefinitions(filename.c_str(), false)) { b = false; } filename = dir; filename += "currencies.xml"; if(!loadDefinitions(filename.c_str(), false)) { b = false; } filename = dir; filename += "units.xml"; if(!loadDefinitions(filename.c_str(), false)) { b = false; } filename = dir; filename += "functions.xml"; if(!loadDefinitions(filename.c_str(), false)) { b = false; } filename = dir; filename += "datasets.xml"; if(!loadDefinitions(filename.c_str(), false)) { b = false; } filename = dir; filename += "variables.xml"; if(!loadDefinitions(filename.c_str(), false)) { b = false; } return b; } bool Calculator::loadGlobalDefinitions(string filename) { string dir = PACKAGE_DATA_DIR; dir += "/qalculate/"; dir += filename; return loadDefinitions(dir.c_str(), false); } bool Calculator::loadGlobalPrefixes() { return loadGlobalDefinitions("prefixes.xml"); } bool Calculator::loadGlobalCurrencies() { return loadGlobalDefinitions("currencies.xml"); } bool Calculator::loadGlobalUnits() { bool b = loadGlobalDefinitions("currencies.xml"); return loadGlobalDefinitions("units.xml") && b; } bool Calculator::loadGlobalVariables() { return loadGlobalDefinitions("variables.xml"); } bool Calculator::loadGlobalFunctions() { return loadGlobalDefinitions("functions.xml"); } bool Calculator::loadGlobalDataSets() { return loadGlobalDefinitions("datasets.xml"); } bool Calculator::loadLocalDefinitions() { string filename; string homedir = getLocalDir(); homedir += "definitions/"; list eps; struct dirent *ep; DIR *dp; dp = opendir(homedir.c_str()); if(dp) { while((ep = readdir(dp))) { #ifdef _DIRENT_HAVE_D_TYPE if(ep->d_type != DT_DIR) { #endif if(strcmp(ep->d_name, "..") != 0 && strcmp(ep->d_name, ".") != 0 && strcmp(ep->d_name, "datasets") != 0) { eps.push_back(ep->d_name); } #ifdef _DIRENT_HAVE_D_TYPE } #endif } closedir(dp); } eps.sort(); for(list::iterator it = eps.begin(); it != eps.end(); ++it) { filename = homedir; filename += *it; loadDefinitions(filename.c_str(), true); } return true; } #define ITEM_SAVE_BUILTIN_NAMES\ if(!is_user_defs) {item->setRegistered(false);} \ for(size_t i = 1; i <= item->countNames(); i++) { \ if(item->getName(i).reference) { \ for(size_t i2 = 0; i2 < 10; i2++) { \ if(ref_names[i2].name.empty()) { \ ref_names[i2] = item->getName(i); \ break; \ } \ } \ } \ } \ item->clearNames(); #define ITEM_SET_BEST_NAMES(validation) \ size_t names_i = 0, i2 = 0; \ string *str_names; \ if(best_names == "-") {best_names = ""; nextbest_names = "";} \ if(!best_names.empty()) {str_names = &best_names;} \ else if(!nextbest_names.empty()) {str_names = &nextbest_names;} \ else {str_names = &default_names;} \ if(!str_names->empty() && (*str_names)[0] == '!') { \ names_i = str_names->find('!', 1) + 1; \ } \ while(true) { \ size_t i3 = names_i; \ names_i = str_names->find(",", i3); \ if(i2 == 0) { \ i2 = str_names->find(":", i3); \ } \ bool case_set = false; \ ename.unicode = false; \ ename.abbreviation = false; \ ename.case_sensitive = false; \ ename.suffix = false; \ ename.avoid_input = false; \ ename.reference = false; \ ename.plural = false; \ if(i2 < names_i) { \ bool b = true; \ for(; i3 < i2; i3++) { \ switch((*str_names)[i3]) { \ case '-': {b = false; break;} \ case 'a': {ename.abbreviation = b; b = true; break;} \ case 'c': {ename.case_sensitive = b; b = true; case_set = true; break;} \ case 'i': {ename.avoid_input = b; b = true; break;} \ case 'p': {ename.plural = b; b = true; break;} \ case 'r': {ename.reference = b; b = true; break;} \ case 's': {ename.suffix = b; b = true; break;} \ case 'u': {ename.unicode = b; b = true; break;} \ } \ } \ i3++; \ i2 = 0; \ } \ if(names_i == string::npos) {ename.name = str_names->substr(i3, str_names->length() - i3);} \ else {ename.name = str_names->substr(i3, names_i - i3);} \ remove_blank_ends(ename.name); \ if(!ename.name.empty() && validation(ename.name, version_numbers, is_user_defs)) { \ if(!case_set) { \ ename.case_sensitive = ename.abbreviation || text_length_is_one(ename.name); \ } \ item->addName(ename); \ } \ if(names_i == string::npos) {break;} \ names_i++; \ } #define ITEM_SET_BUILTIN_NAMES \ for(size_t i = 0; i < 10; i++) { \ if(ref_names[i].name.empty()) { \ break; \ } else { \ size_t i4 = item->hasName(ref_names[i].name, ref_names[i].case_sensitive); \ if(i4 > 0) { \ const ExpressionName *enameptr = &item->getName(i4); \ ref_names[i].case_sensitive = enameptr->case_sensitive; \ ref_names[i].abbreviation = enameptr->abbreviation; \ ref_names[i].avoid_input = enameptr->avoid_input; \ ref_names[i].plural = enameptr->plural; \ item->setName(ref_names[i], i4); \ } else { \ item->addName(ref_names[i]); \ } \ ref_names[i].name = ""; \ } \ } \ if(!is_user_defs) { \ item->setRegistered(true); \ nameChanged(item); \ } #define ITEM_SET_REFERENCE_NAMES(validation) \ if(str_names != &default_names && !default_names.empty()) { \ if(default_names[0] == '!') { \ names_i = default_names.find('!', 1) + 1; \ } else { \ names_i = 0; \ } \ i2 = 0; \ while(true) { \ size_t i3 = names_i; \ names_i = default_names.find(",", i3); \ if(i2 == 0) { \ i2 = default_names.find(":", i3); \ } \ bool case_set = false; \ ename.unicode = false; \ ename.abbreviation = false; \ ename.case_sensitive = false; \ ename.suffix = false; \ ename.avoid_input = false; \ ename.reference = false; \ ename.plural = false; \ if(i2 < names_i) { \ bool b = true; \ for(; i3 < i2; i3++) { \ switch(default_names[i3]) { \ case '-': {b = false; break;} \ case 'a': {ename.abbreviation = b; b = true; break;} \ case 'c': {ename.case_sensitive = b; b = true; case_set = true; break;} \ case 'i': {ename.avoid_input = b; b = true; break;} \ case 'p': {ename.plural = b; b = true; break;} \ case 'r': {ename.reference = b; b = true; break;} \ case 's': {ename.suffix = b; b = true; break;} \ case 'u': {ename.unicode = b; b = true; break;} \ } \ } \ i3++; \ i2 = 0; \ } \ if(ename.reference) { \ if(names_i == string::npos) {ename.name = default_names.substr(i3, default_names.length() - i3);} \ else {ename.name = default_names.substr(i3, names_i - i3);} \ remove_blank_ends(ename.name); \ size_t i4 = item->hasName(ename.name, ename.case_sensitive); \ if(i4 > 0) { \ const ExpressionName *enameptr = &item->getName(i4); \ ename.suffix = enameptr->suffix; \ ename.abbreviation = enameptr->abbreviation; \ ename.avoid_input = enameptr->avoid_input; \ ename.plural = enameptr->plural; \ item->setName(ename, i4); \ } else if(!ename.name.empty() && validation(ename.name, version_numbers, is_user_defs)) { \ if(!case_set) { \ ename.case_sensitive = ename.abbreviation || text_length_is_one(ename.name); \ } \ item->addName(ename); \ } \ } \ if(names_i == string::npos) {break;} \ names_i++; \ } \ } #define ITEM_READ_NAME(validation)\ if(!new_names && (!xmlStrcmp(child->name, (const xmlChar*) "name") || !xmlStrcmp(child->name, (const xmlChar*) "abbreviation") || !xmlStrcmp(child->name, (const xmlChar*) "plural"))) {\ name_index = 1;\ XML_GET_INT_FROM_PROP(child, "index", name_index)\ if(name_index > 0 && name_index <= 10) {\ name_index--;\ names[name_index] = empty_expression_name;\ ref_names[name_index] = empty_expression_name;\ value2 = NULL;\ bool case_set = false;\ if(child->name[0] == 'a') {\ names[name_index].abbreviation = true;\ ref_names[name_index].abbreviation = true;\ } else if(child->name[0] == 'p') {\ names[name_index].plural = true;\ ref_names[name_index].plural = true;\ }\ child2 = child->xmlChildrenNode;\ while(child2 != NULL) {\ if((!best_name[name_index] || (ref_names[name_index].name.empty() && !locale.empty())) && !xmlStrcmp(child2->name, (const xmlChar*) "name")) {\ lang = xmlNodeGetLang(child2);\ if(!lang) {\ value2 = xmlNodeListGetString(doc, child2->xmlChildrenNode, 1);\ if(!value2 || validation((char*) value2, version_numbers, is_user_defs)) {\ if(locale.empty()) {\ best_name[name_index] = true;\ if(value2) names[name_index].name = (char*) value2;\ else names[name_index].name = "";\ } else if(!require_translation) {\ if(!best_name[name_index] && !nextbest_name[name_index]) {\ if(value2) names[name_index].name = (char*) value2;\ else names[name_index].name = "";\ }\ if(value2) ref_names[name_index].name = (char*) value2;\ else ref_names[name_index].name = "";\ }\ }\ } else if(!best_name[name_index] && !locale.empty()) {\ if(locale == (char*) lang) {\ value2 = xmlNodeListGetString(doc, child2->xmlChildrenNode, 1);\ if(!value2 || validation((char*) value2, version_numbers, is_user_defs)) {\ best_name[name_index] = true;\ if(value2) names[name_index].name = (char*) value2;\ else names[name_index].name = "";\ }\ } else if(!nextbest_name[name_index] && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {\ value2 = xmlNodeListGetString(doc, child2->xmlChildrenNode, 1);\ if(!value2 || validation((char*) value2, version_numbers, is_user_defs)) {\ nextbest_name[name_index] = true; \ if(value2) names[name_index].name = (char*) value2;\ else names[name_index].name = "";\ }\ }\ }\ if(value2) xmlFree(value2);\ if(lang) xmlFree(lang);\ value2 = NULL; lang = NULL;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "unicode")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].unicode)\ ref_names[name_index].unicode = names[name_index].unicode;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "reference")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].reference)\ ref_names[name_index].reference = names[name_index].reference;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "suffix")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].suffix)\ ref_names[name_index].suffix = names[name_index].suffix;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "avoid_input")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].avoid_input)\ ref_names[name_index].avoid_input = names[name_index].avoid_input;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "plural")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].plural)\ ref_names[name_index].plural = names[name_index].plural;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "abbreviation")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].abbreviation)\ ref_names[name_index].abbreviation = names[name_index].abbreviation;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "case_sensitive")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].case_sensitive)\ ref_names[name_index].case_sensitive = names[name_index].case_sensitive;\ case_set = true;\ }\ child2 = child2->next;\ }\ if(!case_set) {\ ref_names[name_index].case_sensitive = ref_names[name_index].abbreviation || text_length_is_one(ref_names[name_index].name);\ names[name_index].case_sensitive = names[name_index].abbreviation || text_length_is_one(names[name_index].name);\ }\ if(names[name_index].reference) {\ if(!ref_names[name_index].name.empty()) {\ if(ref_names[name_index].name == names[name_index].name) {\ ref_names[name_index].name = "";\ } else {\ names[name_index].reference = false;\ }\ }\ } else if(!ref_names[name_index].name.empty()) {\ ref_names[name_index].name = "";\ }\ }\ } #define ITEM_READ_DTH \ if(!xmlStrcmp(child->name, (const xmlChar*) "description")) {\ XML_GET_LOCALE_STRING_FROM_TEXT(child, description, best_description, next_best_description)\ } else if(!xmlStrcmp(child->name, (const xmlChar*) "title")) {\ XML_GET_LOCALE_STRING_FROM_TEXT_REQ(child, title, best_title, next_best_title)\ } else if(!xmlStrcmp(child->name, (const xmlChar*) "hidden")) {\ XML_GET_TRUE_FROM_TEXT(child, hidden);\ } #define ITEM_READ_NAMES \ if(new_names && ((best_names.empty() && fulfilled_translation != 2) || default_names.empty()) && !xmlStrcmp(child->name, (const xmlChar*) "names")) {\ value = xmlNodeListGetString(doc, child->xmlChildrenNode, 1);\ lang = xmlNodeGetLang(child);\ if(!lang) {\ if(default_names.empty()) {\ if(value) {\ default_names = (char*) value;\ remove_blank_ends(default_names);\ } else {\ default_names = "";\ }\ }\ } else if(best_names.empty()) {\ if(locale == (char*) lang) {\ if(value) {\ best_names = (char*) value;\ remove_blank_ends(best_names);\ } else {\ best_names = " ";\ }\ } else if(nextbest_names.empty() && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {\ if(value) {\ nextbest_names = (char*) value;\ remove_blank_ends(nextbest_names);\ } else {\ nextbest_names = " ";\ }\ } else if(nextbest_names.empty() && default_names.empty() && value && !require_translation) {\ nextbest_names = (char*) value;\ remove_blank_ends(nextbest_names);\ }\ }\ if(value) xmlFree(value);\ if(lang) xmlFree(lang);\ } #define ITEM_INIT_DTH \ hidden = false;\ title = ""; best_title = false; next_best_title = false;\ description = ""; best_description = false; next_best_description = false;\ if(fulfilled_translation > 0) require_translation = false; \ else {XML_GET_TRUE_FROM_PROP(cur, "require_translation", require_translation)} #define ITEM_INIT_NAME \ if(new_names) {\ best_names = "";\ nextbest_names = "";\ default_names = "";\ } else {\ for(size_t i = 0; i < 10; i++) {\ best_name[i] = false;\ nextbest_name[i] = false;\ }\ } #define ITEM_SET_NAME_1(validation)\ if(!name.empty() && validation(name, version_numbers, is_user_defs)) {\ ename.name = name;\ ename.unicode = false;\ ename.abbreviation = false;\ ename.case_sensitive = text_length_is_one(ename.name);\ ename.suffix = false;\ ename.avoid_input = false;\ ename.reference = true;\ ename.plural = false;\ item->addName(ename);\ } #define ITEM_SET_NAME_2\ for(size_t i = 0; i < 10; i++) {\ if(!names[i].name.empty()) {\ item->addName(names[i], i + 1);\ names[i].name = "";\ } else if(!ref_names[i].name.empty()) {\ item->addName(ref_names[i], i + 1);\ ref_names[i].name = "";\ }\ } #define ITEM_SET_NAME_3\ for(size_t i = 0; i < 10; i++) {\ if(!ref_names[i].name.empty()) {\ item->addName(ref_names[i]);\ ref_names[i].name = "";\ }\ } #define ITEM_SET_DTH\ item->setDescription(description);\ if(!title.empty() && title[0] == '!') {\ size_t i = title.find('!', 1);\ if(i == string::npos) {\ item->setTitle(title);\ } else if(i + 1 == title.length()) {\ item->setTitle("");\ } else {\ item->setTitle(title.substr(i + 1, title.length() - (i + 1)));\ }\ } else {\ item->setTitle(title);\ }\ item->setHidden(hidden); #define ITEM_SET_SHORT_NAME\ if(!name.empty() && unitNameIsValid(name, version_numbers, is_user_defs)) {\ ename.name = name;\ ename.unicode = false;\ ename.abbreviation = true;\ ename.case_sensitive = true;\ ename.suffix = false;\ ename.avoid_input = false;\ ename.reference = true;\ ename.plural = false;\ item->addName(ename);\ } #define ITEM_SET_SINGULAR\ if(!singular.empty()) {\ ename.name = singular;\ ename.unicode = false;\ ename.abbreviation = false;\ ename.case_sensitive = text_length_is_one(ename.name);\ ename.suffix = false;\ ename.avoid_input = false;\ ename.reference = false;\ ename.plural = false;\ item->addName(ename);\ } #define ITEM_SET_PLURAL\ if(!plural.empty()) {\ ename.name = plural;\ ename.unicode = false;\ ename.abbreviation = false;\ ename.case_sensitive = text_length_is_one(ename.name);\ ename.suffix = false;\ ename.avoid_input = false;\ ename.reference = false;\ ename.plural = true;\ item->addName(ename);\ } #define BUILTIN_NAMES_1\ if(!is_user_defs) item->setRegistered(false);\ bool has_ref_name;\ for(size_t i = 1; i <= item->countNames(); i++) {\ if(item->getName(i).reference) {\ has_ref_name = false;\ for(size_t i2 = 0; i2 < 10; i2++) {\ if(names[i2].name == item->getName(i).name || ref_names[i2].name == item->getName(i).name) {\ has_ref_name = true;\ break;\ }\ }\ if(!has_ref_name) {\ for(int i2 = 9; i2 >= 0; i2--) {\ if(ref_names[i2].name.empty()) {\ ref_names[i2] = item->getName(i);\ break;\ }\ }\ }\ }\ }\ item->clearNames(); #define BUILTIN_UNIT_NAMES_1\ if(!is_user_defs) item->setRegistered(false);\ bool has_ref_name;\ for(size_t i = 1; i <= item->countNames(); i++) {\ if(item->getName(i).reference) {\ has_ref_name = item->getName(i).name == singular || item->getName(i).name == plural;\ for(size_t i2 = 0; !has_ref_name && i2 < 10; i2++) {\ if(names[i2].name == item->getName(i).name || ref_names[i2].name == item->getName(i).name) {\ has_ref_name = true;\ break;\ }\ }\ if(!has_ref_name) {\ for(int i2 = 9; i2 >= 0; i2--) {\ if(ref_names[i2].name.empty()) {\ ref_names[i2] = item->getName(i);\ break;\ }\ }\ }\ }\ }\ item->clearNames(); #define BUILTIN_NAMES_2\ if(!is_user_defs) {\ item->setRegistered(true);\ nameChanged(item);\ } #define ITEM_CLEAR_NAMES\ for(size_t i = 0; i < 10; i++) {\ if(!names[i].name.empty()) {\ names[i].name = "";\ }\ if(!ref_names[i].name.empty()) {\ ref_names[i].name = "";\ }\ } int Calculator::loadDefinitions(const char* file_name, bool is_user_defs) { xmlDocPtr doc; xmlNodePtr cur, child, child2, child3; string version, stmp, name, uname, type, svalue, sexp, plural, singular, category_title, category, description, title, inverse, base, argname, usystem; bool best_title, next_best_title, best_category_title, next_best_category_title, best_description, next_best_description; bool best_plural, next_best_plural, best_singular, next_best_singular, best_argname, next_best_argname; bool best_proptitle, next_best_proptitle, best_propdescr, next_best_propdescr; string proptitle, propdescr; ExpressionName names[10]; ExpressionName ref_names[10]; string prop_names[10]; string ref_prop_names[10]; bool best_name[10]; bool nextbest_name[10]; string best_names, nextbest_names, default_names; string best_prop_names, nextbest_prop_names, default_prop_names; int name_index, prec; ExpressionName ename; string locale; char *clocale = setlocale(LC_MESSAGES, ""); if(clocale) { locale = clocale; if(locale == "POSIX" || locale == "C") { locale = ""; } else { size_t i = locale.find('.'); if(i != string::npos) locale = locale.substr(0, i); } } int fulfilled_translation = 0; string localebase; if(locale.length() > 2) { localebase = locale.substr(0, 2); if(locale == "en_US") { fulfilled_translation = 2; } else if(localebase == "en") { fulfilled_translation = 1; } } else { localebase = locale; if(locale == "en") { fulfilled_translation = 2; } } while(localebase.length() < 2) { localebase += " "; fulfilled_translation = 2; } int exponent = 1, litmp = 0; bool active = false, hidden = false, b = false, require_translation = false; Number nr; ExpressionItem *item; MathFunction *f; Variable *v; Unit *u; AliasUnit *au; CompositeUnit *cu; Prefix *p; Argument *arg; DataSet *dc; DataProperty *dp; int itmp; IntegerArgument *iarg; NumberArgument *farg; xmlChar *value, *lang, *value2; int in_unfinished = 0; bool done_something = false; doc = xmlParseFile(file_name); if(doc == NULL) { return false; } cur = xmlDocGetRootElement(doc); if(cur == NULL) { xmlFreeDoc(doc); return false; } while(cur != NULL) { if(!xmlStrcmp(cur->name, (const xmlChar*) "QALCULATE")) { XML_GET_STRING_FROM_PROP(cur, "version", version) break; } cur = cur->next; } if(cur == NULL) { error(true, _("File not identified as Qalculate! definitions file: %s."), file_name, NULL); xmlFreeDoc(doc); return false; } int version_numbers[] = {0, 9, 6}; parse_qalculate_version(version, version_numbers); bool new_names = version_numbers[0] > 0 || version_numbers[1] > 9 || (version_numbers[1] == 9 && version_numbers[2] >= 4); ParseOptions po; vector unfinished_nodes; vector unfinished_cats; queue sub_items; vector > nodes; category = ""; nodes.resize(1); while(true) { if(!in_unfinished) { category_title = ""; best_category_title = false; next_best_category_title = false; child = cur->xmlChildrenNode; while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, category_title, best_category_title, next_best_category_title) } else if(!xmlStrcmp(child->name, (const xmlChar*) "category")) { nodes.back().push(child); } else { sub_items.push(child); } child = child->next; } if(!category.empty()) { category += "/"; } if(!category_title.empty() && category_title[0] == '!') {\ size_t i = category_title.find('!', 1); if(i == string::npos) { category += category_title; } else if(i + 1 < category_title.length()) { category += category_title.substr(i + 1, category_title.length() - (i + 1)); } } else { category += category_title; } } while(!sub_items.empty() || (in_unfinished && cur)) { if(!in_unfinished) { cur = sub_items.front(); sub_items.pop(); } if(!xmlStrcmp(cur->name, (const xmlChar*) "activate")) { XML_GET_STRING_FROM_TEXT(cur, name) ExpressionItem *item = getInactiveExpressionItem(name); if(item && !item->isLocal()) { item->setActive(true); done_something = true; } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "deactivate")) { XML_GET_STRING_FROM_TEXT(cur, name) ExpressionItem *item = getActiveExpressionItem(name); if(item && !item->isLocal()) { item->setActive(false); done_something = true; } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "function")) { if(VERSION_BEFORE(0, 6, 3)) { XML_GET_STRING_FROM_PROP(cur, "name", name) } else { name = ""; } XML_GET_FALSE_FROM_PROP(cur, "active", active) f = new UserFunction(category, "", "", is_user_defs, 0, "", "", 0, active); item = f; done_something = true; child = cur->xmlChildrenNode; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "expression")) { XML_DO_FROM_TEXT(child, ((UserFunction*) f)->setFormula); XML_GET_PREC_FROM_PROP(child, prec) f->setPrecision(prec); XML_GET_APPROX_FROM_PROP(child, b) f->setApproximate(b); } else if(!xmlStrcmp(child->name, (const xmlChar*) "condition")) { XML_DO_FROM_TEXT(child, f->setCondition); } else if(!xmlStrcmp(child->name, (const xmlChar*) "subfunction")) { XML_GET_FALSE_FROM_PROP(child, "precalculate", b); value = xmlNodeListGetString(doc, child->xmlChildrenNode, 1); if(value) ((UserFunction*) f)->addSubfunction((char*) value, b); else ((UserFunction*) f)->addSubfunction("", true); if(value) xmlFree(value); } else if(!xmlStrcmp(child->name, (const xmlChar*) "argument")) { farg = NULL; iarg = NULL; XML_GET_STRING_FROM_PROP(child, "type", type); if(type == "text") { arg = new TextArgument(); } else if(type == "symbol") { arg = new SymbolicArgument(); } else if(type == "date") { arg = new DateArgument(); } else if(type == "integer") { iarg = new IntegerArgument(); arg = iarg; } else if(type == "number") { farg = new NumberArgument(); arg = farg; } else if(type == "vector") { arg = new VectorArgument(); } else if(type == "matrix") { arg = new MatrixArgument(); } else if(type == "boolean") { arg = new BooleanArgument(); } else if(type == "function") { arg = new FunctionArgument(); } else if(type == "unit") { arg = new UnitArgument(); } else if(type == "variable") { arg = new VariableArgument(); } else if(type == "object") { arg = new ExpressionItemArgument(); } else if(type == "angle") { arg = new AngleArgument(); } else if(type == "data-object") { arg = new DataObjectArgument(NULL, ""); } else if(type == "data-property") { arg = new DataPropertyArgument(NULL, ""); } else { arg = new Argument(); } child2 = child->xmlChildrenNode; argname = ""; best_argname = false; next_best_argname = false; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, argname, best_argname, next_best_argname) } else if(!xmlStrcmp(child2->name, (const xmlChar*) "min")) { if(farg) { XML_DO_FROM_TEXT(child2, nr.set); farg->setMin(&nr); XML_GET_FALSE_FROM_PROP(child, "include_equals", b) farg->setIncludeEqualsMin(b); } else if(iarg) { XML_GET_STRING_FROM_TEXT(child2, stmp); Number integ(stmp); iarg->setMin(&integ); } } else if(!xmlStrcmp(child2->name, (const xmlChar*) "max")) { if(farg) { XML_DO_FROM_TEXT(child2, nr.set); farg->setMax(&nr); XML_GET_FALSE_FROM_PROP(child, "include_equals", b) farg->setIncludeEqualsMax(b); } else if(iarg) { XML_GET_STRING_FROM_TEXT(child2, stmp); Number integ(stmp); iarg->setMax(&integ); } } else if(farg && !xmlStrcmp(child2->name, (const xmlChar*) "complex_allowed")) { XML_GET_FALSE_FROM_TEXT(child2, b); farg->setComplexAllowed(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "condition")) { XML_DO_FROM_TEXT(child2, arg->setCustomCondition); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "matrix_allowed")) { XML_GET_TRUE_FROM_TEXT(child2, b); arg->setMatrixAllowed(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "zero_forbidden")) { XML_GET_TRUE_FROM_TEXT(child2, b); arg->setZeroForbidden(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "test")) { XML_GET_FALSE_FROM_TEXT(child2, b); arg->setTests(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "alert")) { XML_GET_FALSE_FROM_TEXT(child2, b); arg->setAlerts(b); } child2 = child2->next; } if(!argname.empty() && argname[0] == '!') { size_t i = argname.find('!', 1); if(i == string::npos) { arg->setName(argname); } else if(i + 1 < argname.length()) { arg->setName(argname.substr(i + 1, argname.length() - (i + 1))); } } else { arg->setName(argname); } itmp = 1; XML_GET_INT_FROM_PROP(child, "index", itmp); f->setArgumentDefinition(itmp, arg); } else ITEM_READ_NAME(functionNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { ITEM_SET_BEST_NAMES(functionNameIsValid) ITEM_SET_REFERENCE_NAMES(functionNameIsValid) } else { ITEM_SET_NAME_1(functionNameIsValid) ITEM_SET_NAME_2 ITEM_SET_NAME_3 } ITEM_SET_DTH if(f->countNames() == 0) { f->destroy(); f = NULL; } else { f->setChanged(false); addFunction(f, true, is_user_defs); } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "dataset") || !xmlStrcmp(cur->name, (const xmlChar*) "builtin_dataset")) { bool builtin = !xmlStrcmp(cur->name, (const xmlChar*) "builtin_dataset"); XML_GET_FALSE_FROM_PROP(cur, "active", active) if(builtin) { XML_GET_STRING_FROM_PROP(cur, "name", name) dc = getDataSet(name); if(!dc) { goto after_load_object; } dc->setCategory(category); } else { dc = new DataSet(category, "", "", "", "", is_user_defs); } item = dc; done_something = true; child = cur->xmlChildrenNode; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "property")) { dp = new DataProperty(dc); child2 = child->xmlChildrenNode; if(new_names) { default_prop_names = ""; best_prop_names = ""; nextbest_prop_names = ""; } else { for(size_t i = 0; i < 10; i++) { best_name[i] = false; nextbest_name[i] = false; } } proptitle = ""; best_proptitle = false; next_best_proptitle = false; propdescr = ""; best_propdescr = false; next_best_propdescr = false; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, proptitle, best_proptitle, next_best_proptitle) } else if(!new_names && !xmlStrcmp(child2->name, (const xmlChar*) "name")) { name_index = 1; XML_GET_INT_FROM_PROP(child2, "index", name_index) if(name_index > 0 && name_index <= 10) { name_index--; prop_names[name_index] = ""; ref_prop_names[name_index] = ""; value2 = NULL; child3 = child2->xmlChildrenNode; while(child3 != NULL) { if((!best_name[name_index] || (ref_prop_names[name_index].empty() && !locale.empty())) && !xmlStrcmp(child3->name, (const xmlChar*) "name")) { lang = xmlNodeGetLang(child3); if(!lang) { value2 = xmlNodeListGetString(doc, child3->xmlChildrenNode, 1); if(locale.empty()) { best_name[name_index] = true; if(value2) prop_names[name_index] = (char*) value2; else prop_names[name_index] = ""; } else { if(!best_name[name_index] && !nextbest_name[name_index]) { if(value2) prop_names[name_index] = (char*) value2; else prop_names[name_index] = ""; } if(value2) ref_prop_names[name_index] = (char*) value2; else ref_prop_names[name_index] = ""; } } else if(!best_name[name_index] && !locale.empty()) { if(locale == (char*) lang) { value2 = xmlNodeListGetString(doc, child3->xmlChildrenNode, 1); best_name[name_index] = true; if(value2) prop_names[name_index] = (char*) value2; else prop_names[name_index] = ""; } else if(!nextbest_name[name_index] && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) { value2 = xmlNodeListGetString(doc, child3->xmlChildrenNode, 1); nextbest_name[name_index] = true; if(value2) prop_names[name_index] = (char*) value2; else prop_names[name_index] = ""; } } if(value2) xmlFree(value2); if(lang) xmlFree(lang); value2 = NULL; lang = NULL; } child3 = child3->next; } if(!ref_prop_names[name_index].empty() && ref_prop_names[name_index] == prop_names[name_index]) { ref_prop_names[name_index] = ""; } } } else if(new_names && !xmlStrcmp(child2->name, (const xmlChar*) "names") && ((best_prop_names.empty() && fulfilled_translation != 2) || default_prop_names.empty())) { value2 = xmlNodeListGetString(doc, child2->xmlChildrenNode, 1); lang = xmlNodeGetLang(child2); if(!lang) { if(default_prop_names.empty()) { if(value2) { default_prop_names = (char*) value2; remove_blank_ends(default_prop_names); } else { default_prop_names = ""; } } } else { if(locale == (char*) lang) { if(value2) { best_prop_names = (char*) value2; remove_blank_ends(best_prop_names); } else { best_prop_names = " "; } } else if(nextbest_prop_names.empty() && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) { if(value2) { nextbest_prop_names = (char*) value2; remove_blank_ends(nextbest_prop_names); } else { nextbest_prop_names = " "; } } else if(nextbest_prop_names.empty() && default_prop_names.empty() && value2 && !require_translation) { nextbest_prop_names = (char*) value2; remove_blank_ends(nextbest_prop_names); } } if(value2) xmlFree(value2); if(lang) xmlFree(lang); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "description")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, propdescr, best_propdescr, next_best_propdescr) } else if(!xmlStrcmp(child2->name, (const xmlChar*) "unit")) { XML_DO_FROM_TEXT(child2, dp->setUnit) } else if(!xmlStrcmp(child2->name, (const xmlChar*) "key")) { XML_GET_TRUE_FROM_TEXT(child2, b) dp->setKey(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "hidden")) { XML_GET_TRUE_FROM_TEXT(child2, b) dp->setHidden(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "brackets")) { XML_GET_TRUE_FROM_TEXT(child2, b) dp->setUsesBrackets(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "approximate")) { XML_GET_TRUE_FROM_TEXT(child2, b) dp->setApproximate(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "case_sensitive")) { XML_GET_TRUE_FROM_TEXT(child2, b) dp->setCaseSensitive(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "type")) { XML_GET_STRING_FROM_TEXT(child2, stmp) if(stmp == "text") { dp->setPropertyType(PROPERTY_STRING); } else if(stmp == "number") { dp->setPropertyType(PROPERTY_NUMBER); } else if(stmp == "expression") { dp->setPropertyType(PROPERTY_EXPRESSION); } } child2 = child2->next; } if(!proptitle.empty() && proptitle[0] == '!') {\ size_t i = proptitle.find('!', 1); if(i == string::npos) { dp->setTitle(proptitle); } else if(i + 1 < proptitle.length()) { dp->setTitle(proptitle.substr(i + 1, proptitle.length() - (i + 1))); } } else { dp->setTitle(proptitle); } dp->setDescription(propdescr); if(new_names) { size_t names_i = 0, i2 = 0; string *str_names; bool had_ref = false; if(best_prop_names == "-") {best_prop_names = ""; nextbest_prop_names = "";} if(!best_prop_names.empty()) {str_names = &best_prop_names;} else if(!nextbest_prop_names.empty()) {str_names = &nextbest_prop_names;} else {str_names = &default_prop_names;} if(!str_names->empty() && (*str_names)[0] == '!') { names_i = str_names->find('!', 1) + 1; } while(true) { size_t i3 = names_i; names_i = str_names->find(",", i3); if(i2 == 0) { i2 = str_names->find(":", i3); } bool b_prop_ref = false; if(i2 < names_i) { bool b = true; for(; i3 < i2; i3++) { switch((*str_names)[i3]) { case '-': {b = false; break;} case 'r': {b_prop_ref = b; b = true; break;} } } i3++; i2 = 0; } if(names_i == string::npos) {stmp = str_names->substr(i3, str_names->length() - i3);} else {stmp = str_names->substr(i3, names_i - i3);} remove_blank_ends(stmp); if(!stmp.empty()) { if(b_prop_ref) had_ref = true; dp->addName(stmp, b_prop_ref); } if(names_i == string::npos) {break;} names_i++; } if(str_names != &default_prop_names && !default_prop_names.empty()) { if(default_prop_names[0] == '!') { names_i = default_prop_names.find('!', 1) + 1; } else { names_i = 0; } i2 = 0; while(true) { size_t i3 = names_i; names_i = default_prop_names.find(",", i3); if(i2 == 0) { i2 = default_prop_names.find(":", i3); } bool b_prop_ref = false; if(i2 < names_i) { bool b = true; for(; i3 < i2; i3++) { switch(default_prop_names[i3]) { case '-': {b = false; break;} case 'r': {b_prop_ref = b; b = true; break;} } } i3++; i2 = 0; } if(b_prop_ref || (!had_ref && names_i == string::npos)) { had_ref = true; if(names_i == string::npos) {stmp = default_prop_names.substr(i3, default_prop_names.length() - i3);} else {stmp = default_prop_names.substr(i3, names_i - i3);} remove_blank_ends(stmp); size_t i4 = dp->hasName(stmp); if(i4 > 0) { dp->setNameIsReference(i4, true); } else if(!stmp.empty()) { dp->addName(stmp, true); } } if(names_i == string::npos) {break;} names_i++; } } if(!had_ref && dp->countNames() > 0) dp->setNameIsReference(1, true); } else { bool b = false; for(size_t i = 0; i < 10; i++) { if(!prop_names[i].empty()) { if(!b && ref_prop_names[i].empty()) { dp->addName(prop_names[i], true, i + 1); b = true; } else { dp->addName(prop_names[i], false, i + 1); } prop_names[i] = ""; } } for(size_t i = 0; i < 10; i++) { if(!ref_prop_names[i].empty()) { if(!b) { dp->addName(ref_prop_names[i], true); b = true; } else { dp->addName(ref_prop_names[i], false); } ref_prop_names[i] = ""; } } } dp->setUserModified(is_user_defs); dc->addProperty(dp); } else if(!xmlStrcmp(child->name, (const xmlChar*) "argument")) { child2 = child->xmlChildrenNode; argname = ""; best_argname = false; next_best_argname = false; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, argname, best_argname, next_best_argname) } child2 = child2->next; } itmp = 1; XML_GET_INT_FROM_PROP(child, "index", itmp); if(dc->getArgumentDefinition(itmp)) { dc->getArgumentDefinition(itmp)->setName(argname); } } else if(!xmlStrcmp(child->name, (const xmlChar*) "object_argument")) { child2 = child->xmlChildrenNode; argname = ""; best_argname = false; next_best_argname = false; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, argname, best_argname, next_best_argname) } child2 = child2->next; } itmp = 1; if(dc->getArgumentDefinition(itmp)) { if(!argname.empty() && argname[0] == '!') { size_t i = argname.find('!', 1); if(i == string::npos) { dc->getArgumentDefinition(itmp)->setName(argname); } else if(i + 1 < argname.length()) { dc->getArgumentDefinition(itmp)->setName(argname.substr(i + 1, argname.length() - (i + 1))); } } else { dc->getArgumentDefinition(itmp)->setName(argname); } } } else if(!xmlStrcmp(child->name, (const xmlChar*) "property_argument")) { child2 = child->xmlChildrenNode; argname = ""; best_argname = false; next_best_argname = false; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, argname, best_argname, next_best_argname) } child2 = child2->next; } itmp = 2; if(dc->getArgumentDefinition(itmp)) { if(!argname.empty() && argname[0] == '!') { size_t i = argname.find('!', 1); if(i == string::npos) { dc->getArgumentDefinition(itmp)->setName(argname); } else if(i + 1 < argname.length()) { dc->getArgumentDefinition(itmp)->setName(argname.substr(i + 1, argname.length() - (i + 1))); } } else { dc->getArgumentDefinition(itmp)->setName(argname); } } } else if(!xmlStrcmp(child->name, (const xmlChar*) "default_property")) { XML_DO_FROM_TEXT(child, dc->setDefaultProperty) } else if(!builtin && !xmlStrcmp(child->name, (const xmlChar*) "copyright")) { XML_DO_FROM_TEXT(child, dc->setCopyright) } else if(!builtin && !xmlStrcmp(child->name, (const xmlChar*) "datafile")) { XML_DO_FROM_TEXT(child, dc->setDefaultDataFile) } else ITEM_READ_NAME(functionNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { if(builtin) { ITEM_SAVE_BUILTIN_NAMES } ITEM_SET_BEST_NAMES(functionNameIsValid) ITEM_SET_REFERENCE_NAMES(functionNameIsValid) if(builtin) { ITEM_SET_BUILTIN_NAMES } } else { if(builtin) { BUILTIN_NAMES_1 } ITEM_SET_NAME_2 ITEM_SET_NAME_3 if(builtin) { BUILTIN_NAMES_2 } } ITEM_SET_DTH if(!builtin && dc->countNames() == 0) { dc->destroy(); dc = NULL; } else { dc->setChanged(builtin && is_user_defs); if(!builtin) addDataSet(dc, true, is_user_defs); } done_something = true; } else if(!xmlStrcmp(cur->name, (const xmlChar*) "builtin_function")) { XML_GET_STRING_FROM_PROP(cur, "name", name) f = getFunction(name); if(f) { XML_GET_FALSE_FROM_PROP(cur, "active", active) f->setLocal(is_user_defs, active); f->setCategory(category); item = f; child = cur->xmlChildrenNode; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "argument")) { child2 = child->xmlChildrenNode; argname = ""; best_argname = false; next_best_argname = false; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, argname, best_argname, next_best_argname) } child2 = child2->next; } itmp = 1; XML_GET_INT_FROM_PROP(child, "index", itmp); if(f->getArgumentDefinition(itmp)) { if(!argname.empty() && argname[0] == '!') { size_t i = argname.find('!', 1); if(i == string::npos) { f->getArgumentDefinition(itmp)->setName(argname); } else if(i + 1 < argname.length()) { f->getArgumentDefinition(itmp)->setName(argname.substr(i + 1, argname.length() - (i + 1))); } } else { f->getArgumentDefinition(itmp)->setName(argname); } } else if(itmp <= f->maxargs() || itmp <= f->minargs()) { if(!argname.empty() && argname[0] == '!') { size_t i = argname.find('!', 1); if(i == string::npos) { f->setArgumentDefinition(itmp, new Argument(argname, false)); } else if(i + 1 < argname.length()) { f->setArgumentDefinition(itmp, new Argument(argname.substr(i + 1, argname.length() - (i + 1)), false)); } } else { f->setArgumentDefinition(itmp, new Argument(argname, false)); } } } else ITEM_READ_NAME(functionNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { ITEM_SAVE_BUILTIN_NAMES ITEM_SET_BEST_NAMES(functionNameIsValid) ITEM_SET_REFERENCE_NAMES(functionNameIsValid) ITEM_SET_BUILTIN_NAMES } else { BUILTIN_NAMES_1 ITEM_SET_NAME_2 ITEM_SET_NAME_3 BUILTIN_NAMES_2 } ITEM_SET_DTH f->setChanged(false); done_something = true; } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "unknown")) { if(VERSION_BEFORE(0, 6, 3)) { XML_GET_STRING_FROM_PROP(cur, "name", name) } else { name = ""; } XML_GET_FALSE_FROM_PROP(cur, "active", active) svalue = ""; v = new UnknownVariable(category, "", "", is_user_defs, false, active); item = v; done_something = true; child = cur->xmlChildrenNode; b = true; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "type")) { XML_GET_STRING_FROM_TEXT(child, stmp); if(!((UnknownVariable*) v)->assumptions()) ((UnknownVariable*) v)->setAssumptions(new Assumptions()); if(stmp == "integer") ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_INTEGER); else if(stmp == "rational") ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_RATIONAL); else if(stmp == "real") ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_REAL); else if(stmp == "complex") ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_COMPLEX); else if(stmp == "number") ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_NUMBER); else if(stmp == "non-matrix") ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_NONMATRIX); else if(stmp == "none") { if(VERSION_BEFORE(0, 9, 1)) { ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_NONMATRIX); } else { ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_NONE); } } } else if(!xmlStrcmp(child->name, (const xmlChar*) "sign")) { XML_GET_STRING_FROM_TEXT(child, stmp); if(!((UnknownVariable*) v)->assumptions()) ((UnknownVariable*) v)->setAssumptions(new Assumptions()); if(stmp == "non-zero") ((UnknownVariable*) v)->assumptions()->setSign(ASSUMPTION_SIGN_NONZERO); else if(stmp == "non-positive") ((UnknownVariable*) v)->assumptions()->setSign(ASSUMPTION_SIGN_NONPOSITIVE); else if(stmp == "negative") ((UnknownVariable*) v)->assumptions()->setSign(ASSUMPTION_SIGN_NEGATIVE); else if(stmp == "non-negative") ((UnknownVariable*) v)->assumptions()->setSign(ASSUMPTION_SIGN_NONNEGATIVE); else if(stmp == "positive") ((UnknownVariable*) v)->assumptions()->setSign(ASSUMPTION_SIGN_POSITIVE); else if(stmp == "unknown") ((UnknownVariable*) v)->assumptions()->setSign(ASSUMPTION_SIGN_UNKNOWN); } else ITEM_READ_NAME(variableNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { ITEM_SET_BEST_NAMES(variableNameIsValid) ITEM_SET_REFERENCE_NAMES(variableNameIsValid) } else { ITEM_SET_NAME_1(variableNameIsValid) ITEM_SET_NAME_2 ITEM_SET_NAME_3 } ITEM_SET_DTH for(size_t i = 1; i <= v->countNames(); i++) { if(v->getName(i).name == "x") {v_x->destroy(); v_x = (UnknownVariable*) v; break;} if(v->getName(i).name == "y") {v_y->destroy(); v_y = (UnknownVariable*) v; break;} if(v->getName(i).name == "z") {v_z->destroy(); v_z = (UnknownVariable*) v; break;} } if(v->countNames() == 0) { v->destroy(); v = NULL; } else { addVariable(v, true, is_user_defs); v->setChanged(false); } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "variable")) { if(VERSION_BEFORE(0, 6, 3)) { XML_GET_STRING_FROM_PROP(cur, "name", name) } else { name = ""; } XML_GET_FALSE_FROM_PROP(cur, "active", active) svalue = ""; v = new KnownVariable(category, "", "", "", is_user_defs, false, active); item = v; done_something = true; child = cur->xmlChildrenNode; b = true; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "value")) { XML_DO_FROM_TEXT(child, ((KnownVariable*) v)->set); XML_GET_PREC_FROM_PROP(child, prec) v->setPrecision(prec); XML_GET_APPROX_FROM_PROP(child, b); v->setApproximate(b); } else ITEM_READ_NAME(variableNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { ITEM_SET_BEST_NAMES(variableNameIsValid) ITEM_SET_REFERENCE_NAMES(variableNameIsValid) } else { ITEM_SET_NAME_1(variableNameIsValid) ITEM_SET_NAME_2 ITEM_SET_NAME_3 } ITEM_SET_DTH if(v->countNames() == 0) { v->destroy(); v = NULL; } else { addVariable(v, true, is_user_defs); item->setChanged(false); } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "builtin_variable")) { XML_GET_STRING_FROM_PROP(cur, "name", name) v = getVariable(name); if(v) { XML_GET_FALSE_FROM_PROP(cur, "active", active) v->setLocal(is_user_defs, active); v->setCategory(category); item = v; child = cur->xmlChildrenNode; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { ITEM_READ_NAME(variableNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { ITEM_SAVE_BUILTIN_NAMES ITEM_SET_BEST_NAMES(variableNameIsValid) ITEM_SET_REFERENCE_NAMES(variableNameIsValid) ITEM_SET_BUILTIN_NAMES } else { BUILTIN_NAMES_1 ITEM_SET_NAME_2 ITEM_SET_NAME_3 BUILTIN_NAMES_2 } ITEM_SET_DTH v->setChanged(false); done_something = true; } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "unit")) { XML_GET_STRING_FROM_PROP(cur, "type", type) if(type == "base") { if(VERSION_BEFORE(0, 6, 3)) { XML_GET_STRING_FROM_PROP(cur, "name", name) } else { name = ""; } XML_GET_FALSE_FROM_PROP(cur, "active", active) u = new Unit(category, "", "", "", "", is_user_defs, false, active); item = u; child = cur->xmlChildrenNode; singular = ""; best_singular = false; next_best_singular = false; plural = ""; best_plural = false; next_best_plural = false; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "system")) { XML_DO_FROM_TEXT(child, u->setSystem) } else if((VERSION_BEFORE(0, 6, 3)) && !xmlStrcmp(child->name, (const xmlChar*) "singular")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, singular, best_singular, next_best_singular) if(!unitNameIsValid(singular, version_numbers, is_user_defs)) { singular = ""; } } else if((VERSION_BEFORE(0, 6, 3)) && !xmlStrcmp(child->name, (const xmlChar*) "plural") && !xmlGetProp(child, (xmlChar*) "index")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, plural, best_plural, next_best_plural) if(!unitNameIsValid(plural, version_numbers, is_user_defs)) { plural = ""; } } else ITEM_READ_NAME(unitNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { ITEM_SET_BEST_NAMES(unitNameIsValid) ITEM_SET_REFERENCE_NAMES(unitNameIsValid) } else { ITEM_SET_SHORT_NAME ITEM_SET_SINGULAR ITEM_SET_PLURAL ITEM_SET_NAME_2 ITEM_SET_NAME_3 } ITEM_SET_DTH if(u->countNames() == 0) { u->destroy(); u = NULL; } else { addUnit(u, true, is_user_defs); u->setChanged(false); } done_something = true; } else if(type == "alias") { if(VERSION_BEFORE(0, 6, 3)) { XML_GET_STRING_FROM_PROP(cur, "name", name) } else { name = ""; } XML_GET_FALSE_FROM_PROP(cur, "active", active) u = NULL; child = cur->xmlChildrenNode; singular = ""; best_singular = false; next_best_singular = false; plural = ""; best_plural = false; next_best_plural = false; usystem = ""; prec = -1; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "base")) { child2 = child->xmlChildrenNode; exponent = 1; svalue = ""; inverse = ""; b = true; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "unit")) { XML_GET_STRING_FROM_TEXT(child2, base); u = getUnit(base); if(!u) { u = getCompositeUnit(base); } } else if(!xmlStrcmp(child2->name, (const xmlChar*) "relation")) { XML_GET_STRING_FROM_TEXT(child2, svalue); XML_GET_APPROX_FROM_PROP(child2, b) XML_GET_PREC_FROM_PROP(child, prec) } else if(!xmlStrcmp(child2->name, (const xmlChar*) "reverse_relation")) { XML_GET_STRING_FROM_TEXT(child2, inverse); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "inverse_relation")) { XML_GET_STRING_FROM_TEXT(child2, inverse); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "exponent")) { XML_GET_STRING_FROM_TEXT(child2, stmp); if(stmp.empty()) { exponent = 1; } else { exponent = s2i(stmp); } } child2 = child2->next; } } else if(!xmlStrcmp(child->name, (const xmlChar*) "system")) { XML_GET_STRING_FROM_TEXT(child, usystem); } else if((VERSION_BEFORE(0, 6, 3)) && !xmlStrcmp(child->name, (const xmlChar*) "singular")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, singular, best_singular, next_best_singular) if(!unitNameIsValid(singular, version_numbers, is_user_defs)) { singular = ""; } } else if((VERSION_BEFORE(0, 6, 3)) && !xmlStrcmp(child->name, (const xmlChar*) "plural") && !xmlGetProp(child, (xmlChar*) "index")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, plural, best_plural, next_best_plural) if(!unitNameIsValid(plural, version_numbers, is_user_defs)) { plural = ""; } } else ITEM_READ_NAME(unitNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(!u) { ITEM_CLEAR_NAMES if(!in_unfinished) { unfinished_nodes.push_back(cur); unfinished_cats.push_back(category); } } else { au = new AliasUnit(category, name, plural, singular, title, u, svalue, exponent, inverse, is_user_defs, false, active); au->setDescription(description); au->setPrecision(prec); au->setApproximate(b); au->setHidden(hidden); au->setSystem(usystem); item = au; if(new_names) { ITEM_SET_BEST_NAMES(unitNameIsValid) ITEM_SET_REFERENCE_NAMES(unitNameIsValid) } else { ITEM_SET_NAME_2 ITEM_SET_NAME_3 } if(au->countNames() == 0) { au->destroy(); au = NULL; } else { addUnit(au, true, is_user_defs); au->setChanged(false); } done_something = true; } } else if(type == "composite") { if(VERSION_BEFORE(0, 6, 3)) { XML_GET_STRING_FROM_PROP(cur, "name", name) } else { name = ""; } XML_GET_FALSE_FROM_PROP(cur, "active", active) child = cur->xmlChildrenNode; usystem = ""; cu = NULL; ITEM_INIT_DTH ITEM_INIT_NAME b = true; while(child != NULL) { u = NULL; if(!xmlStrcmp(child->name, (const xmlChar*) "part")) { child2 = child->xmlChildrenNode; p = NULL; exponent = 1; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "unit")) { XML_GET_STRING_FROM_TEXT(child2, base); u = getUnit(base); if(!u) { u = getCompositeUnit(base); } } else if(!xmlStrcmp(child2->name, (const xmlChar*) "prefix")) { XML_GET_STRING_FROM_PROP(child2, "type", stmp) XML_GET_STRING_FROM_TEXT(child2, svalue); p = NULL; if(stmp == "binary") { litmp = s2i(svalue); if(litmp != 0) { p = getExactBinaryPrefix(litmp); if(!p) b = false; } } else if(stmp == "number") { nr.set(stmp); if(!nr.isZero()) { p = getExactPrefix(stmp); if(!p) b = false; } } else { litmp = s2i(svalue); if(litmp != 0) { p = getExactDecimalPrefix(litmp); if(!p) b = false; } } if(!b) { if(cu) { delete cu; } cu = NULL; break; } } else if(!xmlStrcmp(child2->name, (const xmlChar*) "exponent")) { XML_GET_STRING_FROM_TEXT(child2, stmp); if(stmp.empty()) { exponent = 1; } else { exponent = s2i(stmp); } } child2 = child2->next; } if(!b) break; if(u) { if(!cu) { cu = new CompositeUnit("", "", "", "", is_user_defs, false, active); } cu->add(u, exponent, p); } else { if(cu) delete cu; cu = NULL; if(!in_unfinished) { unfinished_nodes.push_back(cur); unfinished_cats.push_back(category); } break; } } else if(!xmlStrcmp(child->name, (const xmlChar*) "system")) { XML_GET_STRING_FROM_TEXT(child, usystem); } else ITEM_READ_NAME(unitNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(cu) { item = cu; cu->setCategory(category); cu->setSystem(usystem); if(new_names) { ITEM_SET_BEST_NAMES(unitNameIsValid) ITEM_SET_REFERENCE_NAMES(unitNameIsValid) } else { ITEM_SET_NAME_1(unitNameIsValid) ITEM_SET_NAME_2 ITEM_SET_NAME_3 } ITEM_SET_DTH if(cu->countNames() == 0) { cu->destroy(); cu = NULL; } else { addUnit(cu, true, is_user_defs); cu->setChanged(false); } done_something = true; } else { ITEM_CLEAR_NAMES } } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "builtin_unit")) { XML_GET_STRING_FROM_PROP(cur, "name", name) u = getUnit(name); if(!u) { u = getCompositeUnit(name); } if(u) { XML_GET_FALSE_FROM_PROP(cur, "active", active) u->setLocal(is_user_defs, active); u->setCategory(category); item = u; child = cur->xmlChildrenNode; singular = ""; best_singular = false; next_best_singular = false; plural = ""; best_plural = false; next_best_plural = false; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "singular")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, singular, best_singular, next_best_singular) if(!unitNameIsValid(singular, version_numbers, is_user_defs)) { singular = ""; } } else if(!xmlStrcmp(child->name, (const xmlChar*) "plural") && !xmlGetProp(child, (xmlChar*) "index")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, plural, best_plural, next_best_plural) if(!unitNameIsValid(plural, version_numbers, is_user_defs)) { plural = ""; } } else ITEM_READ_NAME(unitNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { ITEM_SAVE_BUILTIN_NAMES ITEM_SET_BEST_NAMES(unitNameIsValid) ITEM_SET_REFERENCE_NAMES(unitNameIsValid) ITEM_SET_BUILTIN_NAMES } else { BUILTIN_UNIT_NAMES_1 ITEM_SET_SINGULAR ITEM_SET_PLURAL ITEM_SET_NAME_2 ITEM_SET_NAME_3 BUILTIN_NAMES_2 } ITEM_SET_DTH u->setChanged(false); done_something = true; } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "prefix")) { child = cur->xmlChildrenNode; XML_GET_STRING_FROM_PROP(cur, "type", type) uname = ""; sexp = ""; svalue = ""; while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "name")) { XML_GET_STRING_FROM_TEXT(child, name); } else if(!xmlStrcmp(child->name, (const xmlChar*) "abbreviation")) { XML_GET_STRING_FROM_TEXT(child, stmp); } else if(!xmlStrcmp(child->name, (const xmlChar*) "unicode")) { XML_GET_STRING_FROM_TEXT(child, uname); } else if(!xmlStrcmp(child->name, (const xmlChar*) "exponent")) { XML_GET_STRING_FROM_TEXT(child, sexp); } else if(!xmlStrcmp(child->name, (const xmlChar*) "value")) { XML_GET_STRING_FROM_TEXT(child, svalue); } child = child->next; } if(type == "decimal") { addPrefix(new DecimalPrefix(s2i(sexp), name, stmp, uname)); } else if(type == "number") { addPrefix(new NumberPrefix(svalue, name, stmp, uname)); } else if(type == "binary") { addPrefix(new BinaryPrefix(s2i(sexp), name, stmp, uname)); } else { if(svalue.empty()) { addPrefix(new DecimalPrefix(s2i(sexp), name, stmp, uname)); } else { addPrefix(new NumberPrefix(svalue, name, stmp, uname)); } } done_something = true; } after_load_object: cur = NULL; if(in_unfinished) { if(done_something) { in_unfinished--; unfinished_nodes.erase(unfinished_nodes.begin() + in_unfinished); unfinished_cats.erase(unfinished_cats.begin() + in_unfinished); } if((int) unfinished_nodes.size() > in_unfinished) { cur = unfinished_nodes[in_unfinished]; category = unfinished_cats[in_unfinished]; } else if(done_something && unfinished_nodes.size() > 0) { cur = unfinished_nodes[0]; category = unfinished_cats[0]; in_unfinished = 0; done_something = false; } in_unfinished++; done_something = false; } } if(in_unfinished) { break; } while(!nodes.empty() && nodes.back().empty()) { size_t cat_i = category.rfind("/"); if(cat_i == string::npos) { category = ""; } else { category = category.substr(0, cat_i); } nodes.pop_back(); } if(!nodes.empty()) { cur = nodes.back().front(); nodes.back().pop(); nodes.resize(nodes.size() + 1); } else { if(unfinished_nodes.size() > 0) { cur = unfinished_nodes[0]; category = unfinished_cats[0]; in_unfinished = 1; done_something = false; } else { cur = NULL; } } if(cur == NULL) { break; } } xmlFreeDoc(doc); return true; } bool Calculator::saveDefinitions() { string filename; string homedir = getLocalDir(); mkdir(homedir.c_str(), S_IRWXU); homedir += "definitions/"; mkdir(homedir.c_str(), S_IRWXU); filename = homedir; filename += "functions.xml"; bool b = true; if(!saveFunctions(filename.c_str())) { b = false; } filename = homedir; filename += "units.xml"; if(!saveUnits(filename.c_str())) { b = false; } filename = homedir; filename += "variables.xml"; if(!saveVariables(filename.c_str())) { b = false; } filename = homedir; filename += "datasets.xml"; if(!saveDataSets(filename.c_str())) { b = false; } if(!saveDataObjects()) { b = false; } return b; } struct node_tree_item { xmlNodePtr node; string category; vector items; }; int Calculator::saveDataObjects() { int returnvalue = 1; for(size_t i = 0; i < data_sets.size(); i++) { int rv = data_sets[i]->saveObjects(NULL, false); if(rv <= 0) returnvalue = rv; } return returnvalue; } int Calculator::savePrefixes(const char* file_name, bool save_global) { if(!save_global) { return true; } xmlDocPtr doc = xmlNewDoc((xmlChar*) "1.0"); xmlNodePtr cur, newnode; doc->children = xmlNewDocNode(doc, NULL, (xmlChar*) "QALCULATE", NULL); xmlNewProp(doc->children, (xmlChar*) "version", (xmlChar*) VERSION); cur = doc->children; for(size_t i = 0; i < prefixes.size(); i++) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "prefix", NULL); if(!prefixes[i]->longName(false).empty()) xmlNewTextChild(newnode, NULL, (xmlChar*) "name", (xmlChar*) prefixes[i]->longName(false).c_str()); if(!prefixes[i]->shortName(false).empty()) xmlNewTextChild(newnode, NULL, (xmlChar*) "abbreviation", (xmlChar*) prefixes[i]->shortName(false).c_str()); if(!prefixes[i]->unicodeName(false).empty()) xmlNewTextChild(newnode, NULL, (xmlChar*) "unicode", (xmlChar*) prefixes[i]->unicodeName(false).c_str()); switch(prefixes[i]->type()) { case PREFIX_DECIMAL: { xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "decimal"); xmlNewTextChild(newnode, NULL, (xmlChar*) "exponent", (xmlChar*) i2s(((DecimalPrefix*) prefixes[i])->exponent()).c_str()); break; } case PREFIX_BINARY: { xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "binary"); xmlNewTextChild(newnode, NULL, (xmlChar*) "exponent", (xmlChar*) i2s(((BinaryPrefix*) prefixes[i])->exponent()).c_str()); break; } case PREFIX_NUMBER: { xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "number"); xmlNewTextChild(newnode, NULL, (xmlChar*) "value", (xmlChar*) prefixes[i]->value().print(save_printoptions).c_str()); break; } } } int returnvalue = xmlSaveFormatFile(file_name, doc, 1); xmlFreeDoc(doc); return returnvalue; } #define SAVE_NAMES(o)\ str = "";\ for(size_t i2 = 1;;) {\ ename = &o->getName(i2);\ if(ename->abbreviation) {str += 'a';}\ bool b_cs = (ename->abbreviation || text_length_is_one(ename->name));\ if(ename->case_sensitive && !b_cs) {str += 'c';}\ if(!ename->case_sensitive && b_cs) {str += "-c";}\ if(ename->avoid_input) {str += 'i';}\ if(ename->plural) {str += 'p';}\ if(ename->reference) {str += 'r';}\ if(ename->suffix) {str += 's';}\ if(ename->unicode) {str += 'u';}\ if(str.empty() || str[str.length() - 1] == ',') {\ if(i2 == 1 && o->countNames() == 1) {\ if(save_global) {\ xmlNewTextChild(newnode, NULL, (xmlChar*) "_names", (xmlChar*) ename->name.c_str());\ } else {\ xmlNewTextChild(newnode, NULL, (xmlChar*) "names", (xmlChar*) ename->name.c_str());\ }\ break;\ }\ } else {\ str += ':';\ }\ str += ename->name;\ i2++;\ if(i2 > o->countNames()) {\ if(save_global) {\ xmlNewTextChild(newnode, NULL, (xmlChar*) "_names", (xmlChar*) str.c_str());\ } else {\ xmlNewTextChild(newnode, NULL, (xmlChar*) "names", (xmlChar*) str.c_str());\ }\ break;\ }\ str += ',';\ } int Calculator::saveVariables(const char* file_name, bool save_global) { string str; const ExpressionName *ename; xmlDocPtr doc = xmlNewDoc((xmlChar*) "1.0"); xmlNodePtr cur, newnode, newnode2; doc->children = xmlNewDocNode(doc, NULL, (xmlChar*) "QALCULATE", NULL); xmlNewProp(doc->children, (xmlChar*) "version", (xmlChar*) VERSION); node_tree_item top; top.category = ""; top.node = doc->children; node_tree_item *item; string cat, cat_sub; for(size_t i = 0; i < variables.size(); i++) { if((save_global || variables[i]->isLocal() || variables[i]->hasChanged()) && variables[i]->category() != _("Temporary")) { item = ⊤ if(!variables[i]->category().empty()) { cat = variables[i]->category(); size_t cat_i = cat.find("/"); size_t cat_i_prev = 0; bool b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(size_t i2 = 0; i2 < item->items.size(); i2++) { if(cat_sub == item->items[i2].category) { item = &item->items[i2]; b = true; break; } } if(!b) { item->items.resize(item->items.size() + 1); item->items[item->items.size() - 1].node = xmlNewTextChild(item->node, NULL, (xmlChar*) "category", NULL); item = &item->items[item->items.size() - 1]; item->category = cat_sub; if(save_global) { xmlNewTextChild(item->node, NULL, (xmlChar*) "_title", (xmlChar*) item->category.c_str()); } else { xmlNewTextChild(item->node, NULL, (xmlChar*) "title", (xmlChar*) item->category.c_str()); } } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } cur = item->node; if(!save_global && !variables[i]->isLocal() && variables[i]->hasChanged()) { if(variables[i]->isActive()) { xmlNewTextChild(cur, NULL, (xmlChar*) "activate", (xmlChar*) variables[i]->referenceName().c_str()); } else { xmlNewTextChild(cur, NULL, (xmlChar*) "deactivate", (xmlChar*) variables[i]->referenceName().c_str()); } } else if(save_global || variables[i]->isLocal()) { if(variables[i]->isBuiltin()) { if(variables[i]->isKnown()) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "builtin_variable", NULL); } else { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "builtin_unknown", NULL); } xmlNewProp(newnode, (xmlChar*) "name", (xmlChar*) variables[i]->referenceName().c_str()); } else { if(variables[i]->isKnown()) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "variable", NULL); } else { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "unknown", NULL); } } if(!variables[i]->isActive()) xmlNewProp(newnode, (xmlChar*) "active", (xmlChar*) "false"); if(variables[i]->isHidden()) xmlNewTextChild(newnode, NULL, (xmlChar*) "hidden", (xmlChar*) "true"); if(!variables[i]->title(false).empty()) { if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_title", (xmlChar*) variables[i]->title(false).c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "title", (xmlChar*) variables[i]->title(false).c_str()); } } SAVE_NAMES(variables[i]) if(!variables[i]->description().empty()) { str = variables[i]->description(); if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_description", (xmlChar*) str.c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "description", (xmlChar*) str.c_str()); } } if(!variables[i]->isBuiltin()) { if(variables[i]->isKnown()) { if(((KnownVariable*) variables[i])->isExpression()) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "value", (xmlChar*) ((KnownVariable*) variables[i])->expression().c_str()); } else { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "value", (xmlChar*) ((KnownVariable*) variables[i])->get().print(save_printoptions).c_str()); } if(variables[i]->isApproximate()) xmlNewProp(newnode2, (xmlChar*) "approximate", (xmlChar*) "true"); if(variables[i]->precision() > 0) xmlNewProp(newnode2, (xmlChar*) "precision", (xmlChar*) i2s(variables[i]->precision()).c_str()); } else { if(((UnknownVariable*) variables[i])->assumptions()) { switch(((UnknownVariable*) variables[i])->assumptions()->type()) { case ASSUMPTION_TYPE_INTEGER: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "integer"); break; } case ASSUMPTION_TYPE_RATIONAL: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "rational"); break; } case ASSUMPTION_TYPE_REAL: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "real"); break; } case ASSUMPTION_TYPE_COMPLEX: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "complex"); break; } case ASSUMPTION_TYPE_NUMBER: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "number"); break; } case ASSUMPTION_TYPE_NONMATRIX: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "non-matrix"); break; } case ASSUMPTION_TYPE_NONE: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "none"); break; } } switch(((UnknownVariable*) variables[i])->assumptions()->sign()) { case ASSUMPTION_SIGN_NONZERO: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "sign", (xmlChar*) "non-zero"); break; } case ASSUMPTION_SIGN_NONPOSITIVE: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "sign", (xmlChar*) "non-positive"); break; } case ASSUMPTION_SIGN_NEGATIVE: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "sign", (xmlChar*) "negative"); break; } case ASSUMPTION_SIGN_NONNEGATIVE: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "sign", (xmlChar*) "non-negative"); break; } case ASSUMPTION_SIGN_POSITIVE: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "sign", (xmlChar*) "positive"); break; } case ASSUMPTION_SIGN_UNKNOWN: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "sign", (xmlChar*) "unknown"); break; } } } } } } } } int returnvalue = xmlSaveFormatFile(file_name, doc, 1); xmlFreeDoc(doc); return returnvalue; } int Calculator::saveUnits(const char* file_name, bool save_global) { string str; xmlDocPtr doc = xmlNewDoc((xmlChar*) "1.0"); xmlNodePtr cur, newnode, newnode2, newnode3; doc->children = xmlNewDocNode(doc, NULL, (xmlChar*) "QALCULATE", NULL); xmlNewProp(doc->children, (xmlChar*) "version", (xmlChar*) VERSION); const ExpressionName *ename; CompositeUnit *cu = NULL; AliasUnit *au = NULL; node_tree_item top; top.category = ""; top.node = doc->children; node_tree_item *item; string cat, cat_sub; for(size_t i = 0; i < units.size(); i++) { if(save_global || units[i]->isLocal() || units[i]->hasChanged()) { item = ⊤ if(!units[i]->category().empty()) { cat = units[i]->category(); size_t cat_i = cat.find("/"); size_t cat_i_prev = 0; bool b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(size_t i2 = 0; i2 < item->items.size(); i2++) { if(cat_sub == item->items[i2].category) { item = &item->items[i2]; b = true; break; } } if(!b) { item->items.resize(item->items.size() + 1); item->items[item->items.size() - 1].node = xmlNewTextChild(item->node, NULL, (xmlChar*) "category", NULL); item = &item->items[item->items.size() - 1]; item->category = cat_sub; if(save_global) { xmlNewTextChild(item->node, NULL, (xmlChar*) "_title", (xmlChar*) item->category.c_str()); } else { xmlNewTextChild(item->node, NULL, (xmlChar*) "title", (xmlChar*) item->category.c_str()); } } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } cur = item->node; if(!save_global && !units[i]->isLocal() && units[i]->hasChanged()) { if(units[i]->isActive()) { xmlNewTextChild(cur, NULL, (xmlChar*) "activate", (xmlChar*) units[i]->referenceName().c_str()); } else { xmlNewTextChild(cur, NULL, (xmlChar*) "deactivate", (xmlChar*) units[i]->referenceName().c_str()); } } else if(save_global || units[i]->isLocal()) { if(units[i]->isBuiltin()) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "builtin_unit", NULL); xmlNewProp(newnode, (xmlChar*) "name", (xmlChar*) units[i]->referenceName().c_str()); } else { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "unit", NULL); switch(units[i]->subtype()) { case SUBTYPE_BASE_UNIT: { xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "base"); break; } case SUBTYPE_ALIAS_UNIT: { au = (AliasUnit*) units[i]; xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "alias"); break; } case SUBTYPE_COMPOSITE_UNIT: { cu = (CompositeUnit*) units[i]; xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "composite"); break; } } } if(!units[i]->isActive()) xmlNewProp(newnode, (xmlChar*) "active", (xmlChar*) "false"); if(units[i]->isHidden()) xmlNewTextChild(newnode, NULL, (xmlChar*) "hidden", (xmlChar*) "true"); if(!units[i]->system().empty()) xmlNewTextChild(newnode, NULL, (xmlChar*) "system", (xmlChar*) units[i]->system().c_str()); if(!units[i]->title(false).empty()) { if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_title", (xmlChar*) units[i]->title(false).c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "title", (xmlChar*) units[i]->title(false).c_str()); } } if(save_global && units[i]->subtype() == SUBTYPE_COMPOSITE_UNIT) { save_global = false; SAVE_NAMES(units[i]) save_global = true; } else { SAVE_NAMES(units[i]) } if(!units[i]->description().empty()) { str = units[i]->description(); if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_description", (xmlChar*) str.c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "description", (xmlChar*) str.c_str()); } } if(!units[i]->isBuiltin()) { if(units[i]->subtype() == SUBTYPE_COMPOSITE_UNIT) { for(size_t i2 = 1; i2 <= cu->countUnits(); i2++) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "part", NULL); int exp = 1; Prefix *p = NULL; Unit *u = cu->get(i2, &exp, &p); xmlNewTextChild(newnode2, NULL, (xmlChar*) "unit", (xmlChar*) u->referenceName().c_str()); if(p) { switch(p->type()) { case PREFIX_DECIMAL: { xmlNewTextChild(newnode2, NULL, (xmlChar*) "prefix", (xmlChar*) i2s(((DecimalPrefix*) p)->exponent()).c_str()); break; } case PREFIX_BINARY: { newnode3 = xmlNewTextChild(newnode2, NULL, (xmlChar*) "prefix", (xmlChar*) i2s(((BinaryPrefix*) p)->exponent()).c_str()); xmlNewProp(newnode3, (xmlChar*) "type", (xmlChar*) "binary"); break; } case PREFIX_NUMBER: { newnode3 = xmlNewTextChild(newnode2, NULL, (xmlChar*) "prefix", (xmlChar*) p->value().print(save_printoptions).c_str()); xmlNewProp(newnode3, (xmlChar*) "type", (xmlChar*) "number"); break; } } } xmlNewTextChild(newnode2, NULL, (xmlChar*) "exponent", (xmlChar*) i2s(exp).c_str()); } } if(units[i]->subtype() == SUBTYPE_ALIAS_UNIT) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "base", NULL); xmlNewTextChild(newnode2, NULL, (xmlChar*) "unit", (xmlChar*) au->firstBaseUnit()->referenceName().c_str()); newnode3 = xmlNewTextChild(newnode2, NULL, (xmlChar*) "relation", (xmlChar*) au->expression().c_str()); if(units[i]->isApproximate()) xmlNewProp(newnode3, (xmlChar*) "approximate", (xmlChar*) "true"); if(units[i]->precision() > 0) xmlNewProp(newnode2, (xmlChar*) "precision", (xmlChar*) i2s(units[i]->precision()).c_str()); if(!au->inverseExpression().empty()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "inverse_relation", (xmlChar*) au->inverseExpression().c_str()); } xmlNewTextChild(newnode2, NULL, (xmlChar*) "exponent", (xmlChar*) i2s(au->firstBaseExponent()).c_str()); } } } } } int returnvalue = xmlSaveFormatFile(file_name, doc, 1); xmlFreeDoc(doc); return returnvalue; } int Calculator::saveFunctions(const char* file_name, bool save_global) { xmlDocPtr doc = xmlNewDoc((xmlChar*) "1.0"); xmlNodePtr cur, newnode, newnode2; doc->children = xmlNewDocNode(doc, NULL, (xmlChar*) "QALCULATE", NULL); xmlNewProp(doc->children, (xmlChar*) "version", (xmlChar*) VERSION); const ExpressionName *ename; node_tree_item top; top.category = ""; top.node = doc->children; node_tree_item *item; string cat, cat_sub; Argument *arg; IntegerArgument *iarg; NumberArgument *farg; string str; for(size_t i = 0; i < functions.size(); i++) { if(functions[i]->subtype() != SUBTYPE_DATA_SET && (save_global || functions[i]->isLocal() || functions[i]->hasChanged())) { item = ⊤ if(!functions[i]->category().empty()) { cat = functions[i]->category(); size_t cat_i = cat.find("/"); size_t cat_i_prev = 0; bool b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(size_t i2 = 0; i2 < item->items.size(); i2++) { if(cat_sub == item->items[i2].category) { item = &item->items[i2]; b = true; break; } } if(!b) { item->items.resize(item->items.size() + 1); item->items[item->items.size() - 1].node = xmlNewTextChild(item->node, NULL, (xmlChar*) "category", NULL); item = &item->items[item->items.size() - 1]; item->category = cat_sub; if(save_global) { xmlNewTextChild(item->node, NULL, (xmlChar*) "_title", (xmlChar*) item->category.c_str()); } else { xmlNewTextChild(item->node, NULL, (xmlChar*) "title", (xmlChar*) item->category.c_str()); } } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } cur = item->node; if(!save_global && !functions[i]->isLocal() && functions[i]->hasChanged()) { if(functions[i]->isActive()) { xmlNewTextChild(cur, NULL, (xmlChar*) "activate", (xmlChar*) functions[i]->referenceName().c_str()); } else { xmlNewTextChild(cur, NULL, (xmlChar*) "deactivate", (xmlChar*) functions[i]->referenceName().c_str()); } } else if(save_global || functions[i]->isLocal()) { if(functions[i]->isBuiltin()) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "builtin_function", NULL); xmlNewProp(newnode, (xmlChar*) "name", (xmlChar*) functions[i]->referenceName().c_str()); } else { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "function", NULL); } if(!functions[i]->isActive()) xmlNewProp(newnode, (xmlChar*) "active", (xmlChar*) "false"); if(functions[i]->isHidden()) xmlNewTextChild(newnode, NULL, (xmlChar*) "hidden", (xmlChar*) "true"); if(!functions[i]->title(false).empty()) { if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_title", (xmlChar*) functions[i]->title(false).c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "title", (xmlChar*) functions[i]->title(false).c_str()); } } SAVE_NAMES(functions[i]) if(!functions[i]->description().empty()) { str = functions[i]->description(); if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_description", (xmlChar*) str.c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "description", (xmlChar*) str.c_str()); } } if(functions[i]->isBuiltin()) { cur = newnode; for(size_t i2 = 1; i2 <= functions[i]->lastArgumentDefinitionIndex(); i2++) { arg = functions[i]->getArgumentDefinition(i2); if(arg && !arg->name().empty()) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "argument", NULL); if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_title", (xmlChar*) arg->name().c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "title", (xmlChar*) arg->name().c_str()); } xmlNewProp(newnode, (xmlChar*) "index", (xmlChar*) i2s(i2).c_str()); } } } else { for(size_t i2 = 1; i2 <= ((UserFunction*) functions[i])->countSubfunctions(); i2++) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "subfunction", (xmlChar*) ((UserFunction*) functions[i])->getSubfunction(i2).c_str()); if(((UserFunction*) functions[i])->subfunctionPrecalculated(i2)) xmlNewProp(newnode2, (xmlChar*) "precalculate", (xmlChar*) "true"); else xmlNewProp(newnode2, (xmlChar*) "precalculate", (xmlChar*) "false"); } newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "expression", (xmlChar*) ((UserFunction*) functions[i])->formula().c_str()); if(functions[i]->isApproximate()) xmlNewProp(newnode2, (xmlChar*) "approximate", (xmlChar*) "true"); if(functions[i]->precision() > 0) xmlNewProp(newnode2, (xmlChar*) "precision", (xmlChar*) i2s(functions[i]->precision()).c_str()); if(!functions[i]->condition().empty()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "condition", (xmlChar*) functions[i]->condition().c_str()); } cur = newnode; for(size_t i2 = 1; i2 <= functions[i]->lastArgumentDefinitionIndex(); i2++) { arg = functions[i]->getArgumentDefinition(i2); if(arg) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "argument", NULL); if(!arg->name().empty()) { if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_title", (xmlChar*) arg->name().c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "title", (xmlChar*) arg->name().c_str()); } } switch(arg->type()) { case ARGUMENT_TYPE_TEXT: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "text"); break;} case ARGUMENT_TYPE_SYMBOLIC: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "symbol"); break;} case ARGUMENT_TYPE_DATE: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "date"); break;} case ARGUMENT_TYPE_INTEGER: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "integer"); break;} case ARGUMENT_TYPE_NUMBER: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "number"); break;} case ARGUMENT_TYPE_VECTOR: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "vector"); break;} case ARGUMENT_TYPE_MATRIX: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "matrix"); break;} case ARGUMENT_TYPE_BOOLEAN: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "boolean"); break;} case ARGUMENT_TYPE_FUNCTION: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "function"); break;} case ARGUMENT_TYPE_UNIT: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "unit"); break;} case ARGUMENT_TYPE_VARIABLE: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "variable"); break;} case ARGUMENT_TYPE_EXPRESSION_ITEM: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "object"); break;} case ARGUMENT_TYPE_ANGLE: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "angle"); break;} case ARGUMENT_TYPE_DATA_OBJECT: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "data-object"); break;} case ARGUMENT_TYPE_DATA_PROPERTY: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "data-property"); break;} default: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "free");} } xmlNewProp(newnode, (xmlChar*) "index", (xmlChar*) i2s(i2).c_str()); if(!arg->tests()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "test", (xmlChar*) "false"); } if(!arg->alerts()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "alert", (xmlChar*) "false"); } if(arg->zeroForbidden()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "zero_forbidden", (xmlChar*) "true"); } if(arg->matrixAllowed()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "matrix_allowed", (xmlChar*) "true"); } switch(arg->type()) { case ARGUMENT_TYPE_INTEGER: { iarg = (IntegerArgument*) arg; if(iarg->min()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "min", (xmlChar*) iarg->min()->print(save_printoptions).c_str()); } if(iarg->max()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "max", (xmlChar*) iarg->max()->print(save_printoptions).c_str()); } break; } case ARGUMENT_TYPE_NUMBER: { farg = (NumberArgument*) arg; if(farg->min()) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "min", (xmlChar*) farg->min()->print(save_printoptions).c_str()); if(farg->includeEqualsMin()) { xmlNewProp(newnode2, (xmlChar*) "include_equals", (xmlChar*) "true"); } else { xmlNewProp(newnode2, (xmlChar*) "include_equals", (xmlChar*) "false"); } } if(farg->max()) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "max", (xmlChar*) farg->max()->print(save_printoptions).c_str()); if(farg->includeEqualsMax()) { xmlNewProp(newnode2, (xmlChar*) "include_equals", (xmlChar*) "true"); } else { xmlNewProp(newnode2, (xmlChar*) "include_equals", (xmlChar*) "false"); } } if(!farg->complexAllowed()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "complex_allowed", (xmlChar*) "false"); } break; } } if(!arg->getCustomCondition().empty()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "condition", (xmlChar*) arg->getCustomCondition().c_str()); } } } } } } } int returnvalue = xmlSaveFormatFile(file_name, doc, 1); xmlFreeDoc(doc); return returnvalue; } int Calculator::saveDataSets(const char* file_name, bool save_global) { xmlDocPtr doc = xmlNewDoc((xmlChar*) "1.0"); xmlNodePtr cur, newnode, newnode2; doc->children = xmlNewDocNode(doc, NULL, (xmlChar*) "QALCULATE", NULL); xmlNewProp(doc->children, (xmlChar*) "version", (xmlChar*) VERSION); const ExpressionName *ename; node_tree_item top; top.category = ""; top.node = doc->children; node_tree_item *item; string cat, cat_sub; Argument *arg; DataSet *ds; DataProperty *dp; string str; for(size_t i = 0; i < functions.size(); i++) { if(functions[i]->subtype() == SUBTYPE_DATA_SET && (save_global || functions[i]->isLocal() || functions[i]->hasChanged())) { item = ⊤ ds = (DataSet*) functions[i]; if(!ds->category().empty()) { cat = ds->category(); size_t cat_i = cat.find("/"); size_t cat_i_prev = 0; bool b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(size_t i2 = 0; i2 < item->items.size(); i2++) { if(cat_sub == item->items[i2].category) { item = &item->items[i2]; b = true; break; } } if(!b) { item->items.resize(item->items.size() + 1); item->items[item->items.size() - 1].node = xmlNewTextChild(item->node, NULL, (xmlChar*) "category", NULL); item = &item->items[item->items.size() - 1]; item->category = cat_sub; if(save_global) { xmlNewTextChild(item->node, NULL, (xmlChar*) "_title", (xmlChar*) item->category.c_str()); } else { xmlNewTextChild(item->node, NULL, (xmlChar*) "title", (xmlChar*) item->category.c_str()); } } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } cur = item->node; if(save_global || ds->isLocal() || ds->hasChanged()) { if(save_global || ds->isLocal()) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "dataset", NULL); } else { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "builtin_dataset", NULL); xmlNewProp(newnode, (xmlChar*) "name", (xmlChar*) ds->referenceName().c_str()); } if(!ds->isActive()) xmlNewProp(newnode, (xmlChar*) "active", (xmlChar*) "false"); if(ds->isHidden()) xmlNewTextChild(newnode, NULL, (xmlChar*) "hidden", (xmlChar*) "true"); if(!ds->title(false).empty()) { if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_title", (xmlChar*) ds->title(false).c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "title", (xmlChar*) ds->title(false).c_str()); } } if((save_global || ds->isLocal()) && !ds->defaultDataFile().empty()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "datafile", (xmlChar*) ds->defaultDataFile().c_str()); } SAVE_NAMES(ds) if(!ds->description().empty()) { str = ds->description(); if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_description", (xmlChar*) str.c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "description", (xmlChar*) str.c_str()); } } if((save_global || ds->isLocal()) && !ds->copyright().empty()) { if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_copyright", (xmlChar*) ds->copyright().c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "copyright", (xmlChar*) ds->copyright().c_str()); } } arg = ds->getArgumentDefinition(1); if(arg && ((!save_global && !ds->isLocal()) || arg->name() != _("Object"))) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "object_argument", NULL); if(save_global) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "_title", (xmlChar*) arg->name().c_str()); } else { xmlNewTextChild(newnode2, NULL, (xmlChar*) "title", (xmlChar*) arg->name().c_str()); } } arg = ds->getArgumentDefinition(2); if(arg && ((!save_global && !ds->isLocal()) || arg->name() != _("Property"))) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "property_argument", NULL); if(save_global) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "_title", (xmlChar*) arg->name().c_str()); } else { xmlNewTextChild(newnode2, NULL, (xmlChar*) "title", (xmlChar*) arg->name().c_str()); } } if((!save_global && !ds->isLocal()) || ds->getDefaultValue(2) != _("info")) { xmlNewTextChild(newnode, NULL, (xmlChar*) "default_property", (xmlChar*) ds->getDefaultValue(2).c_str()); } DataPropertyIter it; dp = ds->getFirstProperty(&it); while(dp) { if(save_global || ds->isLocal() || dp->isUserModified()) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "property", NULL); if(!dp->title(false).empty()) { if(save_global) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "_title", (xmlChar*) dp->title().c_str()); } else { xmlNewTextChild(newnode2, NULL, (xmlChar*) "title", (xmlChar*) dp->title().c_str()); } } switch(dp->propertyType()) { case PROPERTY_STRING: { xmlNewTextChild(newnode2, NULL, (xmlChar*) "type", (xmlChar*) "text"); break; } case PROPERTY_NUMBER: { xmlNewTextChild(newnode2, NULL, (xmlChar*) "type", (xmlChar*) "number"); break; } case PROPERTY_EXPRESSION: { xmlNewTextChild(newnode2, NULL, (xmlChar*) "type", (xmlChar*) "expression"); break; } } if(dp->isHidden()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "hidden", (xmlChar*) "true"); } if(dp->isKey()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "key", (xmlChar*) "true"); } if(dp->isApproximate()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "approximate", (xmlChar*) "true"); } if(dp->usesBrackets()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "brackets", (xmlChar*) "true"); } if(dp->isCaseSensitive()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "case_sensitive", (xmlChar*) "true"); } if(!dp->getUnitString().empty()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "unit", (xmlChar*) dp->getUnitString().c_str()); } str = ""; for(size_t i2 = 1;;) { if(dp->nameIsReference(i2)) {str += 'r';} if(str.empty() || str[str.length() - 1] == ',') { if(i2 == 1 && dp->countNames() == 1) { if(save_global) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "_names", (xmlChar*) dp->getName(i2).c_str()); } else { xmlNewTextChild(newnode2, NULL, (xmlChar*) "names", (xmlChar*) dp->getName(i2).c_str()); } break; } } else { str += ':'; } str += dp->getName(i2); i2++; if(i2 > dp->countNames()) { if(save_global) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "_names", (xmlChar*) str.c_str()); } else { xmlNewTextChild(newnode2, NULL, (xmlChar*) "names", (xmlChar*) str.c_str()); } break; } str += ','; } if(!dp->description().empty()) { str = dp->description(); if(save_global) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "_description", (xmlChar*) str.c_str()); } else { xmlNewTextChild(newnode2, NULL, (xmlChar*) "description", (xmlChar*) str.c_str()); } } } dp = ds->getNextProperty(&it); } } } } int returnvalue = xmlSaveFormatFile(file_name, doc, 1); xmlFreeDoc(doc); return returnvalue; } bool Calculator::importCSV(MathStructure &mstruct, const char *file_name, int first_row, string delimiter, vector *headers) { FILE *file = fopen(file_name, "r"); if(file == NULL) { return false; } if(first_row < 1) { first_row = 1; } char line[10000]; string stmp, str1, str2; int row = 0, rows = 1; int columns = 1; int column; mstruct = m_empty_matrix; size_t is, is_n; bool v_added = false; while(fgets(line, 10000, file)) { row++; if(row >= first_row) { stmp = line; remove_blank_ends(stmp); if(row == first_row) { if(stmp.empty()) { row--; } else { is = 0; while((is_n = stmp.find(delimiter, is)) != string::npos) { columns++; if(headers) { str1 = stmp.substr(is, is_n - is); remove_blank_ends(str1); headers->push_back(str1); } is = is_n + delimiter.length(); } if(headers) { str1 = stmp.substr(is, stmp.length() - is); remove_blank_ends(str1); headers->push_back(str1); } mstruct.resizeMatrix(1, columns, m_undefined); } } if((!headers || row > first_row) && !stmp.empty()) { is = 0; column = 1; if(v_added) { mstruct.addRow(m_undefined); rows++; } while(column <= columns) { is_n = stmp.find(delimiter, is); if(is_n == string::npos) { str1 = stmp.substr(is, stmp.length() - is); } else { str1 = stmp.substr(is, is_n - is); is = is_n + delimiter.length(); } CALCULATOR->parse(&mstruct[rows - 1][column - 1], str1); column++; if(is_n == string::npos) { break; } } v_added = true; } } } return true; } bool Calculator::importCSV(const char *file_name, int first_row, bool headers, string delimiter, bool to_matrix, string name, string title, string category) { FILE *file = fopen(file_name, "r"); if(file == NULL) { return false; } if(first_row < 1) { first_row = 1; } string filestr = file_name; size_t i = filestr.find_last_of("/"); if(i != string::npos) { filestr = filestr.substr(i + 1, filestr.length() - (i + 1)); } if(name.empty()) { i = filestr.find_last_of("."); name = filestr.substr(0, i); } char line[10000]; string stmp, str1, str2; int row = 0; int columns = 1, rows = 1; int column; vector header; vector vectors; MathStructure mstruct = m_empty_matrix; size_t is, is_n; bool v_added = false; while(fgets(line, 10000, file)) { row++; if(row >= first_row) { stmp = line; remove_blank_ends(stmp); if(row == first_row) { if(stmp.empty()) { row--; } else { is = 0; while((is_n = stmp.find(delimiter, is)) != string::npos) { columns++; if(headers) { str1 = stmp.substr(is, is_n - is); remove_blank_ends(str1); header.push_back(str1); } if(!to_matrix) { vectors.push_back(m_empty_vector); } is = is_n + delimiter.length(); } if(headers) { str1 = stmp.substr(is, stmp.length() - is); remove_blank_ends(str1); header.push_back(str1); } if(to_matrix) { mstruct.resizeMatrix(1, columns, m_undefined); } else { vectors.push_back(m_empty_vector); } } } if((!headers || row > first_row) && !stmp.empty()) { if(to_matrix && v_added) { mstruct.addRow(m_undefined); rows++; } is = 0; column = 1; while(column <= columns) { is_n = stmp.find(delimiter, is); if(is_n == string::npos) { str1 = stmp.substr(is, stmp.length() - is); } else { str1 = stmp.substr(is, is_n - is); is = is_n + delimiter.length(); } if(to_matrix) { CALCULATOR->parse(&mstruct[rows - 1][column - 1], str1); } else { vectors[column - 1].addChild(CALCULATOR->parse(str1)); } column++; if(is_n == string::npos) { break; } } for(; column <= columns; column++) { if(!to_matrix) { vectors[column - 1].addChild(m_undefined); } } v_added = true; } } } if(to_matrix) { addVariable(new KnownVariable(category, name, mstruct, title)); } else { if(vectors.size() > 1) { if(!category.empty()) { category += "/"; } category += name; } for(size_t i = 0; i < vectors.size(); i++) { str1 = ""; str2 = ""; if(vectors.size() > 1) { str1 += name; str1 += "_"; if(title.empty()) { str2 += name; str2 += " "; } else { str2 += title; str2 += " "; } if(i < header.size()) { str1 += header[i]; str2 += header[i]; } else { str1 += _("column"); str1 += "_"; str1 += i2s(i + 1); str2 += _("Column "); str2 += i2s(i + 1); } gsub(" ", "_", str1); } else { str1 = name; str2 = title; if(i < header.size()) { str2 += " ("; str2 += header[i]; str2 += ")"; } } addVariable(new KnownVariable(category, str1, vectors[i], str2)); } } return true; } bool Calculator::exportCSV(const MathStructure &mstruct, const char *file_name, string delimiter) { FILE *file = fopen(file_name, "w+"); if(file == NULL) { return false; } MathStructure mcsv(mstruct); PrintOptions po; po.number_fraction_format = FRACTION_DECIMAL; po.decimalpoint_sign = "."; po.comma_sign = ","; if(mcsv.isMatrix()) { for(size_t i = 0; i < mcsv.size(); i++) { for(size_t i2 = 0; i2 < mcsv[i].size(); i2++) { if(i2 > 0) fputs(delimiter.c_str(), file); mcsv[i][i2].format(po); fputs(mcsv[i][i2].print(po).c_str(), file); } fputs("\n", file); } } else if(mcsv.isVector()) { for(size_t i = 0; i < mcsv.size(); i++) { mcsv[i].format(po); fputs(mcsv[i].print(po).c_str(), file); fputs("\n", file); } } else { mcsv.format(po); fputs(mcsv.print(po).c_str(), file); fputs("\n", file); } fclose(file); return true; } int Calculator::testCondition(string expression) { MathStructure mstruct = calculate(expression); if(mstruct.isNumber()) { if(mstruct.number().isPositive()) { return 1; } else { return 0; } } return -1; } bool Calculator::loadExchangeRates() { xmlDocPtr doc; xmlNodePtr cur; xmlChar *value; string filename, currency, rate; string homedir = getLocalDir(); filename = homedir; filename += "eurofxref-daily.xml"; doc = xmlParseFile(filename.c_str()); if(doc == NULL) { //fetchExchangeRates(); doc = xmlParseFile(filename.c_str()); if(doc == NULL) { return false; } } cur = xmlDocGetRootElement(doc); if(cur == NULL) { xmlFreeDoc(doc); return false; } Unit *u; while(cur) { if(!xmlStrcmp(cur->name, (const xmlChar*) "Cube")) { XML_GET_STRING_FROM_PROP(cur, "currency", currency); if(!currency.empty()) { XML_GET_STRING_FROM_PROP(cur, "rate", rate); if(!rate.empty()) { rate = "1/" + rate; u = getUnit(currency); if(!u) { addUnit(new AliasUnit(_("Currency"), currency, "", "", "", u_euro, rate, 1, "", false, true)); } else if(u->subtype() == SUBTYPE_ALIAS_UNIT) { ((AliasUnit*) u)->setExpression(rate); } } } } if(cur->children) { cur = cur->children; } else if(cur->next) { cur = cur->next; } else { cur = cur->parent; if(cur) { cur = cur->next; } } } xmlFreeDoc(doc); exchange_rates_warning_issued = false; return true; } bool Calculator::hasGnomeVFS() { if(has_gnomevfs >= 0) return has_gnomevfs > 0; gchar *gstr = g_find_program_in_path("gnomevfs-copy"); if(gstr) { g_free(gstr); has_gnomevfs = 1; return true; } g_free(gstr); has_gnomevfs = 0; return has_gnomevfs > 0; } bool Calculator::canFetch() { if(hasGnomeVFS()) return true; gchar *gstr = g_find_program_in_path("wget"); if(gstr) { g_free(gstr); return true; } return false; /*if(system("wget --version") == 0) { return true; } return false;*/ } string Calculator::getExchangeRatesFileName() { string homedir = getLocalDir(); mkdir(homedir.c_str(), S_IRWXU); return homedir + "eurofxref-daily.xml"; } string Calculator::getExchangeRatesUrl() { return "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"; } bool Calculator::fetchExchangeRates(int timeout, string wget_args) { int status = 0; string homedir = getLocalDir(); mkdir(homedir.c_str(), S_IRWXU); string cmdline; if(hasGnomeVFS()) { cmdline = "gnomevfs-copy http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"; cmdline += " "; cmdline += homedir; cmdline += "eurofxref-daily.xml"; } else { cmdline = "wget"; cmdline += " "; cmdline += "--timeout="; cmdline += i2s(timeout); cmdline += " "; cmdline += wget_args; cmdline += " "; cmdline += "--output-document="; cmdline += homedir; cmdline += "eurofxref-daily.xml"; cmdline += " "; cmdline += "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"; } if(!g_spawn_command_line_sync(cmdline.c_str(), NULL, NULL, NULL, NULL)) status = -1; if(status != 0) error(true, _("Failed to download exchange rates from ECB."), NULL); return status == 0; } bool Calculator::fetchExchangeRates(int timeout) { return fetchExchangeRates(timeout, "--quiet --tries=1"); } bool Calculator::checkExchangeRatesDate() { if(exchange_rates_warning_issued) return true; string homedir = getLocalDir(); homedir += "eurofxref-daily.xml"; bool up_to_date = false; struct stat stats; if(stat(homedir.c_str(), &stats) == 0) { if(time(NULL) - stats.st_mtime <= 604800) { up_to_date = true; } } if(!up_to_date) { error(false, _("It has been more than one week since the exchange rates last were updated."), NULL); exchange_rates_warning_issued = true; } return up_to_date; } bool Calculator::canPlot() { /*FILE *pipe = popen("gnuplot -", "w"); if(!pipe) { return false; } if(pclose(pipe) != 0) return false; pipe = popen("gnuplot -", "w"); if(!pipe) { return false; } fputs("show version\n", pipe); return pclose(pipe) == 0;*/ gchar *gstr = g_find_program_in_path("gnuplot"); if(gstr) { g_free(gstr); return true; } return false; } MathStructure Calculator::expressionToPlotVector(string expression, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector, string x_var, const ParseOptions &po) { Variable *v = getActiveVariable(x_var); MathStructure x_mstruct; if(v) x_mstruct = v; else x_mstruct = x_var; EvaluationOptions eo; eo.approximation = APPROXIMATION_APPROXIMATE; ParseOptions po2 = po; po2.read_precision = DONT_READ_PRECISION; eo.parse_options = po2; MathStructure y_vector(parse(expression, po2).generateVector(x_mstruct, min, max, steps, x_vector, eo)); if(y_vector.size() == 0) { CALCULATOR->error(true, _("Unable to generate plot data with current min, max and sampling rate."), NULL); } return y_vector; } MathStructure Calculator::expressionToPlotVector(string expression, float min, float max, int steps, MathStructure *x_vector, string x_var, const ParseOptions &po) { MathStructure min_mstruct(min), max_mstruct(max); EvaluationOptions eo; eo.approximation = APPROXIMATION_APPROXIMATE; ParseOptions po2 = po; po2.read_precision = DONT_READ_PRECISION; eo.parse_options = po2; MathStructure y_vector(expressionToPlotVector(expression, min_mstruct, max_mstruct, steps, x_vector, x_var, po2)); y_vector.eval(eo); if(y_vector.size() == 0) { CALCULATOR->error(true, _("Unable to generate plot data with current min, max and sampling rate."), NULL); } return y_vector; } MathStructure Calculator::expressionToPlotVector(string expression, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector, string x_var, const ParseOptions &po) { Variable *v = getActiveVariable(x_var); MathStructure x_mstruct; if(v) x_mstruct = v; else x_mstruct = x_var; EvaluationOptions eo; eo.approximation = APPROXIMATION_APPROXIMATE; ParseOptions po2 = po; po2.read_precision = DONT_READ_PRECISION; eo.parse_options = po2; MathStructure y_vector(parse(expression, po2).generateVector(x_mstruct, min, max, step, x_vector, eo)); if(y_vector.size() == 0) { CALCULATOR->error(true, _("Unable to generate plot data with current min, max and step size."), NULL); } return y_vector; } MathStructure Calculator::expressionToPlotVector(string expression, float min, float max, float step, MathStructure *x_vector, string x_var, const ParseOptions &po) { MathStructure min_mstruct(min), max_mstruct(max), step_mstruct(step); EvaluationOptions eo; eo.approximation = APPROXIMATION_APPROXIMATE; ParseOptions po2 = po; po2.read_precision = DONT_READ_PRECISION; eo.parse_options = po2; MathStructure y_vector(expressionToPlotVector(expression, min_mstruct, max_mstruct, step_mstruct, x_vector, x_var, po2)); y_vector.eval(eo); if(y_vector.size() == 0) { CALCULATOR->error(true, _("Unable to generate plot data with current min, max and step size."), NULL); } return y_vector; } MathStructure Calculator::expressionToPlotVector(string expression, const MathStructure &x_vector, string x_var, const ParseOptions &po) { Variable *v = getActiveVariable(x_var); MathStructure x_mstruct; if(v) x_mstruct = v; else x_mstruct = x_var; EvaluationOptions eo; eo.approximation = APPROXIMATION_APPROXIMATE; ParseOptions po2 = po; po2.read_precision = DONT_READ_PRECISION; eo.parse_options = po2; return parse(expression, po2).generateVector(x_mstruct, x_vector, eo).eval(eo); } bool Calculator::plotVectors(PlotParameters *param, const vector &y_vectors, const vector &x_vectors, vector &pdps, bool persistent) { string filename; string homedir = getLocalDir(); mkdir(homedir.c_str(), S_IRWXU); homedir += "tmp/"; mkdir(homedir.c_str(), S_IRWXU); string commandline_extra; string title; if(!param) { PlotParameters pp; param = &pp; } string plot; if(param->filename.empty()) { if(!param->color) { commandline_extra += " -mono"; } if(param->font.empty()) { commandline_extra += " -font \"-*-helvetica-bold-r-*-*-14-*-*-*-*-*-*-*\""; } plot += "set terminal pop\n"; } else { persistent = true; if(param->filetype == PLOT_FILETYPE_AUTO) { size_t i = param->filename.find("."); if(i == string::npos) { param->filetype = PLOT_FILETYPE_PNG; error(false, _("No extension in file name. Saving as PNG image."), NULL); } else { string ext = param->filename.substr(i + 1, param->filename.length() - (i + 1)); if(ext == "png") { param->filetype = PLOT_FILETYPE_PNG; } else if(ext == "ps") { param->filetype = PLOT_FILETYPE_PS; } else if(ext == "eps") { param->filetype = PLOT_FILETYPE_EPS; } else if(ext == "svg") { param->filetype = PLOT_FILETYPE_SVG; } else if(ext == "fig") { param->filetype = PLOT_FILETYPE_FIG; } else if(ext == "tex") { param->filetype = PLOT_FILETYPE_LATEX; } else { param->filetype = PLOT_FILETYPE_PNG; error(false, _("Unknown extension in file name. Saving as PNG image."), NULL); } } } plot += "set terminal "; switch(param->filetype) { case PLOT_FILETYPE_FIG: { plot += "fig "; if(param->color) { plot += "color"; } else { plot += "monochrome"; } break; } case PLOT_FILETYPE_SVG: { plot += "svg"; break; } case PLOT_FILETYPE_LATEX: { plot += "latex "; break; } case PLOT_FILETYPE_PS: { plot += "postscript "; if(param->color) { plot += "color"; } else { plot += "monochrome"; } plot += " \"Times\""; break; } case PLOT_FILETYPE_EPS: { plot += "postscript eps "; if(param->color) { plot += "color"; } else { plot += "monochrome"; } plot += " \"Times\""; break; } default: { plot += "png "; if(param->color) { plot += "color"; } else { plot += "monochrome"; } break; } } plot += "\nset output \""; plot += param->filename; plot += "\"\n"; } switch(param->legend_placement) { case PLOT_LEGEND_NONE: {plot += "set nokey\n"; break;} case PLOT_LEGEND_TOP_LEFT: {plot += "set key top left\n"; break;} case PLOT_LEGEND_TOP_RIGHT: {plot += "set key top right\n"; break;} case PLOT_LEGEND_BOTTOM_LEFT: {plot += "set key bottom left\n"; break;} case PLOT_LEGEND_BOTTOM_RIGHT: {plot += "set key bottom right\n"; break;} case PLOT_LEGEND_BELOW: {plot += "set key below\n"; break;} case PLOT_LEGEND_OUTSIDE: {plot += "set key outside\n"; break;} } if(!param->x_label.empty()) { title = param->x_label; gsub("\"", "\\\"", title); plot += "set xlabel \""; plot += title; plot += "\"\n"; } if(!param->y_label.empty()) { string title = param->y_label; gsub("\"", "\\\"", title); plot += "set ylabel \""; plot += title; plot += "\"\n"; } if(!param->title.empty()) { title = param->title; gsub("\"", "\\\"", title); plot += "set title \""; plot += title; plot += "\"\n"; } if(param->grid) { plot += "set grid\n"; } if(param->y_log) { plot += "set logscale y "; plot += i2s(param->y_log_base); plot += "\n"; } if(param->x_log) { plot += "set logscale x "; plot += i2s(param->x_log_base); plot += "\n"; } if(param->show_all_borders) { plot += "set border 15\n"; } else { bool xaxis2 = false, yaxis2 = false; for(size_t i = 0; i < pdps.size(); i++) { if(pdps[i] && pdps[i]->xaxis2) { xaxis2 = true; } if(pdps[i] && pdps[i]->yaxis2) { yaxis2 = true; } } if(xaxis2 && yaxis2) { plot += "set border 15\nset x2tics\nset y2tics\n"; } else if(xaxis2) { plot += "set border 7\nset x2tics\n"; } else if(yaxis2) { plot += "set border 11\nset y2tics\n"; } else { plot += "set border 3\n"; } plot += "set xtics nomirror\nset ytics nomirror\n"; } plot += "plot "; for(size_t i = 0; i < y_vectors.size(); i++) { if(!y_vectors[i].isUndefined()) { if(i != 0) { plot += ","; } plot += "\""; plot += homedir; plot += "gnuplot_data"; plot += i2s(i + 1); plot += "\""; if(i < pdps.size()) { switch(pdps[i]->smoothing) { case PLOT_SMOOTHING_UNIQUE: {plot += " smooth unique"; break;} case PLOT_SMOOTHING_CSPLINES: {plot += " smooth csplines"; break;} case PLOT_SMOOTHING_BEZIER: {plot += " smooth bezier"; break;} case PLOT_SMOOTHING_SBEZIER: {plot += " smooth sbezier"; break;} default: {} } if(pdps[i]->xaxis2 && pdps[i]->yaxis2) { plot += " axis x2y2"; } else if(pdps[i]->xaxis2) { plot += " axis x2y1"; } else if(pdps[i]->yaxis2) { plot += " axis x1y2"; } if(!pdps[i]->title.empty()) { title = pdps[i]->title; gsub("\"", "\\\"", title); plot += " title \""; plot += title; plot += "\""; } switch(pdps[i]->style) { case PLOT_STYLE_LINES: {plot += " with lines"; break;} case PLOT_STYLE_POINTS: {plot += " with points"; break;} case PLOT_STYLE_POINTS_LINES: {plot += " with linespoints"; break;} case PLOT_STYLE_BOXES: {plot += " with boxes"; break;} case PLOT_STYLE_HISTOGRAM: {plot += " with histeps"; break;} case PLOT_STYLE_STEPS: {plot += " with steps"; break;} case PLOT_STYLE_CANDLESTICKS: {plot += " with candlesticks"; break;} case PLOT_STYLE_DOTS: {plot += " with dots"; break;} } if(param->linewidth < 1) { plot += " lw 2"; } else { plot += " lw "; plot += i2s(param->linewidth); } } } } plot += "\n"; string filename_data; string plot_data; PrintOptions po; po.number_fraction_format = FRACTION_DECIMAL; po.decimalpoint_sign = "."; po.comma_sign = ","; for(size_t serie = 0; serie < y_vectors.size(); serie++) { if(!y_vectors[serie].isUndefined()) { filename_data = homedir; filename_data += "gnuplot_data"; filename_data += i2s(serie + 1); FILE *fdata = fopen(filename_data.c_str(), "w+"); if(!fdata) { error(true, _("Could not create temporary file %s"), filename_data.c_str(), NULL); return false; } plot_data = ""; int non_numerical = 0, non_real = 0; string str = ""; for(size_t i = 1; i <= y_vectors[serie].countChildren(); i++) { bool invalid_nr = false; if(!y_vectors[serie].getChild(i)->isNumber()) { invalid_nr = true; non_numerical++; if(non_numerical == 1) str = y_vectors[serie].getChild(i)->print(po); } else if(!y_vectors[serie].getChild(i)->number().isReal()) { invalid_nr = true; non_real++; if(non_numerical + non_real == 1) str = y_vectors[serie].getChild(i)->print(po); } if(serie < x_vectors.size() && !x_vectors[serie].isUndefined() && x_vectors[serie].countChildren() == y_vectors[serie].countChildren()) { if(!x_vectors[serie].getChild(i)->isNumber()) { invalid_nr = true; non_numerical++; if(non_numerical == 1) str = x_vectors[serie].getChild(i)->print(po); } else if(!x_vectors[serie].getChild(i)->number().isReal()) { invalid_nr = true; non_real++; if(non_numerical + non_real == 1) str = x_vectors[serie].getChild(i)->print(po); } if(!invalid_nr) { plot_data += x_vectors[serie].getChild(i)->print(po); plot_data += " "; } } if(!invalid_nr) { plot_data += y_vectors[serie].getChild(i)->print(po); plot_data += "\n"; } } if(non_numerical > 0 || non_real > 0) { string stitle; if(serie < pdps.size() && !pdps[serie]->title.empty()) { stitle = pdps[serie]->title.c_str(); } else { stitle = i2s(serie).c_str(); } if(non_numerical > 0) { error(true, _("Series %s contains non-numerical data (\"%s\" first of %s) which can not be properly plotted."), stitle.c_str(), str.c_str(), i2s(non_numerical).c_str(), NULL); } else { error(true, _("Series %s contains non-real data (\"%s\" first of %s) which can not be properly plotted."), stitle.c_str(), str.c_str(), i2s(non_real).c_str(), NULL); } } fputs(plot_data.c_str(), fdata); fflush(fdata); fclose(fdata); } } return invokeGnuplot(plot, commandline_extra, persistent); } bool Calculator::invokeGnuplot(string commands, string commandline_extra, bool persistent) { FILE *pipe = NULL; if(!b_gnuplot_open || !gnuplot_pipe || persistent || commandline_extra != gnuplot_cmdline) { if(!persistent) { closeGnuplot(); } string commandline = "gnuplot"; if(persistent) { commandline += " -persist"; } commandline += commandline_extra; commandline += " -"; pipe = popen(commandline.c_str(), "w"); if(!pipe) { error(true, _("Failed to invoke gnuplot. Make sure that you have gnuplot installed in your path."), NULL); return false; } if(!persistent && pipe) { gnuplot_pipe = pipe; b_gnuplot_open = true; gnuplot_cmdline = commandline_extra; } } else { pipe = gnuplot_pipe; } if(!pipe) { return false; } if(!persistent) { fputs("clear\n", pipe); fputs("reset\n", pipe); } fputs(commands.c_str(), pipe); fflush(pipe); if(persistent) { return pclose(pipe) == 0; } return true; } bool Calculator::closeGnuplot() { if(gnuplot_pipe) { int rv = pclose(gnuplot_pipe); gnuplot_pipe = NULL; b_gnuplot_open = false; return rv == 0; } gnuplot_pipe = NULL; b_gnuplot_open = false; return true; } bool Calculator::gnuplotOpen() { return b_gnuplot_open && gnuplot_pipe; } libqalculate-0.9.7/libqalculate/Unit.cc0000644000175100017510000006021311305546373015015 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #include "support.h" #include "Unit.h" #include "util.h" #include "Calculator.h" #include "MathStructure.h" #include "Prefix.h" Unit::Unit(string cat_, string name_, string plural_, string singular_, string title_, bool is_local, bool is_builtin, bool is_active) : ExpressionItem(cat_, "", title_, "", is_local, is_builtin, is_active) { remove_blank_ends(plural_); remove_blank_ends(singular_); if(!name_.empty()) { names.resize(1); names[0].name = name_; names[0].unicode = false; names[0].abbreviation = true; names[0].case_sensitive = true; names[0].suffix = false; names[0].avoid_input = false; names[0].reference = true; names[0].plural = false; } if(!singular_.empty()) { names.resize(names.size() + 1); names[names.size() - 1].name = singular_; names[names.size() - 1].unicode = false; names[names.size() - 1].abbreviation = false; names[names.size() - 1].case_sensitive = text_length_is_one(names[names.size() - 1].name); names[names.size() - 1].suffix = false; names[names.size() - 1].avoid_input = false; names[names.size() - 1].reference = false; names[names.size() - 1].plural = false; } if(!plural_.empty()) { names.resize(names.size() + 1); names[names.size() - 1].name = plural_; names[names.size() - 1].unicode = false; names[names.size() - 1].abbreviation = false; names[names.size() - 1].case_sensitive = text_length_is_one(names[names.size() - 1].name); names[names.size() - 1].suffix = false; names[names.size() - 1].avoid_input = false; names[names.size() - 1].reference = false; names[names.size() - 1].plural = true; } b_si = false; } Unit::Unit() { b_si = false; } Unit::Unit(const Unit *unit) { set(unit); } Unit::~Unit() {} ExpressionItem *Unit::copy() const { return new Unit(this); } void Unit::set(const ExpressionItem *item) { if(item->type() == TYPE_UNIT) { b_si = ((Unit*) item)->isSIUnit(); ssystem = ((Unit*) item)->system(); } ExpressionItem::set(item); } bool Unit::isSIUnit() const { return b_si; } void Unit::setAsSIUnit() { if(!b_si) { b_si = true; ssystem == "SI"; setChanged(true); } } void Unit::setSystem(string s_system) { if(s_system != ssystem) { ssystem = s_system; if(ssystem == "SI" || ssystem == "si" || ssystem == "Si") { b_si = true; } else { b_si = false; } setChanged(true); } } const string &Unit::system() const { return ssystem; } bool Unit::isCurrency() const { return baseUnit() == CALCULATOR->u_euro; } bool Unit::isUsedByOtherUnits() const { return CALCULATOR->unitIsUsedByOtherUnits(this); } string Unit::print(bool plural_, bool short_, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { return preferredName(short_, use_unicode, plural_, false, can_display_unicode_string_function, can_display_unicode_string_arg).name; } const string &Unit::plural(bool return_singular_if_no_plural, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { const ExpressionName *ename = &preferredName(false, use_unicode, true, false, can_display_unicode_string_function, can_display_unicode_string_arg); if(!return_singular_if_no_plural && !ename->plural) return empty_string; return ename->name; } const string &Unit::singular(bool return_abbreviation_if_no_singular, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { const ExpressionName *ename = &preferredName(false, use_unicode, false, false, can_display_unicode_string_function, can_display_unicode_string_arg); if(!return_abbreviation_if_no_singular && ename->abbreviation) return empty_string; return ename->name; } const string &Unit::abbreviation(bool return_singular_if_no_abbreviation, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { const ExpressionName *ename = &preferredName(true, use_unicode, false, false, can_display_unicode_string_function, can_display_unicode_string_arg); if(!return_singular_if_no_abbreviation && !ename->abbreviation) return empty_string; return ename->name; } Unit* Unit::baseUnit() const { return (Unit*) this; } MathStructure &Unit::convertToBaseUnit(MathStructure &mvalue, MathStructure&) const { return mvalue; } MathStructure &Unit::convertFromBaseUnit(MathStructure &mvalue, MathStructure&) const { return mvalue; } MathStructure &Unit::convertToBaseUnit(MathStructure &mvalue) const { return mvalue; } MathStructure &Unit::convertFromBaseUnit(MathStructure &mvalue) const { return mvalue; } MathStructure Unit::convertToBaseUnit() const { return MathStructure(1, 1); } MathStructure Unit::convertFromBaseUnit() const { return MathStructure(1, 1); } int Unit::baseExponent(int exp) const { return exp; } int Unit::type() const { return TYPE_UNIT; } int Unit::subtype() const { return SUBTYPE_BASE_UNIT; } bool Unit::isChildOf(Unit*) const { return false; } bool Unit::isParentOf(Unit *u) const { return u != this && u->baseUnit() == this; } bool Unit::hasComplexRelationTo(Unit *u) const { if(u == this || u->baseUnit() != this) return false; Unit *fbu = u; if(fbu->subtype() != SUBTYPE_ALIAS_UNIT) return false; while(1) { if(fbu == this) return false; if(((AliasUnit*) fbu)->hasComplexExpression()) return true; if(fbu->subtype() != SUBTYPE_ALIAS_UNIT) return false; fbu = (Unit*) ((AliasUnit*) fbu)->firstBaseUnit(); } } MathStructure Unit::convert(Unit *u, bool *converted) const { MathStructure mexp(1, 1); MathStructure mvalue(1, 1); bool b = convert(u, mvalue, mexp); if(converted) *converted = b; return mvalue; } bool Unit::convert(Unit *u, MathStructure &mvalue) const { MathStructure mexp(1, 1); return convert(u, mvalue, mexp); } bool Unit::convert(Unit *u, MathStructure &mvalue, MathStructure &mexp) const { if(u == this) { return true; } else if(u->baseUnit() == baseUnit()) { u->convertToBaseUnit(mvalue, mexp); convertFromBaseUnit(mvalue, mexp); if(isCurrency()) { CALCULATOR->checkExchangeRatesDate(); } return true; } /*} else if(u->subtype() == SUBTYPE_COMPOSITE_UNIT) { bool b2 = false; CompositeUnit *cu = (CompositeUnit*) u; for(size_t i = 1; i <= cu->countUnits(); i++) { convert(cu->getInternal(i), mvalue, mexp, &b2); if(b2) b = true; } }*/ //if(CALCULATOR->alwaysExact() && mvalue->isApproximate()) b = false; return false; } AliasUnit::AliasUnit(string cat_, string name_, string plural_, string short_name_, string title_, Unit *alias, string relation, int exp, string inverse, bool is_local, bool is_builtin, bool is_active) : Unit(cat_, name_, plural_, short_name_, title_, is_local, is_builtin, is_active) { o_unit = (Unit*) alias; remove_blank_ends(relation); remove_blank_ends(inverse); svalue = relation; sinverse = inverse; i_exp = exp; } AliasUnit::AliasUnit() { o_unit = NULL; svalue = ""; sinverse = ""; i_exp = 1; } AliasUnit::AliasUnit(const AliasUnit *unit) { set(unit); } AliasUnit::~AliasUnit() {} ExpressionItem *AliasUnit::copy() const { return new AliasUnit(this); } void AliasUnit::set(const ExpressionItem *item) { if(item->type() == TYPE_UNIT) { Unit::set(item); if(((Unit*) item)->subtype() == SUBTYPE_ALIAS_UNIT) { AliasUnit *u = (AliasUnit*) item; o_unit = (Unit*) u->firstBaseUnit(); i_exp = u->firstBaseExponent(); svalue = u->expression(); sinverse = u->inverseExpression(); } } else { ExpressionItem::set(item); } } Unit* AliasUnit::baseUnit() const { return o_unit->baseUnit(); } Unit* AliasUnit::firstBaseUnit() const { return o_unit; } void AliasUnit::setBaseUnit(Unit *alias) { o_unit = (Unit*) alias; setChanged(true); } string AliasUnit::expression() const { return svalue; } string AliasUnit::inverseExpression() const { return sinverse; } void AliasUnit::setExpression(string relation) { remove_blank_ends(relation); if(relation.empty()) { svalue = "1"; } else { svalue = relation; } setChanged(true); } void AliasUnit::setInverseExpression(string inverse) { remove_blank_ends(inverse); sinverse = inverse; setChanged(true); } MathStructure &AliasUnit::convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const { convertToFirstBaseUnit(mvalue, mexp); return o_unit->convertToBaseUnit(mvalue, mexp); } MathStructure &AliasUnit::convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const { Unit *u = (Unit*) baseUnit(); AliasUnit *u2; while(true) { u2 = (AliasUnit*) this; while(true) { if(u2->firstBaseUnit() == u) { break; } else { u2 = (AliasUnit*) u2->firstBaseUnit(); } } u = u2; u2->convertFromFirstBaseUnit(mvalue, mexp); if(u == this) break; } return mvalue; } MathStructure &AliasUnit::convertToBaseUnit(MathStructure &mvalue) const { MathStructure mexp(1, 1); return convertToBaseUnit(mvalue, mexp); } MathStructure &AliasUnit::convertFromBaseUnit(MathStructure &mvalue) const { MathStructure mexp(1, 1); return convertFromBaseUnit(mvalue, mexp); } MathStructure AliasUnit::convertToBaseUnit() const { MathStructure mexp(1, 1); MathStructure mvalue(1, 1); return convertToBaseUnit(mvalue, mexp); } MathStructure AliasUnit::convertFromBaseUnit() const { MathStructure mexp(1, 1); MathStructure mvalue(1, 1); return convertFromBaseUnit(mvalue, mexp); } int AliasUnit::baseExponent(int exp) const { return o_unit->baseExponent(exp * i_exp); } MathStructure &AliasUnit::convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const { if(i_exp != 1) mexp /= i_exp; ParseOptions po; if(isApproximate() && precision() < 1) { po.read_precision = ALWAYS_READ_PRECISION; } if(sinverse.empty()) { if(svalue.find("\\x") != string::npos) { string stmp = svalue; string stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; int x_id = CALCULATOR->addId(new MathStructure(mvalue), true); stmp2 += i2s(x_id); stmp2 += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\x", stmp2, stmp); stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; int y_id = CALCULATOR->addId(new MathStructure(mexp), true); stmp2 += i2s(y_id); stmp2 += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\y", stmp2, stmp); CALCULATOR->parse(&mvalue, stmp, po); CALCULATOR->delId(x_id); CALCULATOR->delId(y_id); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, svalue, po); if(!mexp.isOne()) mstruct->raise(mexp); mvalue.divide_nocopy(mstruct, true); } } else { if(sinverse.find("\\x") != string::npos) { string stmp = sinverse; string stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; int x_id = CALCULATOR->addId(new MathStructure(mvalue), true); stmp2 += i2s(x_id); stmp2 += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\x", stmp2, stmp); stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; int y_id = CALCULATOR->addId(new MathStructure(mexp), true); stmp2 += i2s(y_id); stmp2 += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\y", stmp2, stmp); CALCULATOR->parse(&mvalue, stmp, po); CALCULATOR->delId(x_id); CALCULATOR->delId(y_id); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, sinverse, po); if(!mexp.isOne()) mstruct->raise(mexp); mvalue.multiply_nocopy(mstruct, true); } } if(precision() > 0 && (mvalue.precision() < 1 || precision() < mvalue.precision())) mvalue.setPrecision(precision()); if(isApproximate()) mvalue.setApproximate(); return mvalue; } MathStructure &AliasUnit::convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const { ParseOptions po; if(isApproximate() && precision() < 1) { po.read_precision = ALWAYS_READ_PRECISION; } if(svalue.find("\\x") != string::npos) { string stmp = svalue; string stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; int x_id = CALCULATOR->addId(new MathStructure(mvalue), true); stmp2 += i2s(x_id); stmp2 += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\x", stmp2, stmp); stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; int y_id = CALCULATOR->addId(new MathStructure(mexp), true); stmp2 += i2s(y_id); stmp2 += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\y", stmp2, stmp); CALCULATOR->parse(&mvalue, stmp, po); CALCULATOR->delId(x_id); CALCULATOR->delId(y_id); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, svalue, po); if(!mexp.isOne()) mstruct->raise(mexp); mvalue.multiply_nocopy(mstruct, true); } if(precision() > 0 && (mvalue.precision() < 1 || precision() < mvalue.precision())) mvalue.setPrecision(precision()); if(isApproximate()) mvalue.setApproximate(); if(i_exp != 1) mexp.multiply(i_exp); return mvalue; } void AliasUnit::setExponent(int exp) { i_exp = exp; setChanged(true); } int AliasUnit::firstBaseExponent() const { return i_exp; } int AliasUnit::subtype() const { return SUBTYPE_ALIAS_UNIT; } bool AliasUnit::isChildOf(Unit *u) const { if(u == this) return false; if(baseUnit() == u) return true; if(u->baseUnit() != baseUnit()) return false; Unit *u2 = (Unit*) this; while(1) { u2 = (Unit*) ((AliasUnit*) u2)->firstBaseUnit(); if(u == u2) return true; if(u2->subtype() != SUBTYPE_ALIAS_UNIT) return false; } return false; } bool AliasUnit::isParentOf(Unit *u) const { if(u == this) return false; if(u->baseUnit() != baseUnit()) return false; while(1) { if(u->subtype() != SUBTYPE_ALIAS_UNIT) return false; u = ((AliasUnit*) u)->firstBaseUnit(); if(u == this) return true; } return false; } bool AliasUnit::hasComplexExpression() const { return svalue.find("\\x") != string::npos; } bool AliasUnit::hasComplexRelationTo(Unit *u) const { if(u == this || u->baseUnit() != baseUnit()) return false; if(isParentOf(u)) { Unit *fbu = u; while(true) { if((const Unit*) fbu == this) return false; if(((AliasUnit*) fbu)->hasComplexExpression()) return true; if(fbu->subtype() != SUBTYPE_ALIAS_UNIT) return false; fbu = (Unit*) ((AliasUnit*) fbu)->firstBaseUnit(); } } else if(isChildOf(u)) { Unit *fbu = (Unit*) this; if(fbu->subtype() != SUBTYPE_ALIAS_UNIT) return false; while(true) { if((const Unit*) fbu == u) return false; if(((AliasUnit*) fbu)->hasComplexExpression()) return true; if(fbu->subtype() != SUBTYPE_ALIAS_UNIT) return false; fbu = (Unit*) ((AliasUnit*) fbu)->firstBaseUnit(); } } else { return hasComplexRelationTo(baseUnit()) || u->hasComplexRelationTo(u->baseUnit()); } } AliasUnit_Composite::AliasUnit_Composite(Unit *alias, int exp, Prefix *prefix_) : AliasUnit("", alias->name(), alias->plural(false), alias->singular(false), "", alias, "", exp, "") { prefixv = (Prefix*) prefix_; } AliasUnit_Composite::AliasUnit_Composite(const AliasUnit_Composite *unit) { set(unit); } AliasUnit_Composite::~AliasUnit_Composite() {} ExpressionItem *AliasUnit_Composite::copy() const { return new AliasUnit_Composite(this); } void AliasUnit_Composite::set(const ExpressionItem *item) { if(item->type() == TYPE_UNIT) { if(((Unit*) item)->subtype() == SUBTYPE_ALIAS_UNIT) { AliasUnit::set(item); prefixv = (Prefix*) ((AliasUnit_Composite*) item)->prefix(); } else { Unit::set(item); } } else { ExpressionItem::set(item); } } string AliasUnit_Composite::print(bool plural_, bool short_, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { string str = ""; if(prefixv) { str += prefixv->name(short_, use_unicode, can_display_unicode_string_function, can_display_unicode_string_arg); } str += preferredName(short_, use_unicode, plural_, false, can_display_unicode_string_function, can_display_unicode_string_arg).name; return str; } Prefix *AliasUnit_Composite::prefix() const { return prefixv; } int AliasUnit_Composite::prefixExponent() const { if(prefixv && prefixv->type() == PREFIX_DECIMAL) return ((DecimalPrefix*) prefixv)->exponent(); if(prefixv && prefixv->type() == PREFIX_BINARY) return ((BinaryPrefix*) prefixv)->exponent(); return 0; } void AliasUnit_Composite::set(Unit *u, int exp, Prefix *prefix_) { setBaseUnit(u); setExponent(exp); prefixv = (Prefix*) prefix_; } MathStructure &AliasUnit_Composite::convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const { if(prefixv) { MathStructure *mstruct = new MathStructure(prefixv->value()); if(!mexp.isOne()) mstruct->raise(mexp); mvalue.multiply_nocopy(mstruct, true); } if(i_exp != 1) mexp.multiply(i_exp); return mvalue; } MathStructure &AliasUnit_Composite::convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const { if(i_exp != 1) mexp /= i_exp; if(prefixv) { MathStructure *mstruct = new MathStructure(prefixv->value()); if(!mexp.isOne()) mstruct->raise(mexp); mvalue.divide_nocopy(mstruct, true); } return mvalue; } CompositeUnit::CompositeUnit(string cat_, string name_, string title_, string base_expression_, bool is_local, bool is_builtin, bool is_active) : Unit(cat_, name_, "", "", title_, is_local, is_builtin, is_active) { setBaseExpression(base_expression_); setChanged(false); } CompositeUnit::CompositeUnit(const CompositeUnit *unit) { set(unit); } CompositeUnit::~CompositeUnit() { clear(); } ExpressionItem *CompositeUnit::copy() const { return new CompositeUnit(this); } void CompositeUnit::set(const ExpressionItem *item) { if(item->type() == TYPE_UNIT) { Unit::set(item); if(((Unit*) item)->subtype() == SUBTYPE_COMPOSITE_UNIT) { CompositeUnit *cu = (CompositeUnit*) item; for(size_t i = 1; i <= cu->countUnits(); i++) { int exp = 1; Prefix *p = NULL; Unit *u = cu->get(i, &exp, &p); units.push_back(new AliasUnit_Composite(u, exp, p)); } } } else { ExpressionItem::set(item); } } void CompositeUnit::add(Unit *u, int exp, Prefix *prefix) { bool b = false; for(size_t i = 0; i < units.size(); i++) { if(exp > units[i]->firstBaseExponent()) { units.insert(units.begin() + i, new AliasUnit_Composite(u, exp, prefix)); b = true; break; } } if(!b) { units.push_back(new AliasUnit_Composite(u, exp, prefix)); } } Unit *CompositeUnit::get(size_t index, int *exp, Prefix **prefix) const { if(index > 0 && index <= units.size()) { if(exp) *exp = units[index - 1]->firstBaseExponent(); if(prefix) *prefix = (Prefix*) units[index - 1]->prefix(); return (Unit*) units[index - 1]->firstBaseUnit(); } return NULL; } void CompositeUnit::setExponent(size_t index, int exp) { if(index > 0 && index <= units.size()) { bool b = exp > units[index - 1]->firstBaseExponent(); units[index - 1]->setExponent(exp); if(b) { for(size_t i = 0; i < index - 1; i++) { if(exp > units[i]->firstBaseExponent()) { AliasUnit_Composite *u = units[index - 1]; units.erase(units.begin() + (index - 1)); units.insert(units.begin() + i, u); break; } } } else { for(size_t i = units.size() - 1; i > index - 1; i--) { if(exp < units[i]->firstBaseExponent()) { AliasUnit_Composite *u = units[index - 1]; units.insert(units.begin() + i, u); units.erase(units.begin() + (index - 1)); break; } } } } } void CompositeUnit::setPrefix(size_t index, Prefix *prefix) { if(index > 0 && index <= units.size()) { units[index - 1]->set(units[index - 1]->firstBaseUnit(), units[index - 1]->firstBaseExponent(), prefix); } } size_t CompositeUnit::countUnits() const { return units.size(); } size_t CompositeUnit::find(Unit *u) const { for(size_t i = 0; i < units.size(); i++) { if(units[i]->firstBaseUnit() == u) { return i + 1; } } return 0; } void CompositeUnit::del(size_t index) { if(index > 0 && index <= units.size()) { delete units[index - 1]; units.erase(units.begin() + (index - 1)); } } string CompositeUnit::print(bool plural_, bool short_, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { string str = ""; bool b = false, b2 = false; for(size_t i = 0; i < units.size(); i++) { if(units[i]->firstBaseExponent() != 0) { if(!b && units[i]->firstBaseExponent() < 0 && i > 0) { str += "/"; b = true; if(i < units.size() - 1) { b2 = true; str += "("; } } else { // if(i > 0) str += "*"; if(i > 0) str += " "; } if(plural_ && i == 0 && units[i]->firstBaseExponent() > 0) { str += units[i]->print(true, short_, use_unicode, can_display_unicode_string_function, can_display_unicode_string_arg); } else { str += units[i]->print(false, short_, use_unicode, can_display_unicode_string_function, can_display_unicode_string_arg); } if(b) { if(units[i]->firstBaseExponent() != -1) { str += "^"; str += i2s(-units[i]->firstBaseExponent()); } } else { if(units[i]->firstBaseExponent() != 1) { str += "^"; str += i2s(units[i]->firstBaseExponent()); } } } } if(b2) str += ")"; return str; } int CompositeUnit::subtype() const { return SUBTYPE_COMPOSITE_UNIT; } bool CompositeUnit::containsRelativeTo(Unit *u) const { if(u == this) return false; CompositeUnit *cu; for(size_t i = 0; i < units.size(); i++) { if(u == units[i] || u->baseUnit() == units[i]->baseUnit()) return true; if(units[i]->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { cu = (CompositeUnit*) units[i]->baseUnit(); if(cu->containsRelativeTo(u)) return true; } } if(u->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { cu = (CompositeUnit*) u->baseUnit(); for(size_t i = 1; i <= cu->countUnits(); i++) { if(containsRelativeTo(cu->get(i)->baseUnit())) return true; } return false; } return false; } MathStructure CompositeUnit::generateMathStructure(bool make_division) const { MathStructure mstruct; bool has_p = false; for(size_t i = 0; i < units.size(); i++) { if(units[i]->prefix()) { has_p = true; break; } } MathStructure mden; for(size_t i = 0; i < units.size(); i++) { MathStructure mstruct2; if(!has_p || units[i]->prefix()) { mstruct2.set(units[i]->firstBaseUnit(), units[i]->prefix()); } else { mstruct2.set(units[i]->firstBaseUnit(), CALCULATOR->decimal_null_prefix); } if(make_division && units[i]->firstBaseExponent() < 0) { if(units[i]->firstBaseExponent() != -1) { mstruct2 ^= -units[i]->firstBaseExponent(); } } else if(units[i]->firstBaseExponent() != 1) { mstruct2 ^= units[i]->firstBaseExponent(); } if(i == 0) { if(make_division && units[i]->firstBaseExponent() < 0) { mstruct = 1; mden = mstruct2; } else { mstruct = mstruct2; } } else if(make_division && units[i]->firstBaseExponent() < 0) { if(mden.isZero()) { mden = mstruct2; } else { mden *= mstruct2; } } else { mstruct *= mstruct2; } } if(make_division && !mden.isZero()) { mstruct.transform(STRUCT_DIVISION, mden); } return mstruct; } void CompositeUnit::setBaseExpression(string base_expression_) { clear(); if(base_expression_.empty()) { setChanged(true); return; } EvaluationOptions eo; eo.approximation = APPROXIMATION_EXACT; eo.sync_units = false; eo.keep_prefixes = true; eo.structuring = STRUCTURING_NONE; eo.reduce_divisions = false; ParseOptions po; po.variables_enabled = false; po.functions_enabled = false; po.unknowns_enabled = false; MathStructure mstruct; bool had_errors = false; CALCULATOR->beginTemporaryStopMessages(); CALCULATOR->parse(&mstruct, base_expression_, po); mstruct.eval(eo); if(CALCULATOR->endTemporaryStopMessages() > 0) had_errors = true; if(mstruct.isUnit()) { add(mstruct.unit(), 1, mstruct.prefix()); } else if(mstruct.isPower() && mstruct[0].isUnit() && mstruct[1].isInteger()) { add(mstruct[0].unit(), mstruct[1].number().intValue(), mstruct[0].prefix()); } else if(mstruct.isMultiplication()) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isUnit()) { add(mstruct[i].unit(), 1, mstruct[i].prefix()); } else if(mstruct[i].isPower() && mstruct[i][0].isUnit() && mstruct[i][1].isInteger()) { add(mstruct[i][0].unit(), mstruct[i][1].number().intValue(), mstruct[i][0].prefix()); } else { had_errors = true; } } } else { had_errors = true; } if(had_errors) CALCULATOR->error(false, _("Error(s) in unitexpression."), NULL); setChanged(true); } void CompositeUnit::clear() { for(size_t i = 0; i < units.size(); i++) { delete units[i]; } units.clear(); } libqalculate-0.9.7/libqalculate/ExpressionItem.h0000644000175100017510000003361011305546372016716 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #ifndef EXPRESSIONITEM_H #define EXPRESSIONITEM_H #include /** @file */ /// A name for an expression item (function, variable or unit) /** An expression name has a text string representing a name and boolean values describing the names properties. */ struct ExpressionName { /// If the name is an abbreviation. bool abbreviation; /// If the name has a suffix. If set to true, the part of the name after an underscore should be treated as a suffix. bool suffix; /// If the name contains unicode characters. bool unicode; /// If the name is in plural form. bool plural; /// If the name shall be used as a fixed reference. If this is set to true, the name will kept as it is in addition to translations of it. bool reference; /// If the name is unsuitable for user input. bool avoid_input; /// If the name is case sensitive. The default behavior is that abbreviations are case sensitive and other names are not. bool case_sensitive; /// The name. string name; /** Create an empty expression name. All properties are set to false. */ ExpressionName(); /** Create an expression name. All properties are set to false, unless the name only has one character in which case abbreviation and case_sesnsitive is set to true. * * @param sname The name. */ ExpressionName(string sname); void operator = (const ExpressionName &ename); bool operator == (const ExpressionName &ename) const; bool operator != (const ExpressionName &ename) const; }; /// Abstract base class for functions, variables and units. /** * Expression items have one or more names used to reference it in mathematical expressions and display them in a result. * Each name must be fully unique, with the exception that functions can have names used by other types of items * (for example "min" is used as a name for the minute unit but also for a function returning smallest value in a vector). * * Items have an optional title and description for information to the end user. * The categoy property is used to organize items, so that the end user can easily find them. * Subcategories are separated by a slash, '/' (ex. "Physical Constants/Electromagnetic Constants"). * * A local item is created/edited by the end user. * * A builtin item has defining properties that can/should not be edited by the user and is usually an item not loaded from the definition files. * * An inactive item can not be used in expressions and can share the name of an active item. * * The hidden propery defines if the item should be hidden from the end user. * * Before an item can be used in expressions, it must be added to the Calculator object using CALCULATOR->addExpressionItem(). * It is then said to be registered. * * To delete an ExpressionItem object you should use destroy() to make sure that the item is removed from the Calculator and does not have any referrer. * */ class ExpressionItem { protected: string scat, stitle, sdescr; bool b_local, b_changed, b_builtin, b_approx, b_active, b_registered, b_hidden, b_destroyed; int i_ref, i_precision; vector v_refs; vector names; public: ExpressionItem(string cat_, string name_, string title_ = "", string descr_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); ExpressionItem(); virtual ~ExpressionItem(); virtual ExpressionItem *copy() const = 0; virtual void set(const ExpressionItem *item); virtual bool destroy(); bool isRegistered() const; /// For internal use. void setRegistered(bool is_registered); virtual const string &name(bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual const string &referenceName() const; /** Returns the name that best fulfils provided criterias. If two names are equally preferred, the one with lowest index is returned. * * @param abbreviation If an abbreviated name is preferred. * @param use_unicode If a name with unicode characters can be displayed/is preferred (prioritized if false). * @param plural If a name in plural form is preferred. * @param reference If a reference name is preferred (ignored if false). * @param can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected. * @param can_display_unicode_string_arg Argument to pass to the above test function. * @returns The preferred name. */ virtual const ExpressionName &preferredName(bool abbreviation = false, bool use_unicode = false, bool plural = false, bool reference = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; /** Returns the name that best fulfils provided criterias and is suitable for user input. If two names are equally preferred, the one with lowest index is returned. * * @param abbreviation If an abbreviated name is preferred. * @param use_unicode If a name with unicode characters can be displayed/is preferred (prioritized if false). * @param plural If a name in plural form is preferred. * @param reference If a reference name is preferred (ignored if false). * @param can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected. * @param can_display_unicode_string_arg Argument to pass to the above test function. * @returns The preferred name. */ virtual const ExpressionName &preferredInputName(bool abbreviation = false, bool use_unicode = false, bool plural = false, bool reference = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; /** Returns the name that best fulfils provided criterias and is suitable for display. If two names are equally preferred, the one with lowest index is returned. * * @param abbreviation If an abbreviated name is preferred. * @param use_unicode If a name with unicode characters can be displayed/is preferred (prioritized if false). * @param plural If a name in plural form is preferred. * @param reference If a reference name is preferred (ignored if false). * @param can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected. * @param can_display_unicode_string_arg Argument to pass to the above test function. * @returns The preferred name. */ virtual const ExpressionName &preferredDisplayName(bool abbreviation = false, bool use_unicode = false, bool plural = false, bool reference = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; /** Returns name for an index (starting at one). All functions can be traversed by starting at index one and increasing the index until empty_expression_name is returned. * * @param index Index of name. * @returns Name for index or empty_expression_name if not found. */ virtual const ExpressionName &getName(size_t index) const; /** Changes a name. If a name for the provided index is not present, it is added (equivalent to addName(ename, index, force)). * * @param ename The new name. * @param index Index of name to change. * @param force If true, expression items with conflicting names are replaced, otherwise . Only applies if the item is registered. */ virtual void setName(const ExpressionName &ename, size_t index = 1, bool force = true); /** Changes the text string of a name. If a name for the provided index is not present, it is added (equivalent to addName(sname, index, force)). * * @param sname The new name text string. * @param index Index of name to change. * @param force If true, expression items with conflicting names are replaced, otherwise . Only applies if the item is registered. */ virtual void setName(string sname, size_t index, bool force = true); virtual void addName(const ExpressionName &ename, size_t index = 0, bool force = true); virtual void addName(string sname, size_t index = 0, bool force = true); virtual size_t countNames() const; /** Removes all names. */ virtual void clearNames(); /** Removes all names that are not used for reference (ExpressionName.reference = true). */ virtual void clearNonReferenceNames(); virtual void removeName(size_t index); /** Checks if the expression item has a name with a specific text string. * * @param sname A text string to look for (not case sensitive) * @param case_sensitive If the name is case sensitive. * @returns Index of the name with the given text string or zero if such a name was not found. */ virtual size_t hasName(const string &sname, bool case_sensitive = true) const; /** Checks if the expression item has a name with a specific case sensitive text string. * * @param sname A text string to look for (case sensitive) * @returns Index of the name with the given text string or zero if such a name was not found. */ virtual size_t hasNameCaseSensitive(const string &sname) const; /** Searches for a name with specific properties. * * @param abbreviation If the name must be abbreviated. 1=true, 0=false, -1=ignore. * @param use_unicode If the name must have unicode characters. 1=true, 0=false, -1=ignore. * @param plural If the name must be in plural form. 1=true, 0=false, -1=ignore. * @param can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected. * @param can_display_unicode_string_arg Argument to pass to the above test function. * @returns The first found name with the specified properties or empty_expression_name if none found. */ virtual const ExpressionName &findName(int abbreviation = -1, int use_unicode = -1, int plural = -1, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; /** Returns the title, descriptive name, of the item. * * @param return_name_if_no_title If true, a name is returned if the title string is empty (using preferredName(false, use_unicode, false, false, can_display_unicode_string_function, can_display_unicode_string_arg)). * @param use_unicode If a name with unicode characters can be displayed/is preferred (passed to preferredName()). * @param can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected (passed to preferredName()). * @param can_display_unicode_string_arg Argument to pass to the above test function (passed to preferredName()). * @returns Item title. */ virtual const string &title(bool return_name_if_no_title = true, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; /** Sets the title, descriptive name, of the item. The title can not be used in expressions. * * @param title_ The new title. */ virtual void setTitle(string title_); /** Returns the expression items description. * * @returns Description. */ virtual const string &description() const; /** Sets the expression items description. * * @param descr_ Description. */ virtual void setDescription(string descr_); /** Returns the category that the expression item belongs to. Subcategories are separated by '/'. * * @returns Category. */ virtual const string &category() const; /** Sets which category the expression belongs to. Subcategories are separated by '/'. * * @param cat_ Category. */ virtual void setCategory(string cat_); /** If the object has been changed since it was created/loaded. */ virtual bool hasChanged() const; virtual void setChanged(bool has_changed); virtual bool isLocal() const; virtual bool setLocal(bool is_local = true, int will_be_active = -1); virtual bool isBuiltin() const; /** If the item is approximate or exact. * Note that an actual value associated with the item might have a have a lower precision. * For, for example, a mathematical function this defines the precision of the formula, not the result. * * @returns true if the item is approximate */ virtual bool isApproximate() const; virtual void setApproximate(bool is_approx = true); /** Returns precision of the item, if it is approximate. * Note that an actual value associated with the item might have a have a lower precision. * For, for example, a mathematical function this defines the precision of the formula, not the result. */ virtual int precision() const; virtual void setPrecision(int prec); /** Returns if the expression item is active and can be used in expressions. * * @returns true if active. */ virtual bool isActive() const; virtual void setActive(bool is_active); virtual bool isHidden() const; virtual void setHidden(bool is_hidden); /** The reference count is not used to delete the expression item when it becomes zero, but to stop from being deleted while it is in use. */ virtual int refcount() const; virtual void ref(); virtual void unref(); virtual void ref(ExpressionItem *o); virtual void unref(ExpressionItem *o); virtual ExpressionItem *getReferencer(size_t index = 1) const; virtual bool changeReference(ExpressionItem *o_from, ExpressionItem *o_to); /** Returns the type of the expression item, corresponding to which subclass the object belongs to. * * @returns ::ExpressionItemType. */ virtual int type() const = 0; /** Returns the subtype of the expression item, corresponding to which subsubclass the object belongs to. * * @returns Subtype/subsubclass. */ virtual int subtype() const = 0; }; #endif libqalculate-0.9.7/libqalculate/util.h0000644000175100017510000000567111305546373014724 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #ifndef UTIL_H #define UTIL_H #include /** @file */ /// \cond struct eqstr { bool operator()(const char *s1, const char *s2) const; }; /// \endcond string& gsub(const string &pattern, const string &sub, string &str); string& gsub(const char *pattern, const char *sub, string &str); string d2s(double value, int precision = 100); string i2s(int value); string i2s(long int value); string i2s(unsigned int value); string i2s(unsigned long int value); const char *b2yn(bool b, bool capital = true); const char *b2tf(bool b, bool capital = true); const char *b2oo(bool b, bool capital = true); string p2s(void *o); int s2i(const string& str); int s2i(const char *str); void *s2p(const string& str); void *s2p(const char *str); string date2s(int year, int month, int day); int week(string str, bool start_sunday = false); int weekday(string str); int yearday(string str); void now(int &hour, int &min, int &sec); void today(int &year, int &month, int &day); bool addDays(int &year, int &month, int &day, int days); string addDays(string str, int days); bool addMonths(int &year, int &month, int &day, int months); string addMonths(string str, int months); bool addYears(int &year, int &month, int &day, int years); string addYears(string str, int years); bool s2date(string str, int &year, int &month, int &day); bool isLeapYear(int year); int daysPerYear(int year, int basis = 0); int daysPerMonth(int month, int year); Number yearsBetweenDates(string date1, string date2, int basis, bool date_func = true); int daysBetweenDates(string date1, string date2, int basis, bool date_func = true); int daysBetweenDates(int year1, int month1, int day1, int year2, int month2, int day2, int basis, bool date_func = true); size_t find_ending_bracket(const string &str, size_t start, int *missing = NULL); char op2ch(MathOperation op); string& wrap_p(string &str); string& remove_blanks(string &str); string& remove_duplicate_blanks(string &str); string& remove_blank_ends(string &str); string& remove_parenthesis(string &str); bool is_in(const char *str, char c); bool is_not_in(const char *str, char c); bool is_in(const string &str, char c); bool is_not_in(const string &str, char c); int sign_place(string *str, size_t start = 0); int gcd(int i1, int i2); size_t unicode_length(const string &str); size_t unicode_length(const char *str); bool text_length_is_one(const string &str); bool equalsIgnoreCase(const string &str1, const string &str2); bool equalsIgnoreCase(const string &str1, const char *str2); void parse_qalculate_version(string qalculate_version, int *qalculate_version_numbers); string getLocalDir(); #endif libqalculate-0.9.7/libqalculate/MathStructure.cc0000644000175100017510000160123311320653617016711 00000000000000/* Qalculate Copyright (C) 2004-2007 Niklas Knutsson (nq@altern.org) 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. */ #include "support.h" #include "MathStructure.h" #include "Calculator.h" #include "Number.h" #include "Function.h" #include "Variable.h" #include "Unit.h" #include "Prefix.h" #include #define SWAP_CHILDREN(i1, i2) MathStructure *swap_mstruct = v_subs[v_order[i1]]; v_subs[v_order[i1]] = v_subs[v_order[i2]]; v_subs[v_order[i2]] = swap_mstruct; #define CHILD_TO_FRONT(i) v_order.insert(v_order.begin(), v_order[i]); v_order.erase(v_order.begin() + (i + 1)); #define SET_CHILD_MAP(i) setToChild(i + 1, true); #define SET_MAP(o) set(o, true); #define SET_MAP_NOCOPY(o) set_nocopy(o, true); #define MERGE_APPROX_AND_PREC(o) if(!b_approx && o.isApproximate()) b_approx = true; if(o.precision() > 0 && (i_precision < 1 || o.precision() < i_precision)) i_precision = o.precision(); #define CHILD_UPDATED(i) if(!b_approx && CHILD(i).isApproximate()) b_approx = true; if(CHILD(i).precision() > 0 && (i_precision < 1 || CHILD(i).precision() < i_precision)) i_precision = CHILD(i).precision(); #define CHILDREN_UPDATED for(size_t child_i = 0; child_i < SIZE; child_i++) {if(!b_approx && CHILD(child_i).isApproximate()) b_approx = true; if(CHILD(child_i).precision() > 0 && (i_precision < 1 || CHILD(child_i).precision() < i_precision)) i_precision = CHILD(child_i).precision();} #define APPEND(o) v_order.push_back(v_subs.size()); v_subs.push_back(new MathStructure(o)); if(!b_approx && o.isApproximate()) b_approx = true; if(o.precision() > 0 && (i_precision < 1 || o.precision() < i_precision)) i_precision = o.precision(); #define APPEND_NEW(o) {v_order.push_back(v_subs.size()); MathStructure *m_append_new = new MathStructure(o); v_subs.push_back(m_append_new); if(!b_approx && m_append_new->isApproximate()) b_approx = true; if(m_append_new->precision() > 0 && (i_precision < 1 || m_append_new->precision() < i_precision)) i_precision = m_append_new->precision();} #define APPEND_COPY(o) v_order.push_back(v_subs.size()); v_subs.push_back(new MathStructure(*(o))); if(!b_approx && (o)->isApproximate()) b_approx = true; if((o)->precision() > 0 && (i_precision < 1 || (o)->precision() < i_precision)) i_precision = (o)->precision(); #define APPEND_POINTER(o) v_order.push_back(v_subs.size()); v_subs.push_back(o); if(!b_approx && (o)->isApproximate()) b_approx = true; if((o)->precision() > 0 && (i_precision < 1 || (o)->precision() < i_precision)) i_precision = (o)->precision(); #define APPEND_REF(o) v_order.push_back(v_subs.size()); v_subs.push_back(o); (o)->ref(); if(!b_approx && (o)->isApproximate()) b_approx = true; if((o)->precision() > 0 && (i_precision < 1 || (o)->precision() < i_precision)) i_precision = (o)->precision(); #define PREPEND(o) v_order.insert(v_order.begin(), v_subs.size()); v_subs.push_back(new MathStructure(o)); if(!b_approx && o.isApproximate()) b_approx = true; if(o.precision() > 0 && (i_precision < 1 || o.precision() < i_precision)) i_precision = o.precision(); #define PREPEND_REF(o) v_order.insert(v_order.begin(), v_subs.size()); v_subs.push_back(o); (o)->ref(); if(!b_approx && (o)->isApproximate()) b_approx = true; if((o)->precision() > 0 && (i_precision < 1 || (o)->precision() < i_precision)) i_precision = (o)->precision(); #define INSERT_REF(o, i) v_order.insert(v_order.begin() + i, v_subs.size()); v_subs.push_back(o); (o)->ref(); if(!b_approx && (o)->isApproximate()) b_approx = true; if((o)->precision() > 0 && (i_precision < 1 || (o)->precision() < i_precision)) i_precision = (o)->precision(); #define CLEAR v_order.clear(); for(size_t i = 0; i < v_subs.size(); i++) {v_subs[i]->unref();} v_subs.clear(); #define REDUCE(v_size) for(size_t v_index = v_size; v_index < v_order.size(); v_index++) {v_subs[v_order[v_index]]->unref(); v_subs.erase(v_subs.begin() + v_order[v_index]);} v_order.resize(v_size); //#define CHILD(v_index) (*v_subs[v_order[v_index]]) #define SIZE v_order.size() #define LAST (*v_subs[v_order[v_order.size() - 1]]) #define ERASE(v_index) v_subs[v_order[v_index]]->unref(); v_subs.erase(v_subs.begin() + v_order[v_index]); for(size_t v_index2 = 0; v_index2 < v_order.size(); v_index2++) {if(v_order[v_index2] > v_order[v_index]) v_order[v_index2]--;} v_order.erase(v_order.begin() + (v_index)); #define IS_REAL(o) (o.isNumber() && o.number().isReal()) #define IS_RATIONAL(o) (o.isNumber() && o.number().isRational()) #define IS_N_INF_NUMBER(o) (o.isNumber() && !o.number().isInfinite()) #define IS_A_SYMBOL(o) (o.isSymbolic() || o.isVariable() || o.isFunction()) #define POWER_CLEAN(o) if(o[1].isOne()) {o.setToChild(1);} else if(o[1].isZero()) {o.set(1, 1);} /*void printRecursive(const MathStructure &mstruct) { std::cout << "RECURSIVE " << mstruct.print() << std::endl; for(size_t i = 0; i < mstruct.size(); i++) { std::cout << i << ": " << mstruct[i].print() << std::endl; for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { std::cout << i << "-" << i2 << ": " << mstruct[i][i2].print() << std::endl; for(size_t i3 = 0; i3 < mstruct[i][i2].size(); i3++) { std::cout << i << "-" << i2 << "-" << i3 << ": " << mstruct[i][i2][i3].print() << std::endl; for(size_t i4 = 0; i4 < mstruct[i][i2][i3].size(); i4++) { std::cout << i << "-" << i2 << "-" << i3 << "-" << i4 << ": " << mstruct[i][i2][i3][i4].print() << std::endl; for(size_t i5 = 0; i5 < mstruct[i][i2][i3][i4].size(); i5++) { std::cout << i << "-" << i2 << "-" << i3 << "-" << i4 << "-" << i5 << ": " << mstruct[i][i2][i3][i4][i5].print() << std::endl; for(size_t i6 = 0; i6 < mstruct[i][i2][i3][i4][i5].size(); i6++) { std::cout << i << "-" << i2 << "-" << i3 << "-" << i4 << "-" << i5 << "-" << i6 << ": " << mstruct[i][i2][i3][i4][i5][i6].print() << std::endl; } } } } } } }*/ bool warn_about_denominators_assumed_nonzero(const MathStructure &mstruct, const EvaluationOptions &eo) { EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = false; eo2.test_comparisons = true; eo2.isolate_x = true; eo2.expand = true; eo2.approximation = APPROXIMATION_APPROXIMATE; MathStructure mnonzero(mstruct); mnonzero.add(m_zero, OPERATION_NOT_EQUALS); mnonzero.eval(eo2); if(mnonzero.isZero()) return false; if(mnonzero.isOne()) return true; PrintOptions po; po.spell_out_logical_operators = true; mnonzero.format(po); CALCULATOR->error(false, _("To avoid division by zero, the following must be true: %s."), mnonzero.print(po).c_str(), NULL); return true; } bool warn_about_denominators_assumed_nonzero_or_positive(const MathStructure &mstruct, const MathStructure &mstruct2, const EvaluationOptions &eo) { EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = false; eo2.test_comparisons = true; eo2.isolate_x = true; eo2.expand = true; eo2.approximation = APPROXIMATION_APPROXIMATE; MathStructure mnonzero(mstruct); mnonzero.add(m_zero, OPERATION_NOT_EQUALS); MathStructure *mpos = new MathStructure(mstruct2); mpos->add(m_zero, OPERATION_EQUALS_GREATER); mnonzero.add_nocopy(mpos, OPERATION_LOGICAL_OR); mnonzero.eval(eo2); if(mnonzero.isZero()) return false; if(mnonzero.isOne()) return true; PrintOptions po; po.spell_out_logical_operators = true; mnonzero.format(po); CALCULATOR->error(false, _("To avoid division by zero, the following must be true: %s."), mnonzero.print(po).c_str(), NULL); return true; } bool warn_about_denominators_assumed_nonzero_llgg(const MathStructure &mstruct, const MathStructure &mstruct2, const MathStructure &mstruct3, const EvaluationOptions &eo) { EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = false; eo2.test_comparisons = true; eo2.isolate_x = true; eo2.expand = true; eo2.approximation = APPROXIMATION_APPROXIMATE; MathStructure mnonzero(mstruct); mnonzero.add(m_zero, OPERATION_NOT_EQUALS); MathStructure *mpos = new MathStructure(mstruct2); mpos->add(m_zero, OPERATION_EQUALS_GREATER); MathStructure *mpos2 = new MathStructure(mstruct3); mpos2->add(m_zero, OPERATION_EQUALS_GREATER); mpos->add_nocopy(mpos2, OPERATION_LOGICAL_AND); mnonzero.add_nocopy(mpos, OPERATION_LOGICAL_OR); MathStructure *mneg = new MathStructure(mstruct2); mneg->add(m_zero, OPERATION_LESS); MathStructure *mneg2 = new MathStructure(mstruct3); mneg2->add(m_zero, OPERATION_LESS); mneg->add_nocopy(mneg2, OPERATION_LOGICAL_AND); mnonzero.add_nocopy(mneg, OPERATION_LOGICAL_OR); mnonzero.eval(eo2); if(mnonzero.isZero()) return false; if(mnonzero.isOne()) return true; PrintOptions po; po.spell_out_logical_operators = true; mnonzero.format(po); CALCULATOR->error(false, _("To avoid division by zero, the following must be true: %s."), mnonzero.print(po).c_str(), NULL); return true; } void unnegate_sign(MathStructure &mstruct) { if(mstruct.isNumber()) { mstruct.number().negate(); } else if(mstruct.isMultiplication()) { if(mstruct[0].isMinusOne()) { if(mstruct.size() > 2) { mstruct.delChild(1); } else if(mstruct.size() == 2) { mstruct.setToChild(2); } else { mstruct.set(1, 1); } } else { unnegate_sign(mstruct[0]); } } } void MathStructure::mergePrecision(const MathStructure &o) {MERGE_APPROX_AND_PREC(o)} void idm1(const MathStructure &mnum, bool &bfrac, bool &bint); void idm2(const MathStructure &mnum, bool &bfrac, bool &bint, Number &nr); void idm3(MathStructure &mnum, Number &nr, bool expand); void MathStructure::ref() { i_ref++; } void MathStructure::unref() { i_ref--; if(i_ref == 0) { delete this; } } size_t MathStructure::refcount() const { return i_ref; } inline void MathStructure::init() { m_type = STRUCT_NUMBER; b_approx = false; i_precision = -1; i_ref = 1; function_value = NULL; b_protected = false; o_uncertainty = NULL; } MathStructure::MathStructure() { init(); } MathStructure::MathStructure(const MathStructure &o) { init(); set(o); } MathStructure::MathStructure(int num, int den, int exp10) { init(); set(num, den, exp10); } MathStructure::MathStructure(string sym) { init(); if (sym == "undefined") { setUndefined(true); return; } set(sym); } MathStructure::MathStructure(double float_value) { init(); set(float_value); } MathStructure::MathStructure(const MathStructure *o, ...) { init(); clear(); va_list ap; va_start(ap, o); if(o) { APPEND_COPY(o) while(true) { o = va_arg(ap, const MathStructure*); if(!o) break; APPEND_COPY(o) } } va_end(ap); m_type = STRUCT_VECTOR; } MathStructure::MathStructure(MathFunction *o, ...) { init(); clear(); va_list ap; va_start(ap, o); o_function = o; while(true) { const MathStructure *mstruct = va_arg(ap, const MathStructure*); if(!mstruct) break; APPEND_COPY(mstruct) } va_end(ap); m_type = STRUCT_FUNCTION; } MathStructure::MathStructure(Unit *u, Prefix *p) { init(); set(u, p); } MathStructure::MathStructure(Variable *o) { init(); set(o); } MathStructure::MathStructure(const Number &o) { init(); set(o); } MathStructure::~MathStructure() { clear(); } void MathStructure::set(const MathStructure &o, bool merge_precision) { clear(merge_precision); switch(o.type()) { case STRUCT_NUMBER: { o_number.set(o.number()); break; } case STRUCT_SYMBOLIC: { s_sym = o.symbol(); break; } case STRUCT_FUNCTION: { o_function = o.function(); if(o.functionValue()) function_value = new MathStructure(*o.functionValue()); break; } case STRUCT_VARIABLE: { o_variable = o.variable(); break; } case STRUCT_UNIT: { o_unit = o.unit(); o_prefix = o.prefix(); b_plural = o.isPlural(); break; } case STRUCT_COMPARISON: { ct_comp = o.comparisonType(); break; } default: {} } b_protected = o.isProtected(); for(size_t i = 0; i < o.size(); i++) { APPEND_COPY((&o[i])) } if(merge_precision) { MERGE_APPROX_AND_PREC(o); } else { b_approx = o.isApproximate(); i_precision = o.precision(); } if(o.uncertainty()) { o_uncertainty = new MathStructure(*o.uncertainty()); } m_type = o.type(); } void MathStructure::set_nocopy(MathStructure &o, bool merge_precision) { o.ref(); clear(merge_precision); switch(o.type()) { case STRUCT_NUMBER: { o_number.set(o.number()); break; } case STRUCT_SYMBOLIC: { s_sym = o.symbol(); break; } case STRUCT_FUNCTION: { o_function = o.function(); if(o.functionValue()) { function_value = (MathStructure*) o.functionValue(); function_value->ref(); } break; } case STRUCT_VARIABLE: { o_variable = o.variable(); break; } case STRUCT_UNIT: { o_unit = o.unit(); o_prefix = o.prefix(); b_plural = o.isPlural(); break; } case STRUCT_COMPARISON: { ct_comp = o.comparisonType(); break; } default: {} } b_protected = o.isProtected(); for(size_t i = 0; i < o.size(); i++) { APPEND_REF((&o[i])) } if(merge_precision) { MERGE_APPROX_AND_PREC(o); } else { b_approx = o.isApproximate(); i_precision = o.precision(); } if(o.uncertainty()) { o_uncertainty = (MathStructure*) o.uncertainty(); o_uncertainty->ref(); } m_type = o.type(); o.unref(); } void MathStructure::setToChild(size_t index, bool preserve_precision, MathStructure *mparent, size_t index_this) { if(index > 0 && index <= SIZE) { if(mparent) { CHILD(index - 1).ref(); mparent->setChild_nocopy(&CHILD(index - 1), index_this); } else { set_nocopy(CHILD(index - 1), preserve_precision); } } } void MathStructure::set(int num, int den, int exp10, bool preserve_precision) { clear(preserve_precision); o_number.set(num, den, exp10); if(preserve_precision) { MERGE_APPROX_AND_PREC(o_number); } else { b_approx = o_number.isApproximate(); i_precision = o_number.precision(); } m_type = STRUCT_NUMBER; } void MathStructure::set(double float_value, bool preserve_precision) { clear(preserve_precision); o_number.setFloat(float_value); if(preserve_precision) { MERGE_APPROX_AND_PREC(o_number); } else { b_approx = o_number.isApproximate(); i_precision = o_number.precision(); } m_type = STRUCT_NUMBER; } void MathStructure::set(string sym, bool preserve_precision) { clear(preserve_precision); s_sym = sym; m_type = STRUCT_SYMBOLIC; } void MathStructure::setVector(const MathStructure *o, ...) { clear(); va_list ap; va_start(ap, o); if(o) { APPEND_COPY(o) while(true) { o = va_arg(ap, const MathStructure*); if(!o) break; APPEND_COPY(o) } } va_end(ap); m_type = STRUCT_VECTOR; } void MathStructure::set(MathFunction *o, ...) { clear(); va_list ap; va_start(ap, o); o_function = o; while(true) { const MathStructure *mstruct = va_arg(ap, const MathStructure*); if(!mstruct) break; APPEND_COPY(mstruct) } va_end(ap); m_type = STRUCT_FUNCTION; } void MathStructure::set(Unit *u, Prefix *p, bool preserve_precision) { clear(preserve_precision); o_unit = u; o_prefix = p; m_type = STRUCT_UNIT; } void MathStructure::set(Variable *o, bool preserve_precision) { clear(preserve_precision); o_variable = o; m_type = STRUCT_VARIABLE; } void MathStructure::set(const Number &o, bool preserve_precision) { clear(preserve_precision); o_number.set(o); if(preserve_precision) { MERGE_APPROX_AND_PREC(o_number); } else { b_approx = o_number.isApproximate(); i_precision = o_number.precision(); } m_type = STRUCT_NUMBER; } void MathStructure::setInfinity(bool preserve_precision) { clear(preserve_precision); o_number.setInfinity(); m_type = STRUCT_NUMBER; } void MathStructure::setUndefined(bool preserve_precision) { clear(preserve_precision); m_type = STRUCT_UNDEFINED; } void MathStructure::setProtected(bool do_protect) {b_protected = do_protect;} bool MathStructure::isProtected() const {return b_protected;} void MathStructure::operator = (const MathStructure &o) {set(o);} void MathStructure::operator = (const Number &o) {set(o);} void MathStructure::operator = (int i) {set(i, 1);} void MathStructure::operator = (Unit *u) {set(u);} void MathStructure::operator = (Variable *v) {set(v);} void MathStructure::operator = (string sym) {set(sym);} MathStructure MathStructure::operator - () const { MathStructure o2(*this); o2.negate(); return o2; } MathStructure MathStructure::operator * (const MathStructure &o) const { MathStructure o2(*this); o2.multiply(o); return o2; } MathStructure MathStructure::operator / (const MathStructure &o) const { MathStructure o2(*this); o2.divide(o); return o2; } MathStructure MathStructure::operator + (const MathStructure &o) const { MathStructure o2(*this); o2.add(o); return o; } MathStructure MathStructure::operator - (const MathStructure &o) const { MathStructure o2(*this); o2.subtract(o); return o2; } MathStructure MathStructure::operator ^ (const MathStructure &o) const { MathStructure o2(*this); o2.raise(o); return o2; } MathStructure MathStructure::operator && (const MathStructure &o) const { MathStructure o2(*this); o2.add(o, OPERATION_LOGICAL_AND); return o2; } MathStructure MathStructure::operator || (const MathStructure &o) const { MathStructure o2(*this); o2.add(o, OPERATION_LOGICAL_OR); return o2; } MathStructure MathStructure::operator ! () const { MathStructure o2(*this); o2.setLogicalNot(); return o2; } void MathStructure::operator *= (const MathStructure &o) {multiply(o);} void MathStructure::operator /= (const MathStructure &o) {divide(o);} void MathStructure::operator += (const MathStructure &o) {add(o);} void MathStructure::operator -= (const MathStructure &o) {subtract(o);} void MathStructure::operator ^= (const MathStructure &o) {raise(o);} void MathStructure::operator *= (const Number &o) {multiply(o);} void MathStructure::operator /= (const Number &o) {divide(o);} void MathStructure::operator += (const Number &o) {add(o);} void MathStructure::operator -= (const Number &o) {subtract(o);} void MathStructure::operator ^= (const Number &o) {raise(o);} void MathStructure::operator *= (int i) {multiply(i);} void MathStructure::operator /= (int i) {divide(i);} void MathStructure::operator += (int i) {add(i);} void MathStructure::operator -= (int i) {subtract(i);} void MathStructure::operator ^= (int i) {raise(i);} void MathStructure::operator *= (Unit *u) {multiply(u);} void MathStructure::operator /= (Unit *u) {divide(u);} void MathStructure::operator += (Unit *u) {add(u);} void MathStructure::operator -= (Unit *u) {subtract(u);} void MathStructure::operator ^= (Unit *u) {raise(u);} void MathStructure::operator *= (Variable *v) {multiply(v);} void MathStructure::operator /= (Variable *v) {divide(v);} void MathStructure::operator += (Variable *v) {add(v);} void MathStructure::operator -= (Variable *v) {subtract(v);} void MathStructure::operator ^= (Variable *v) {raise(v);} void MathStructure::operator *= (string sym) {multiply(sym);} void MathStructure::operator /= (string sym) {divide(sym);} void MathStructure::operator += (string sym) {add(sym);} void MathStructure::operator -= (string sym) {subtract(sym);} void MathStructure::operator ^= (string sym) {raise(sym);} bool MathStructure::operator == (const MathStructure &o) const {return equals(o);} bool MathStructure::operator == (const Number &o) const {return equals(o);} bool MathStructure::operator == (int i) const {return equals(i);} bool MathStructure::operator == (Unit *u) const {return equals(u);} bool MathStructure::operator == (Variable *v) const {return equals(v);} bool MathStructure::operator == (string sym) const {return equals(sym);} bool MathStructure::operator != (const MathStructure &o) const {return !equals(o);} MathStructure& MathStructure::CHILD(size_t v_index) const { if(v_index < v_order.size() && v_order[v_index] < v_subs.size()) return *v_subs[v_order[v_index]]; MathStructure* m = new MathStructure;//(new UnknownVariable("x","x")); m->setUndefined(true); return *m; } const MathStructure &MathStructure::operator [] (size_t index) const {return CHILD(index);} MathStructure &MathStructure::operator [] (size_t index) {return CHILD(index);} void MathStructure::clear(bool preserve_precision) { m_type = STRUCT_NUMBER; o_number.clear(); if(function_value) { function_value->unref(); function_value = NULL; } if(o_uncertainty) { o_uncertainty->unref(); o_uncertainty = NULL; } o_function = NULL; o_variable = NULL; o_unit = NULL; o_prefix = NULL; b_plural = false; b_protected = false; CLEAR; if(!preserve_precision) { i_precision = -1; b_approx = false; } } void MathStructure::clearVector(bool preserve_precision) { clear(preserve_precision); m_type = STRUCT_VECTOR; } void MathStructure::clearMatrix(bool preserve_precision) { clearVector(preserve_precision); MathStructure *mstruct = new MathStructure(); mstruct->clearVector(); APPEND_POINTER(mstruct); } const MathStructure *MathStructure::functionValue() const { return function_value; } const Number &MathStructure::number() const { return o_number; } Number &MathStructure::number() { return o_number; } void MathStructure::numberUpdated() { if(m_type != STRUCT_NUMBER) return; MERGE_APPROX_AND_PREC(o_number) } void MathStructure::childUpdated(size_t index, bool recursive) { if(index > SIZE || index < 1) return; if(recursive) CHILD(index - 1).childrenUpdated(true); MERGE_APPROX_AND_PREC(CHILD(index - 1)) } void MathStructure::childrenUpdated(bool recursive) { for(size_t i = 0; i < SIZE; i++) { if(recursive) CHILD(i).childrenUpdated(true); MERGE_APPROX_AND_PREC(CHILD(i)) } } const string &MathStructure::symbol() const { return s_sym; } ComparisonType MathStructure::comparisonType() const { return ct_comp; } void MathStructure::setComparisonType(ComparisonType comparison_type) { ct_comp = comparison_type; } void MathStructure::setType(StructureType mtype) { m_type = mtype; } Unit *MathStructure::unit() const { return o_unit; } Prefix *MathStructure::prefix() const { return o_prefix; } void MathStructure::setPrefix(Prefix *p) { if(isUnit()) o_prefix = p; } bool MathStructure::isPlural() const { return b_plural; } void MathStructure::setPlural(bool is_plural) { if(isUnit()) b_plural = is_plural; } void MathStructure::setFunction(MathFunction *f) { o_function = f; } void MathStructure::setUnit(Unit *u) { o_unit = u; } void MathStructure::setVariable(Variable *v) { o_variable = v; } MathFunction *MathStructure::function() const { return o_function; } Variable *MathStructure::variable() const { return o_variable; } void MathStructure::setUncertainty(const MathStructure &o) { if(o_uncertainty) o_uncertainty->set(o); else o_uncertainty = new MathStructure(o); } const MathStructure *MathStructure::uncertainty() const { return o_uncertainty; } bool MathStructure::isAddition() const {return m_type == STRUCT_ADDITION;} bool MathStructure::isMultiplication() const {return m_type == STRUCT_MULTIPLICATION;} bool MathStructure::isPower() const {return m_type == STRUCT_POWER;} bool MathStructure::isSymbolic() const {return m_type == STRUCT_SYMBOLIC;} bool MathStructure::isEmptySymbol() const {return m_type == STRUCT_SYMBOLIC && s_sym.empty();} bool MathStructure::isVector() const {return m_type == STRUCT_VECTOR;} bool MathStructure::isMatrix() const { if(m_type != STRUCT_VECTOR || SIZE < 1) return false; for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).isVector() || (i > 0 && CHILD(i).size() != CHILD(i - 1).size())) return false; } return true; } bool MathStructure::isFunction() const {return m_type == STRUCT_FUNCTION;} bool MathStructure::isUnit() const {return m_type == STRUCT_UNIT;} bool MathStructure::isUnit_exp() const {return m_type == STRUCT_UNIT || (m_type == STRUCT_POWER && CHILD(0).isUnit());} bool MathStructure::isNumber_exp() const {return m_type == STRUCT_NUMBER || (m_type == STRUCT_POWER && CHILD(0).isNumber());} bool MathStructure::isVariable() const {return m_type == STRUCT_VARIABLE;} bool MathStructure::isComparison() const {return m_type == STRUCT_COMPARISON;} bool MathStructure::isLogicalAnd() const {return m_type == STRUCT_LOGICAL_AND;} bool MathStructure::isLogicalOr() const {return m_type == STRUCT_LOGICAL_OR;} bool MathStructure::isLogicalXor() const {return m_type == STRUCT_LOGICAL_XOR;} bool MathStructure::isLogicalNot() const {return m_type == STRUCT_LOGICAL_NOT;} bool MathStructure::isBitwiseAnd() const {return m_type == STRUCT_BITWISE_AND;} bool MathStructure::isBitwiseOr() const {return m_type == STRUCT_BITWISE_OR;} bool MathStructure::isBitwiseXor() const {return m_type == STRUCT_BITWISE_XOR;} bool MathStructure::isBitwiseNot() const {return m_type == STRUCT_BITWISE_NOT;} bool MathStructure::isInverse() const {return m_type == STRUCT_INVERSE;} bool MathStructure::isDivision() const {return m_type == STRUCT_DIVISION;} bool MathStructure::isNegate() const {return m_type == STRUCT_NEGATE;} bool MathStructure::isInfinity() const {return m_type == STRUCT_NUMBER && o_number.isInfinite();} bool MathStructure::isUndefined() const {return m_type == STRUCT_UNDEFINED || (m_type == STRUCT_NUMBER && o_number.isUndefined());} bool MathStructure::isInteger() const {return m_type == STRUCT_NUMBER && o_number.isInteger();} bool MathStructure::isNumber() const {return m_type == STRUCT_NUMBER;} bool MathStructure::isZero() const {return m_type == STRUCT_NUMBER && o_number.isZero();} bool MathStructure::isOne() const {return m_type == STRUCT_NUMBER && o_number.isOne();} bool MathStructure::isMinusOne() const {return m_type == STRUCT_NUMBER && o_number.isMinusOne();} bool MathStructure::hasNegativeSign() const { return (m_type == STRUCT_NUMBER && o_number.hasNegativeSign()) || m_type == STRUCT_NEGATE || (m_type == STRUCT_MULTIPLICATION && SIZE > 0 && CHILD(0).hasNegativeSign()); } bool MathStructure::representsBoolean() const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isOne() || o_number.isZero();} case STRUCT_VARIABLE: {return o_variable->representsBoolean();} case STRUCT_FUNCTION: {return (function_value && function_value->representsBoolean()) || o_function->representsBoolean(*this);} case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsBoolean()) return false; } return true; } case STRUCT_LOGICAL_NOT: {} case STRUCT_LOGICAL_AND: {} case STRUCT_LOGICAL_OR: {} case STRUCT_LOGICAL_XOR: {} case STRUCT_COMPARISON: {return true;} default: {return false;} } } bool MathStructure::representsNumber(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return true;} case STRUCT_VARIABLE: {return o_variable->representsNumber(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isNumber();} case STRUCT_FUNCTION: {return (function_value && function_value->representsNumber(allow_units)) || o_function->representsNumber(*this, allow_units);} case STRUCT_UNIT: {return allow_units;} case STRUCT_ADDITION: {} case STRUCT_POWER: {} case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNumber(allow_units)) return false; } return true; } default: {return false;} } } bool MathStructure::representsInteger(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isInteger();} case STRUCT_VARIABLE: {return o_variable->representsInteger(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isInteger();} case STRUCT_FUNCTION: {return (function_value && function_value->representsInteger(allow_units)) || o_function->representsInteger(*this, allow_units);} case STRUCT_UNIT: {return false;} case STRUCT_ADDITION: {} case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsInteger(allow_units)) return false; } return true; } case STRUCT_POWER: { return CHILD(0).representsInteger(allow_units) && CHILD(1).representsInteger(false) && CHILD(1).representsPositive(false); } default: {return false;} } } bool MathStructure::representsPositive(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isPositive();} case STRUCT_VARIABLE: {return o_variable->representsPositive(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isPositive();} case STRUCT_FUNCTION: {return (function_value && function_value->representsPositive(allow_units)) || o_function->representsPositive(*this, allow_units);} case STRUCT_UNIT: {return allow_units;} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsPositive(allow_units)) return false; } return true; } case STRUCT_MULTIPLICATION: { bool b = true; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsNegative(allow_units)) { b = !b; } else if(!CHILD(i).representsPositive(allow_units)) { return false; } } return b; } case STRUCT_POWER: { return (CHILD(0).representsPositive(allow_units) && CHILD(1).representsReal(false)) || (CHILD(0).representsNonZero(allow_units) && CHILD(0).representsReal(allow_units) && ((CHILD(1).isNumber() && CHILD(1).number().isRational() && CHILD(1).number().numeratorIsEven()) || (CHILD(1).representsEven(false) && CHILD(1).representsInteger(false)))); } default: {return false;} } } bool MathStructure::representsNegative(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isNegative();} case STRUCT_VARIABLE: {return o_variable->representsNegative(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isNegative();} case STRUCT_FUNCTION: {return (function_value && function_value->representsNegative(allow_units)) || o_function->representsNegative(*this, allow_units);} case STRUCT_UNIT: {return false;} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNegative(allow_units)) return false; } return true; } case STRUCT_MULTIPLICATION: { bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsNegative(allow_units)) { b = !b; } else if(!CHILD(i).representsPositive(allow_units)) { return false; } } return b; } case STRUCT_POWER: { return CHILD(1).representsInteger(false) && CHILD(1).representsOdd(false) && CHILD(0).representsNegative(allow_units); } default: {return false;} } } bool MathStructure::representsNonNegative(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isNonNegative();} case STRUCT_VARIABLE: {return o_variable->representsNonNegative(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isNonNegative();} case STRUCT_FUNCTION: {return (function_value && function_value->representsNonNegative(allow_units)) || o_function->representsNonNegative(*this, allow_units);} case STRUCT_UNIT: {return allow_units;} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNonNegative(allow_units)) return false; } return true; } case STRUCT_MULTIPLICATION: { bool b = true; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsNegative(allow_units)) { b = !b; } else if(!CHILD(i).representsNonNegative(allow_units)) { return false; } } return b; } case STRUCT_POWER: { return (CHILD(0).isZero() && CHILD(1).representsNonNegative(false)) || (CHILD(0).representsNonNegative(allow_units) && CHILD(1).representsReal(false)) || (CHILD(0).representsReal(allow_units) && ((CHILD(1).isNumber() && CHILD(1).number().isRational() && CHILD(1).number().numeratorIsEven()) || (CHILD(1).representsEven(false) && CHILD(1).representsInteger(false)))); } default: {return false;} } } bool MathStructure::representsNonPositive(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isNonPositive();} case STRUCT_VARIABLE: {return o_variable->representsNonPositive(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isNonPositive();} case STRUCT_FUNCTION: {return (function_value && function_value->representsNonPositive(allow_units)) || o_function->representsNonPositive(*this, allow_units);} case STRUCT_UNIT: {return false;} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNonPositive(allow_units)) return false; } return true; } case STRUCT_MULTIPLICATION: { bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsNegative(allow_units)) { b = !b; } else if(!CHILD(i).representsPositive(allow_units)) { return false; } } return b; } case STRUCT_POWER: { return (CHILD(0).isZero() && CHILD(1).representsPositive(false)) || representsNegative(allow_units); } default: {return false;} } } bool MathStructure::representsRational(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isRational();} case STRUCT_VARIABLE: {return o_variable->representsRational(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isRational();} case STRUCT_FUNCTION: {return (function_value && function_value->representsRational(allow_units)) || o_function->representsRational(*this, allow_units);} case STRUCT_UNIT: {return false;} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsRational(allow_units)) return false; } return true; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsRational(allow_units)) { return false; } } return true; } case STRUCT_POWER: { return CHILD(1).representsInteger(false) && CHILD(0).representsRational(allow_units) && (CHILD(0).representsPositive(allow_units) || (CHILD(0).representsNegative(allow_units) && CHILD(1).representsEven(false) && CHILD(1).representsPositive(false))); } default: {return false;} } } bool MathStructure::representsReal(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isReal();} case STRUCT_VARIABLE: {return o_variable->representsReal(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isReal();} case STRUCT_FUNCTION: {return (function_value && function_value->representsReal(allow_units)) || o_function->representsReal(*this, allow_units);} case STRUCT_UNIT: {return allow_units;} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsReal(allow_units)) return false; } return true; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsReal(allow_units)) { return false; } } return true; } case STRUCT_POWER: { return (CHILD(0).representsPositive(allow_units) && CHILD(1).representsReal(false)) || (CHILD(0).representsReal(allow_units) && ((CHILD(1).isNumber() && CHILD(1).number().isRational() && !CHILD(1).number().denominatorIsEven()) || (CHILD(1).representsEven(false) && CHILD(1).representsInteger(false))) && (CHILD(1).representsPositive(false) || CHILD(0).representsNonZero(allow_units))); } default: {return false;} } } bool MathStructure::representsComplex(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isComplex();} case STRUCT_VARIABLE: {return o_variable->representsComplex(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isComplex();} case STRUCT_FUNCTION: {return (function_value && function_value->representsComplex(allow_units)) || o_function->representsComplex(*this, allow_units);} case STRUCT_ADDITION: { bool c = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsComplex(allow_units)) { if(c) return false; c = true; } else if(!CHILD(i).representsReal(allow_units) || !CHILD(i).representsNonZero(allow_units)) { return false; } } return c; } case STRUCT_MULTIPLICATION: { bool c = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsComplex(allow_units)) { if(c) return false; c = true; } else if(!CHILD(i).representsReal(allow_units)) { return false; } } return c; } case STRUCT_UNIT: {return false;} case STRUCT_POWER: {return CHILD(1).isNumber() && CHILD(1).number().denominatorIsEven() && CHILD(0).representsNegative();} default: {return false;} } } bool MathStructure::representsNonZero(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return !o_number.isZero();} case STRUCT_VARIABLE: {return o_variable->representsNonZero(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isNonZero();} case STRUCT_FUNCTION: {return (function_value && function_value->representsNonZero(allow_units)) || o_function->representsNonZero(*this, allow_units);} case STRUCT_UNIT: {return allow_units;} case STRUCT_ADDITION: { bool neg = false, started = false; for(size_t i = 0; i < SIZE; i++) { if((!started || neg) && CHILD(i).representsNegative(allow_units)) { neg = true; } else if(neg || !CHILD(i).representsPositive(allow_units)) { return false; } started = true; } return true; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNonZero(allow_units)) { return false; } } return true; } case STRUCT_POWER: { return CHILD(0).representsNonZero(allow_units) || (!CHILD(0).isZero() && CHILD(1).representsNonPositive()); } default: {return false;} } } bool MathStructure::representsZero(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isZero();} case STRUCT_VARIABLE: {return o_variable->isKnown() && !o_variable->representsNonZero(allow_units) && ((KnownVariable*) o_variable)->get().representsZero();} case STRUCT_FUNCTION: {return (function_value && function_value->representsZero(allow_units));} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsZero(allow_units)) { return false; } } return true; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsZero(allow_units)) { return true; } } return false; } case STRUCT_POWER: { return CHILD(0).representsZero(allow_units) && CHILD(1).representsPositive(allow_units); } default: {return false;} } } bool MathStructure::representsEven(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isEven();} case STRUCT_VARIABLE: {return o_variable->representsEven(allow_units);} case STRUCT_FUNCTION: {return (function_value && function_value->representsEven(allow_units)) || o_function->representsEven(*this, allow_units);} default: {return false;} } } bool MathStructure::representsOdd(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isOdd();} case STRUCT_VARIABLE: {return o_variable->representsOdd(allow_units);} case STRUCT_FUNCTION: {return (function_value && function_value->representsOdd(allow_units)) || o_function->representsOdd(*this, allow_units);} default: {return false;} } } bool MathStructure::representsUndefined(bool include_childs, bool include_infinite, bool be_strict) const { switch(m_type) { case STRUCT_NUMBER: { if(include_infinite) { return o_number.isInfinite(); } return false; } case STRUCT_UNDEFINED: {return true;} case STRUCT_VARIABLE: {return o_variable->representsUndefined(include_childs, include_infinite, be_strict);} case STRUCT_FUNCTION: {return (function_value && function_value->representsUndefined(include_childs, include_infinite, be_strict)) || o_function->representsUndefined(*this);} case STRUCT_POWER: { if(be_strict) { if((!CHILD(0).representsNonZero(true) && !CHILD(1).representsNonNegative(false)) || (CHILD(0).isInfinity() && !CHILD(1).representsNonZero(true))) { return true; } } else { if((CHILD(0).representsZero(true) && CHILD(1).representsNegative(false)) || (CHILD(0).isInfinity() && CHILD(1).representsZero(true))) { return true; } } } default: { if(include_childs) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsUndefined(include_childs, include_infinite, be_strict)) return true; } } return false; } } } bool MathStructure::representsNonMatrix() const { switch(m_type) { case STRUCT_VECTOR: {return !isMatrix();} case STRUCT_POWER: {return CHILD(0).representsNonMatrix();} case STRUCT_VARIABLE: {return o_variable->representsNonMatrix();} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isNonMatrix();} case STRUCT_FUNCTION: {return (function_value && function_value->representsNonMatrix()) || o_function->representsNonMatrix(*this);} case STRUCT_INVERSE: {} case STRUCT_NEGATE: {} case STRUCT_DIVISION: {} case STRUCT_MULTIPLICATION: {} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNonMatrix()) { return false; } } return true; } default: {} } return true; } void MathStructure::setApproximate(bool is_approx) { b_approx = is_approx; if(b_approx) { if(i_precision < 1) i_precision = PRECISION; } else { i_precision = -1; } } bool MathStructure::isApproximate() const { return b_approx; } int MathStructure::precision() const { return i_precision; } void MathStructure::setPrecision(int prec) { i_precision = prec; if(i_precision > 0) b_approx = true; } void MathStructure::transform(StructureType mtype, const MathStructure &o) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND(o); } void MathStructure::transform(StructureType mtype, const Number &o) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND_NEW(o); } void MathStructure::transform(StructureType mtype, int i) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND_POINTER(new MathStructure(i, 1)); } void MathStructure::transform(StructureType mtype, Unit *u) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND_NEW(u); } void MathStructure::transform(StructureType mtype, Variable *v) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND_NEW(v); } void MathStructure::transform(StructureType mtype, string sym) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND_NEW(sym); } void MathStructure::transform_nocopy(StructureType mtype, MathStructure *o) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND_POINTER(o); } void MathStructure::transform(StructureType mtype) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); } void MathStructure::add(const MathStructure &o, MathOperation op, bool append) { switch(op) { case OPERATION_ADD: { add(o, append); break; } case OPERATION_SUBTRACT: { subtract(o, append); break; } case OPERATION_MULTIPLY: { multiply(o, append); break; } case OPERATION_DIVIDE: { divide(o, append); break; } case OPERATION_RAISE: { raise(o); break; } case OPERATION_EXP10: { MathStructure *mstruct = new MathStructure(10, 1); mstruct->raise(o); multiply_nocopy(mstruct, append); break; } case OPERATION_LOGICAL_AND: { if(m_type == STRUCT_LOGICAL_AND && append) { APPEND(o); } else { transform(STRUCT_LOGICAL_AND, o); } break; } case OPERATION_LOGICAL_OR: { if(m_type == STRUCT_LOGICAL_OR && append) { APPEND(o); } else { transform(STRUCT_LOGICAL_OR, o); } break; } case OPERATION_LOGICAL_XOR: { transform(STRUCT_LOGICAL_XOR, o); break; } case OPERATION_BITWISE_AND: { if(m_type == STRUCT_BITWISE_AND && append) { APPEND(o); } else { transform(STRUCT_BITWISE_AND, o); } break; } case OPERATION_BITWISE_OR: { if(m_type == STRUCT_BITWISE_OR && append) { APPEND(o); } else { transform(STRUCT_BITWISE_OR, o); } break; } case OPERATION_BITWISE_XOR: { transform(STRUCT_BITWISE_XOR, o); break; } case OPERATION_EQUALS: {} case OPERATION_NOT_EQUALS: {} case OPERATION_GREATER: {} case OPERATION_LESS: {} case OPERATION_EQUALS_GREATER: {} case OPERATION_EQUALS_LESS: { if(append && m_type == STRUCT_COMPARISON && append) { MathStructure *o2 = new MathStructure(CHILD(1)); o2->add(o, op); transform_nocopy(STRUCT_LOGICAL_AND, o2); } else if(append && m_type == STRUCT_LOGICAL_AND && LAST.type() == STRUCT_COMPARISON) { MathStructure *o2 = new MathStructure(LAST[1]); o2->add(o, op); APPEND_POINTER(o2); } else { transform(STRUCT_COMPARISON, o); switch(op) { case OPERATION_EQUALS: {ct_comp = COMPARISON_EQUALS; break;} case OPERATION_NOT_EQUALS: {ct_comp = COMPARISON_NOT_EQUALS; break;} case OPERATION_GREATER: {ct_comp = COMPARISON_GREATER; break;} case OPERATION_LESS: {ct_comp = COMPARISON_LESS; break;} case OPERATION_EQUALS_GREATER: {ct_comp = COMPARISON_EQUALS_GREATER; break;} case OPERATION_EQUALS_LESS: {ct_comp = COMPARISON_EQUALS_LESS; break;} default: {} } } break; } default: { } } } void MathStructure::add(const MathStructure &o, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND(o); } else { transform(STRUCT_ADDITION, o); } } void MathStructure::subtract(const MathStructure &o, bool append) { MathStructure *o2 = new MathStructure(o); o2->negate(); add_nocopy(o2, append); } void MathStructure::multiply(const MathStructure &o, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND(o); } else { transform(STRUCT_MULTIPLICATION, o); } } void MathStructure::divide(const MathStructure &o, bool append) { // transform(STRUCT_DIVISION, o); MathStructure *o2 = new MathStructure(o); o2->inverse(); multiply_nocopy(o2, append); } void MathStructure::raise(const MathStructure &o) { transform(STRUCT_POWER, o); } void MathStructure::add(const Number &o, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND_NEW(o); } else { transform(STRUCT_ADDITION, o); } } void MathStructure::subtract(const Number &o, bool append) { MathStructure *o2 = new MathStructure(o); o2->negate(); add_nocopy(o2, append); } void MathStructure::multiply(const Number &o, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND_NEW(o); } else { transform(STRUCT_MULTIPLICATION, o); } } void MathStructure::divide(const Number &o, bool append) { MathStructure *o2 = new MathStructure(o); o2->inverse(); multiply_nocopy(o2, append); } void MathStructure::raise(const Number &o) { transform(STRUCT_POWER, o); } void MathStructure::add(int i, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND_POINTER(new MathStructure(i, 1)); } else { transform(STRUCT_ADDITION, i); } } void MathStructure::subtract(int i, bool append) { MathStructure *o2 = new MathStructure(i, 1); o2->negate(); add_nocopy(o2, append); } void MathStructure::multiply(int i, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND_POINTER(new MathStructure(i, 1)); } else { transform(STRUCT_MULTIPLICATION, i); } } void MathStructure::divide(int i, bool append) { MathStructure *o2 = new MathStructure(i, 1); o2->inverse(); multiply_nocopy(o2, append); } void MathStructure::raise(int i) { transform(STRUCT_POWER, i); } void MathStructure::add(Variable *v, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND_NEW(v); } else { transform(STRUCT_ADDITION, v); } } void MathStructure::subtract(Variable *v, bool append) { MathStructure *o2 = new MathStructure(v); o2->negate(); add_nocopy(o2, append); } void MathStructure::multiply(Variable *v, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND_NEW(v); } else { transform(STRUCT_MULTIPLICATION, v); } } void MathStructure::divide(Variable *v, bool append) { MathStructure *o2 = new MathStructure(v); o2->inverse(); multiply_nocopy(o2, append); } void MathStructure::raise(Variable *v) { transform(STRUCT_POWER, v); } void MathStructure::add(Unit *u, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND_NEW(u); } else { transform(STRUCT_ADDITION, u); } } void MathStructure::subtract(Unit *u, bool append) { MathStructure *o2 = new MathStructure(u); o2->negate(); add_nocopy(o2, append); } void MathStructure::multiply(Unit *u, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND_NEW(u); } else { transform(STRUCT_MULTIPLICATION, u); } } void MathStructure::divide(Unit *u, bool append) { MathStructure *o2 = new MathStructure(u); o2->inverse(); multiply_nocopy(o2, append); } void MathStructure::raise(Unit *u) { transform(STRUCT_POWER, u); } void MathStructure::add(string sym, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND_NEW(sym); } else { transform(STRUCT_ADDITION, sym); } } void MathStructure::subtract(string sym, bool append) { MathStructure *o2 = new MathStructure(sym); o2->negate(); add_nocopy(o2, append); } void MathStructure::multiply(string sym, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND_NEW(sym); } else { transform(STRUCT_MULTIPLICATION, sym); } } void MathStructure::divide(string sym, bool append) { MathStructure *o2 = new MathStructure(sym); o2->inverse(); multiply_nocopy(o2, append); } void MathStructure::raise(string sym) { transform(STRUCT_POWER, sym); } void MathStructure::add_nocopy(MathStructure *o, MathOperation op, bool append) { switch(op) { case OPERATION_ADD: { add_nocopy(o, append); break; } case OPERATION_SUBTRACT: { subtract_nocopy(o, append); break; } case OPERATION_MULTIPLY: { multiply_nocopy(o, append); break; } case OPERATION_DIVIDE: { divide_nocopy(o, append); break; } case OPERATION_RAISE: { raise_nocopy(o); break; } case OPERATION_EXP10: { MathStructure *mstruct = new MathStructure(10, 1); mstruct->raise_nocopy(o); multiply_nocopy(mstruct, append); break; } case OPERATION_LOGICAL_AND: { if(m_type == STRUCT_LOGICAL_AND && append) { APPEND_POINTER(o); } else { transform_nocopy(STRUCT_LOGICAL_AND, o); } break; } case OPERATION_LOGICAL_OR: { if(m_type == STRUCT_LOGICAL_OR && append) { APPEND_POINTER(o); } else { transform_nocopy(STRUCT_LOGICAL_OR, o); } break; } case OPERATION_LOGICAL_XOR: { transform_nocopy(STRUCT_LOGICAL_XOR, o); break; } case OPERATION_BITWISE_AND: { if(m_type == STRUCT_BITWISE_AND && append) { APPEND_POINTER(o); } else { transform_nocopy(STRUCT_BITWISE_AND, o); } break; } case OPERATION_BITWISE_OR: { if(m_type == STRUCT_BITWISE_OR && append) { APPEND_POINTER(o); } else { transform_nocopy(STRUCT_BITWISE_OR, o); } break; } case OPERATION_BITWISE_XOR: { transform_nocopy(STRUCT_BITWISE_XOR, o); break; } case OPERATION_EQUALS: {} case OPERATION_NOT_EQUALS: {} case OPERATION_GREATER: {} case OPERATION_LESS: {} case OPERATION_EQUALS_GREATER: {} case OPERATION_EQUALS_LESS: { if(append && m_type == STRUCT_COMPARISON && append) { MathStructure *o2 = new MathStructure(CHILD(1)); o2->add_nocopy(o, op); transform_nocopy(STRUCT_LOGICAL_AND, o2); } else if(append && m_type == STRUCT_LOGICAL_AND && LAST.type() == STRUCT_COMPARISON) { MathStructure *o2 = new MathStructure(LAST[1]); o2->add_nocopy(o, op); APPEND_POINTER(o2); } else { transform_nocopy(STRUCT_COMPARISON, o); switch(op) { case OPERATION_EQUALS: {ct_comp = COMPARISON_EQUALS; break;} case OPERATION_NOT_EQUALS: {ct_comp = COMPARISON_NOT_EQUALS; break;} case OPERATION_GREATER: {ct_comp = COMPARISON_GREATER; break;} case OPERATION_LESS: {ct_comp = COMPARISON_LESS; break;} case OPERATION_EQUALS_GREATER: {ct_comp = COMPARISON_EQUALS_GREATER; break;} case OPERATION_EQUALS_LESS: {ct_comp = COMPARISON_EQUALS_LESS; break;} default: {} } } break; } default: { } } } void MathStructure::add_nocopy(MathStructure *o, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND_POINTER(o); } else { transform_nocopy(STRUCT_ADDITION, o); } } void MathStructure::subtract_nocopy(MathStructure *o, bool append) { o->negate(); add_nocopy(o, append); } void MathStructure::multiply_nocopy(MathStructure *o, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND_POINTER(o); } else { transform_nocopy(STRUCT_MULTIPLICATION, o); } } void MathStructure::divide_nocopy(MathStructure *o, bool append) { o->inverse(); multiply_nocopy(o, append); } void MathStructure::raise_nocopy(MathStructure *o) { transform_nocopy(STRUCT_POWER, o); } void MathStructure::negate() { //transform(STRUCT_NEGATE); MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = STRUCT_MULTIPLICATION; APPEND(m_minus_one); APPEND_POINTER(struct_this); } void MathStructure::inverse() { //transform(STRUCT_INVERSE); raise(m_minus_one); } void MathStructure::setLogicalNot() { transform(STRUCT_LOGICAL_NOT); } void MathStructure::setBitwiseNot() { transform(STRUCT_BITWISE_NOT); } bool MathStructure::equals(const MathStructure &o) const { if(m_type != o.type()) return false; if(SIZE != o.size()) return false; switch(m_type) { case STRUCT_UNDEFINED: {return true;} case STRUCT_SYMBOLIC: {return s_sym == o.symbol();} case STRUCT_NUMBER: {return o_number.equals(o.number());} case STRUCT_VARIABLE: {return o_variable == o.variable();} case STRUCT_UNIT: {return o_unit == o.unit() && o_prefix == o.prefix();} case STRUCT_COMPARISON: {if(ct_comp != o.comparisonType()) return false; break;} case STRUCT_FUNCTION: {if(o_function != o.function()) return false; break;} case STRUCT_LOGICAL_OR: {} case STRUCT_LOGICAL_XOR: {} case STRUCT_LOGICAL_AND: { if(SIZE < 1) return false; if(SIZE == 2) { return (CHILD(0) == o[0] && CHILD(1) == o[1]) || (CHILD(0) == o[1] && CHILD(1) == o[0]); } vector i2taken; for(size_t i = 0; i < SIZE; i++) { bool b = false, b2 = false; for(size_t i2 = 0; i2 < o.size(); i2++) { if(CHILD(i).equals(o[i2])) { b2 = true; for(size_t i3 = 0; i3 < i2taken.size(); i3++) { if(i2taken[i3] == i2) { b2 = false; } } if(b2) { b = true; i2taken.push_back(i2); break; } } } if(!b) return false; } return true; } default: {} } if((o_uncertainty == NULL) !=(o.uncertainty() == NULL)) return false; if(o_uncertainty && !o_uncertainty->equals(*o.uncertainty())) return false; if(SIZE < 1) return false; for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).equals(o[i])) return false; } return true; } bool MathStructure::equals(const Number &o) const { if(m_type != STRUCT_NUMBER) return false; return o_number.equals(o); } bool MathStructure::equals(int i) const { if(m_type != STRUCT_NUMBER) return false; return o_number.equals(Number(i, 1)); } bool MathStructure::equals(Unit *u) const { if(m_type != STRUCT_UNIT) return false; return o_unit == u; } bool MathStructure::equals(Variable *v) const { if(m_type != STRUCT_VARIABLE) return false; return o_variable == v; } bool MathStructure::equals(string sym) const { if(m_type != STRUCT_SYMBOLIC) return false; return s_sym == sym; } ComparisonResult MathStructure::compare(const MathStructure &o) const { if(isNumber() && o.isNumber()) { return o_number.compare(o.number()); } if(equals(o)) return COMPARISON_RESULT_EQUAL; if(o.representsReal(true) && representsComplex(true)) return COMPARISON_RESULT_NOT_EQUAL; if(representsReal(true) && o.representsComplex(true)) return COMPARISON_RESULT_NOT_EQUAL; MathStructure mtest(*this); mtest -= o; EvaluationOptions eo = default_evaluation_options; eo.approximation = APPROXIMATION_APPROXIMATE; mtest.calculatesub(eo, eo); bool incomp = false; if(mtest.isAddition()) { for(size_t i = 1; i < mtest.size(); i++) { if(mtest[i - 1].isUnitCompatible(mtest[i]) == 0) { incomp = true; break; } } } if(mtest.isZero()) return COMPARISON_RESULT_EQUAL; else if(mtest.representsPositive(true)) {if(incomp) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_LESS;} else if(mtest.representsNegative(true)) {if(incomp) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_GREATER;} else if(mtest.representsNonZero(true)) return COMPARISON_RESULT_NOT_EQUAL; else if(mtest.representsNonPositive(true)) {if(incomp) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_EQUAL_OR_LESS;} else if(mtest.representsNonNegative(true)) {if(incomp) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_EQUAL_OR_GREATER;} return COMPARISON_RESULT_UNKNOWN; } ComparisonResult MathStructure::compareApproximately(const MathStructure &o) const { if(isNumber() && o.isNumber()) { return o_number.compareApproximately(o.number()); } if(equals(o)) return COMPARISON_RESULT_EQUAL; if(o.representsReal(true) && representsComplex(true)) return COMPARISON_RESULT_NOT_EQUAL; if(representsReal(true) && o.representsComplex(true)) return COMPARISON_RESULT_NOT_EQUAL; MathStructure mtest(*this); mtest -= o; EvaluationOptions eo = default_evaluation_options; eo.approximation = APPROXIMATION_APPROXIMATE; mtest.calculatesub(eo, eo); bool incomp = false; if(mtest.isAddition()) { for(size_t i = 1; i < mtest.size(); i++) { if(mtest[i - 1].isUnitCompatible(mtest[i]) == 0) { incomp = true; break; } } } if(mtest.isZero()) return COMPARISON_RESULT_EQUAL; else if(mtest.representsPositive(true)) {if(incomp) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_LESS;} else if(mtest.representsNegative(true)) {if(incomp) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_GREATER;} else if(mtest.representsNonZero(true)) return COMPARISON_RESULT_NOT_EQUAL; else if(mtest.representsNonPositive(true)) {if(incomp) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_EQUAL_OR_LESS;} else if(mtest.representsNonNegative(true)) {if(incomp) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_EQUAL_OR_GREATER;} return COMPARISON_RESULT_UNKNOWN; } int MathStructure::merge_addition(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this, size_t index_mstruct, bool reversed) { if(mstruct.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.add(mstruct.number()) && (eo.approximation == APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate())) { if(o_number == nr) { o_number = nr; numberUpdated(); return 2; } o_number = nr; numberUpdated(); return 1; } return -1; } if(isZero()) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } if(mstruct.isZero()) { MERGE_APPROX_AND_PREC(mstruct) return 2; } if(m_type == STRUCT_NUMBER && o_number.isInfinite()) { if(mstruct.representsNumber(false)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } } else if(mstruct.isNumber() && mstruct.number().isInfinite()) { if(representsNumber(false)) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { clear(true); o_number = mstruct.number(); MERGE_APPROX_AND_PREC(mstruct) } return 3; } } if(representsUndefined() || mstruct.representsUndefined()) return -1; switch(m_type) { case STRUCT_VECTOR: { switch(mstruct.type()) { case STRUCT_VECTOR: { if(SIZE == mstruct.size()) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculateAdd(mstruct[i], eo, this, i); } MERGE_APPROX_AND_PREC(mstruct) return 1; } } default: { return -1; } } return -1; } case STRUCT_ADDITION: { switch(mstruct.type()) { case STRUCT_VECTOR: { return -1; } case STRUCT_ADDITION: { for(size_t i = 0; i < mstruct.size(); i++) { if(reversed) { INSERT_REF(&mstruct[i], i) calculateAddIndex(i, eo, false); } else { APPEND_REF(&mstruct[i]); calculateAddLast(eo, false); } } MERGE_APPROX_AND_PREC(mstruct) if(SIZE == 1) { setToChild(1, false, mparent, index_this + 1); } else if(SIZE == 0) { clear(true); } else { evalSort(); } return 1; } default: { MERGE_APPROX_AND_PREC(mstruct) if(reversed) { PREPEND_REF(&mstruct); calculateAddIndex(0, eo, true, mparent, index_this); } else { APPEND_REF(&mstruct); calculateAddLast(eo, true, mparent, index_this); } return 1; } } break; } case STRUCT_MULTIPLICATION: { switch(mstruct.type()) { case STRUCT_VECTOR: {return -1;} case STRUCT_ADDITION: { return 0; } case STRUCT_MULTIPLICATION: { size_t i1 = 0, i2 = 0; bool b = true; if(CHILD(0).isNumber()) i1 = 1; if(mstruct[0].isNumber()) i2 = 1; if(SIZE - i1 == mstruct.size() - i2) { for(size_t i = i1; i < SIZE; i++) { if(CHILD(i) != mstruct[i + i2 - i1]) { b = false; break; } } if(b) { if(i1 == 0) { PREPEND(m_one); } if(i2 == 0) { CHILD(0).number()++; } else { CHILD(0).number() += mstruct[0].number(); } MERGE_APPROX_AND_PREC(mstruct) calculateMultiplyIndex(0, eo, true, mparent, index_this); return 1; } } b = true; size_t divs = 0; for(; b && i1 < SIZE; i1++) { if(CHILD(i1).isPower() && CHILD(i1)[1].hasNegativeSign()) { divs++; b = false; for(; i2 < mstruct.size(); i2++) { if(mstruct[i2].isPower() && mstruct[i2][1].hasNegativeSign()) { if(mstruct[i2] == CHILD(i1)) { b = true; } i2++; break; } } } } if(b && divs > 0) { for(; i2 < mstruct.size(); i2++) { if(mstruct[i2].isPower() && mstruct[i2][1].hasNegativeSign()) { b = false; break; } } } if(b && divs > 0) { if(SIZE - divs == 0) { if(mstruct.size() - divs == 0) { calculateMultiply(MathStructure(2, 1), eo); } else if(mstruct.size() - divs == 1) { PREPEND(m_one); for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].isPower() || !mstruct[i][1].hasNegativeSign()) { mstruct[i].ref(); CHILD(0).add_nocopy(&mstruct[i], true); CHILD(0).calculateAddLast(eo, true, this, 0); break; } } calculateMultiplyIndex(0, eo, true, mparent, index_this); } else { for(size_t i = 0; i < mstruct.size();) { if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { mstruct.delChild(i + 1); } else { i++; } } PREPEND(m_one); mstruct.ref(); CHILD(0).add_nocopy(&mstruct, true); CHILD(0).calculateAddLast(eo, true, this, 0); calculateMultiplyIndex(0, eo, true, mparent, index_this); } } else if(SIZE - divs == 1) { size_t index = 0; for(; index < SIZE; index++) { if(!CHILD(index).isPower() || !CHILD(index)[1].hasNegativeSign()) { break; } } if(mstruct.size() - divs == 0) { if(IS_REAL(CHILD(index))) { CHILD(index).number()++; } else { CHILD(index).calculateAdd(m_one, eo, this, index); } calculateMultiplyIndex(index, eo, true, mparent, index_this); } else if(mstruct.size() - divs == 1) { for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].isPower() || !mstruct[i][1].hasNegativeSign()) { mstruct[i].ref(); CHILD(index).add_nocopy(&mstruct[i], true); CHILD(index).calculateAddLast(eo, true, this, index); break; } } calculateMultiplyIndex(index, eo, true, mparent, index_this); } else { for(size_t i = 0; i < mstruct.size();) { if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { mstruct.delChild(i + 1); } else { i++; } } mstruct.ref(); CHILD(index).add_nocopy(&mstruct, true); CHILD(index).calculateAddLast(eo, true, this, index); calculateMultiplyIndex(index, eo, true, mparent, index_this); } } else { for(size_t i = 0; i < SIZE;) { if(CHILD(i).isPower() && CHILD(i)[1].hasNegativeSign()) { ERASE(i); } else { i++; } } if(mstruct.size() - divs == 0) { calculateAdd(m_one, eo); } else if(mstruct.size() - divs == 1) { for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].isPower() || !mstruct[i][1].hasNegativeSign()) { mstruct[i].ref(); add_nocopy(&mstruct[i], true); calculateAddLast(eo); break; } } } else { MathStructure *mstruct2 = new MathStructure(); mstruct2->setType(STRUCT_MULTIPLICATION); for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].isPower() || !mstruct[i][1].hasNegativeSign()) { mstruct[i].ref(); mstruct2->addChild_nocopy(&mstruct[i]); } } add_nocopy(mstruct2, true); calculateAddLast(eo, true, mparent, index_this); } for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { mstruct[i].ref(); multiply_nocopy(&mstruct[i], true); calculateMultiplyLast(eo); } } } return 1; } break; } case STRUCT_POWER: { if(mstruct[1].hasNegativeSign()) { bool b = false; size_t index = 0; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isPower() && CHILD(i)[1].hasNegativeSign()) { if(b) { b = false; break; } if(mstruct == CHILD(i)) { index = i; b = true; } if(!b) break; } } if(b) { if(SIZE == 2) { if(index == 0) setToChild(2, true); else setToChild(1, true); } else { ERASE(index); } calculateAdd(m_one, eo); mstruct.ref(); multiply_nocopy(&mstruct, false); calculateMultiplyLast(eo, true, mparent, index_this); return 1; } } } default: { if(SIZE == 2 && CHILD(0).isNumber() && CHILD(1) == mstruct) { CHILD(0).number()++; MERGE_APPROX_AND_PREC(mstruct) calculateMultiplyIndex(0, eo, true, mparent, index_this); return 1; } } } break; } default: { switch(mstruct.type()) { case STRUCT_VECTOR: {return -1;} case STRUCT_ADDITION: {} case STRUCT_MULTIPLICATION: { return 0; } default: { if(equals(mstruct)) { multiply_nocopy(new MathStructure(2, 1), true); MERGE_APPROX_AND_PREC(mstruct) calculateMultiplyLast(eo, true, mparent, index_this); return 1; } } } } } return -1; } bool reducable(const MathStructure &mnum, const MathStructure &mden, Number &nr) { switch(mnum.type()) { case STRUCT_NUMBER: {} case STRUCT_ADDITION: { break; } default: { if(mnum.representsNonZero(true)) { bool reduce = true; for(size_t i = 0; i < mden.size() && reduce; i++) { switch(mden[i].type()) { case STRUCT_MULTIPLICATION: { reduce = false; for(size_t i2 = 0; i2 < mden[i].size(); i2++) { if(mnum == mden[i][i2]) { reduce = true; if(!nr.isOne() && !nr.isFraction()) nr.set(1, 1); break; } else if(mden[i][i2].isPower() && mden[i][i2][1].isNumber() && mden[i][i2][1].number().isReal() && mnum == mden[i][i2][0]) { if(!mden[i][i2][1].number().isPositive()) { break; } if(mden[i][i2][1].number().isLessThan(nr)) nr = mden[i][i2][1].number(); reduce = true; break; } } break; } case STRUCT_POWER: { if(mden[i][1].isNumber() && mden[i][1].number().isReal() && mnum == mden[i][0]) { if(!mden[i][1].number().isPositive()) { reduce = false; break; } if(mden[i][1].number().isLessThan(nr)) nr = mden[i][1].number(); break; } } default: { if(mnum != mden[i]) { reduce = false; break; } if(!nr.isOne() && !nr.isFraction()) nr.set(1, 1); } } } return reduce; } } } return false; } void reduce(const MathStructure &mnum, MathStructure &mden, Number &nr, const EvaluationOptions &eo) { switch(mnum.type()) { case STRUCT_NUMBER: {} case STRUCT_ADDITION: { break; } default: { for(size_t i = 0; i < mden.size(); i++) { switch(mden[i].type()) { case STRUCT_MULTIPLICATION: { for(size_t i2 = 0; i2 < mden[i].size(); i2++) { if(mden[i][i2] == mnum) { if(!nr.isOne()) { MathStructure *mexp = new MathStructure(1, 1); mexp->number() -= nr; mden[i][i2].raise_nocopy(mexp); mden[i][i2].calculateRaiseExponent(eo, &mden[i], i2); } else { if(mden[i].size() == 1) { mden[i].set(m_one); } else { mden[i].delChild(i2 + 1); if(mden[i].size() == 1) { mden[i].setToChild(1, true, &mden, i + 1); } } } break; } else if(mden[i][i2].isPower() && mden[i][i2][1].isNumber() && mden[i][i2][1].number().isReal() && mnum.equals(mden[i][i2][0])) { mden[i][i2][1].number() -= nr; if(mden[i][i2][1].number().isOne()) { mden[i][i2].setToChild(1, true, &mden[i], i2 + 1); } else { mden[i][i2].calculateRaiseExponent(eo, &mden[i], i2); } break; } } break; } case STRUCT_POWER: { if(mden[i][1].isNumber() && mden[i][1].number().isReal() && mnum.equals(mden[i][0])) { mden[i][1].number() -= nr; if(mden[i][1].number().isOne()) { mden[i].setToChild(1, true, &mden, i + 1); } else { mden[i].calculateRaiseExponent(eo, &mden, i); } break; } } default: { if(!nr.isOne()) { MathStructure *mexp = new MathStructure(1, 1); mexp->number() -= nr; mden[i].raise_nocopy(mexp); mden[i].calculateRaiseExponent(eo, &mden, 1); } else { mden[i].set(m_one); } } } } mden.calculatesub(eo, eo, false); } } } bool addablePower(const MathStructure &mstruct, const EvaluationOptions &eo) { if(mstruct[0].representsNonNegative(true)) return true; if(mstruct[1].representsInteger()) return true; return eo.allow_complex && mstruct[0].representsNegative(true) && mstruct[1].isNumber() && mstruct[1].number().isRational() && mstruct[1].number().denominatorIsEven(); } int MathStructure::merge_multiplication(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this, size_t index_mstruct, bool reversed, bool do_append) { if(mstruct.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.multiply(mstruct.number()) && (eo.approximation == APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.isInfinite() || o_number.isInfinite() || mstruct.number().isInfinite())) { if(o_number == nr) { o_number = nr; numberUpdated(); return 2; } o_number = nr; numberUpdated(); return 1; } return -1; } if(mstruct.isOne()) { MERGE_APPROX_AND_PREC(mstruct) return 2; } else if(isOne()) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } if(m_type == STRUCT_NUMBER && o_number.isInfinite()) { if(o_number.isMinusInfinity()) { if(mstruct.representsPositive(false)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } else if(mstruct.representsNegative(false)) { o_number.setPlusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(o_number.isPlusInfinity()) { if(mstruct.representsPositive(false)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } else if(mstruct.representsNegative(false)) { o_number.setMinusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } if(mstruct.representsReal(false) && mstruct.representsNonZero(false)) { o_number.setInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(mstruct.isNumber() && mstruct.number().isInfinite()) { if(mstruct.number().isMinusInfinity()) { if(representsPositive(false)) { clear(true); o_number.setMinusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(representsNegative(false)) { clear(true); o_number.setPlusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(mstruct.number().isPlusInfinity()) { if(representsPositive(false)) { clear(true); o_number.setPlusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(representsNegative(false)) { clear(true); o_number.setMinusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } if(representsReal(false) && representsNonZero(false)) { clear(true); o_number.setInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } if(representsUndefined() || mstruct.representsUndefined()) return -1; const MathStructure *mnum = NULL, *mden = NULL; bool b_nonzero = false; if(eo.reduce_divisions) { if(!isNumber() && mstruct.isPower() && mstruct[0].isAddition() && mstruct[0].size() > 1 && mstruct[1].isNumber() && mstruct[1].number().isMinusOne()) { if((!isPower() || !CHILD(1).hasNegativeSign()) && representsNumber() && mstruct[0].representsNumber()) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mstruct[0].representsZero(true)) || mstruct[0].representsNonZero(true)) { b_nonzero = true; } if(b_nonzero || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mstruct[0].representsZero(true))) { mnum = this; mden = &mstruct[0]; } } } else if(!mstruct.isNumber() && isPower() && CHILD(0).isAddition() && CHILD(0).size() > 1 && CHILD(1).isNumber() && CHILD(1).number().isMinusOne()) { if((!mstruct.isPower() || !mstruct[1].hasNegativeSign()) && mstruct.representsNumber() && CHILD(0).representsNumber()) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !CHILD(0).representsZero(true)) || CHILD(0).representsNonZero(true)) { b_nonzero = true; } if(b_nonzero || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !CHILD(0).representsZero(true))) { mnum = &mstruct; mden = &CHILD(0); } } } } if(mnum && mden && eo.reduce_divisions) { switch(mnum->type()) { case STRUCT_ADDITION: { break; } case STRUCT_MULTIPLICATION: { Number nr; vector nrs; vector reducables; for(size_t i = 0; i < mnum->size(); i++) { switch((*mnum)[i].type()) { case STRUCT_ADDITION: {break;} case STRUCT_POWER: { if((*mnum)[i][1].isNumber() && (*mnum)[i][1].number().isReal()) { if((*mnum)[i][1].number().isPositive()) { nr.set((*mnum)[i][1].number()); if(reducable((*mnum)[i][0], *mden, nr)) { nrs.push_back(nr); reducables.push_back(i); } } break; } } default: { nr.set(1, 1); if(reducable((*mnum)[i], *mden, nr)) { nrs.push_back(nr); reducables.push_back(i); } } } } if(reducables.size() > 0) { if(!b_nonzero && eo.warn_about_denominators_assumed_nonzero && !warn_about_denominators_assumed_nonzero(*mden, eo)) break; if(mnum == this) { mstruct.ref(); transform_nocopy(STRUCT_MULTIPLICATION, &mstruct); } else { transform(STRUCT_MULTIPLICATION); PREPEND_REF(&mstruct); } size_t i_erased = 0; for(size_t i = 0; i < reducables.size(); i++) { switch(CHILD(0)[reducables[i] - i_erased].type()) { case STRUCT_POWER: { if(CHILD(0)[reducables[i] - i_erased][1].isNumber() && CHILD(0)[reducables[i] - i_erased][1].number().isReal()) { reduce(CHILD(0)[reducables[i] - i_erased][0], CHILD(1)[0], nrs[i], eo); if(nrs[i] == CHILD(0)[reducables[i] - i_erased][1].number()) { CHILD(0).delChild(reducables[i] - i_erased + 1); i_erased++; } else { CHILD(0)[reducables[i] - i_erased][1].number() -= nrs[i]; if(CHILD(0)[reducables[i] - i_erased][1].number().isOne()) { CHILD(0)[reducables[i] - i_erased].setToChild(1, true, &CHILD(0), reducables[i] - i_erased + 1); } else { CHILD(0)[reducables[i] - i_erased].calculateRaiseExponent(eo, &CHILD(0), reducables[i] - i_erased); } CHILD(0).calculateMultiplyIndex(reducables[i] - i_erased, eo, true, this, 0); } break; } } default: { reduce(CHILD(0)[reducables[i] - i_erased], CHILD(1)[0], nrs[i], eo); if(nrs[i].isOne()) { CHILD(0).delChild(reducables[i] - i_erased + 1); i_erased++; } else { MathStructure mexp(1, 1); mexp.number() -= nrs[i]; CHILD(0)[reducables[i] - i_erased].calculateRaise(mexp, eo, &CHILD(0), reducables[i] - i_erased); CHILD(0).calculateMultiplyIndex(reducables[i] - i_erased, eo, true, this, 0); } } } } if(CHILD(0).size() == 0) { setToChild(2, true, mparent, index_this + 1); } else if(CHILD(0).size() == 1) { CHILD(0).setToChild(1, true, this, 1); calculateMultiplyIndex(0, eo, true, mparent, index_this); } else { calculateMultiplyIndex(0, eo, true, mparent, index_this); } return 1; } break; } case STRUCT_POWER: { if((*mnum)[1].isNumber() && (*mnum)[1].number().isReal()) { if((*mnum)[1].number().isPositive()) { Number nr((*mnum)[1].number()); if(reducable((*mnum)[0], *mden, nr)) { if(!b_nonzero && eo.warn_about_denominators_assumed_nonzero && !warn_about_denominators_assumed_nonzero(*mden, eo)) break; if(nr != (*mnum)[1].number()) { MathStructure mnum2((*mnum)[0]); if(mnum == this) { CHILD(1).number() -= nr; if(CHILD(1).number().isOne()) { set(mnum2); } else { calculateRaiseExponent(eo); } mstruct.ref(); transform_nocopy(STRUCT_MULTIPLICATION, &mstruct); calculateMultiplyLast(eo); } else { transform(STRUCT_MULTIPLICATION); PREPEND(mstruct); CHILD(0)[1].number() -= nr; if(CHILD(0)[1].number().isOne()) { CHILD(0) = mnum2; } else { CHILD(0).calculateRaiseExponent(eo); } calculateMultiplyIndex(0, eo); } reduce(mnum2, CHILD(1)[0], nr, eo); } else { if(mnum == this) { MathStructure mnum2((*mnum)[0]); if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); reduce(mnum2, (*mparent)[index_this][0], nr, eo); } else { set_nocopy(mstruct, true); reduce(mnum2, CHILD(0), nr, eo); } } else { reduce((*mnum)[0], CHILD(0), nr, eo); } } return 1; } } break; } } default: { Number nr(1, 1); if(reducable(*mnum, *mden, nr)) { if(!b_nonzero && eo.warn_about_denominators_assumed_nonzero && !warn_about_denominators_assumed_nonzero(*mden, eo)) break; if(mnum == this) { MathStructure mnum2(*mnum); if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); reduce(mnum2, (*mparent)[index_this][0], nr, eo); (*mparent)[index_this].calculateRaiseExponent(eo, mparent, index_this); } else { set_nocopy(mstruct, true); reduce(mnum2, CHILD(0), nr, eo); calculateRaiseExponent(eo, mparent, index_this); } } else { reduce(*mnum, CHILD(0), nr, eo); calculateRaiseExponent(eo, mparent, index_this); } return 1; } } } } switch(m_type) { case STRUCT_VECTOR: { switch(mstruct.type()) { case STRUCT_VECTOR: { if(isMatrix() && mstruct.isMatrix()) { if(CHILD(0).size() != mstruct.size()) { CALCULATOR->error(true, _("The second matrix must have as many rows (was %s) as the first has columns (was %s) for matrix multiplication."), i2s(mstruct.size()).c_str(), i2s(CHILD(0).size()).c_str(), NULL); return -1; } MathStructure msave(*this); size_t rows = size(); clearMatrix(true); resizeMatrix(rows, mstruct[0].size(), m_zero); MathStructure mtmp; for(size_t index_r = 0; index_r < SIZE; index_r++) { for(size_t index_c = 0; index_c < CHILD(0).size(); index_c++) { for(size_t index = 0; index < msave[0].size(); index++) { mtmp = msave[index_r][index]; mtmp.calculateMultiply(mstruct[index][index_c], eo); CHILD(index_r)[index_c].calculateAdd(mtmp, eo, &CHILD(index_r), index_c); } } } MERGE_APPROX_AND_PREC(mstruct) return 1; } else { if(SIZE == mstruct.size()) { for(size_t i = 0; i < SIZE; i++) { mstruct[i].ref(); CHILD(i).multiply_nocopy(&mstruct[i], true); CHILD(i).calculateMultiplyLast(eo, true, this, i); } m_type = STRUCT_ADDITION; MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false, mparent, index_this); return 1; } } return -1; } default: { for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculateMultiply(mstruct, eo, this, i); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false, mparent, index_this); return 1; } } } case STRUCT_ADDITION: { switch(mstruct.type()) { case STRUCT_VECTOR: { return 0; } case STRUCT_ADDITION: { if(eo.expand) { MathStructure msave(*this); CLEAR; for(size_t i = 0; i < mstruct.size(); i++) { APPEND(msave); mstruct[i].ref(); LAST.multiply_nocopy(&mstruct[i], true); if(reversed) { LAST.swapChildren(1, LAST.size()); LAST.calculateMultiplyIndex(0, eo, true, this, SIZE - 1); } else { LAST.calculateMultiplyLast(eo, true, this, SIZE - 1); } } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false, mparent, index_this); return 1; } else { if(equals(mstruct)) { raise_nocopy(new MathStructure(2, 1)); MERGE_APPROX_AND_PREC(mstruct) return 1; } } break; } case STRUCT_POWER: { if(mstruct[1].isNumber() && *this == mstruct[0] && addablePower(mstruct, eo)) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !representsZero(true)) || (mstruct[1].isNumber() && mstruct[1].number().isReal() && !mstruct[1].number().isMinusOne()) || representsNonZero(true) || mstruct[1].representsPositive() || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !representsZero(true) && warn_about_denominators_assumed_nonzero_or_positive(*this, mstruct[1], eo))) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); (*mparent)[index_this][1].number()++; (*mparent)[index_this].calculateRaiseExponent(eo, mparent, index_this); } else { set_nocopy(mstruct, true); CHILD(1).number()++; calculateRaiseExponent(eo, mparent, index_this); } return 1; } } if(!eo.expand && mstruct[0].isAddition()) return -1; if(mstruct[1].hasNegativeSign()) { int ret; vector merged; merged.resize(SIZE, false); size_t merges = 0; MathStructure *mstruct2 = new MathStructure(mstruct); for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isOne()) ret = -1; else ret = CHILD(i).merge_multiplication(*mstruct2, eo, NULL, 0, 0, false, false); if(ret == 0) { ret = mstruct2->merge_multiplication(CHILD(i), eo, NULL, 0, 0, true, false); if(ret >= 1) { mstruct2->ref(); setChild_nocopy(mstruct2, i + 1); } } if(ret >= 1) { mstruct2->unref(); if(i + 1 != SIZE) mstruct2 = new MathStructure(mstruct); merged[i] = true; merges++; } else { if(i + 1 == SIZE) mstruct2->unref(); merged[i] = false; } } if(merges == 0) { return -1; } else if(merges == SIZE) { calculatesub(eo, eo, false, mparent, index_this); return 1; } else if(merges == SIZE - 1) { for(size_t i = 0; i < SIZE; i++) { if(!merged[i]) { mstruct.ref(); CHILD(i).multiply_nocopy(&mstruct, true); break; } } calculatesub(eo, eo, false, mparent, index_this); } else { MathStructure *mdiv = new MathStructure(); merges = 0; for(size_t i = 0; i - merges < SIZE; i++) { if(!merged[i]) { CHILD(i - merges).ref(); if(merges > 0) { (*mdiv)[0].add_nocopy(&CHILD(i - merges), merges > 1); } else { mdiv->multiply(mstruct); mdiv->setChild_nocopy(&CHILD(i - merges), 1); } ERASE(i - merges); merges++; } } add_nocopy(mdiv, true); calculatesub(eo, eo, false); } return 1; } if(!eo.expand) return -1; } case STRUCT_MULTIPLICATION: { if(!eo.expand && do_append) { transform(STRUCT_MULTIPLICATION); for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } return 1; } } default: { if(!eo.expand) return -1; for(size_t i = 0; i < SIZE; i++) { CHILD(i).multiply(mstruct, true); if(reversed) { CHILD(i).swapChildren(1, CHILD(i).size()); CHILD(i).calculateMultiplyIndex(0, eo, true, this, i); } else { CHILD(i).calculateMultiplyLast(eo, true, this, i); } } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false, mparent, index_this); return 1; } } return -1; } case STRUCT_MULTIPLICATION: { switch(mstruct.type()) { case STRUCT_VECTOR: {} case STRUCT_ADDITION: { if(!eo.expand) { if(!do_append) return -1; APPEND_REF(&mstruct); return 1; } return 0; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < mstruct.size(); i++) { if(reversed) { PREPEND_REF(&mstruct[i]); calculateMultiplyIndex(0, eo, false); } else { APPEND_REF(&mstruct[i]); calculateMultiplyLast(eo, false); } } MERGE_APPROX_AND_PREC(mstruct) if(SIZE == 1) { setToChild(1, false, mparent, index_this + 1); } else if(SIZE == 0) { clear(true); } else { evalSort(); } return 1; } case STRUCT_POWER: { if(mstruct[1].isNumber()) { if(*this == mstruct[0] && addablePower(mstruct, eo)) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !representsZero(true)) || (mstruct[1].isNumber() && mstruct[1].number().isReal() && !mstruct[1].number().isMinusOne()) || representsNonZero(true) || mstruct[1].representsPositive() || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !representsZero(true) && warn_about_denominators_assumed_nonzero_or_positive(*this, mstruct[1], eo))) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); (*mparent)[index_this][1].number()++; (*mparent)[index_this].calculateRaiseExponent(eo, mparent, index_this); } else { set_nocopy(mstruct, true); CHILD(1).number()++; calculateRaiseExponent(eo, mparent, index_this); } return 1; } } else { for(size_t i = 0; i < SIZE; i++) { int ret = CHILD(i).merge_multiplication(mstruct, eo, NULL, 0, 0, false, false); if(ret == 0) { ret = mstruct.merge_multiplication(CHILD(i), eo, NULL, 0, 0, true, false); if(ret >= 1) { if(ret == 2) ret = 3; else if(ret == 3) ret = 2; mstruct.ref(); setChild_nocopy(&mstruct, i + 1); } } if(ret >= 1) { if(ret != 2) calculateMultiplyIndex(i, eo, true, mparent, index_this); return 1; } } } } } default: { if(do_append) { MERGE_APPROX_AND_PREC(mstruct) if(reversed) { PREPEND_REF(&mstruct); calculateMultiplyIndex(0, eo, true, mparent, index_this); } else { APPEND_REF(&mstruct); calculateMultiplyLast(eo, true, mparent, index_this); } return 1; } } } return -1; } case STRUCT_POWER: { switch(mstruct.type()) { case STRUCT_VECTOR: {} case STRUCT_ADDITION: {} case STRUCT_MULTIPLICATION: { return 0; } case STRUCT_POWER: { if(mstruct[0] == CHILD(0)) { bool b = CHILD(0).representsNonNegative(true), b2 = true, b_warn = false; if(!b) { b = CHILD(1).representsInteger() && mstruct[1].representsInteger(); } if(!b) { b = eo.allow_complex && CHILD(0).representsNegative(); if(b) { b = (CHILD(1).representsInteger() || (CHILD(1).isNumber() && CHILD(1).number().isRational() && CHILD(1).number().denominatorIsEven())); } if(b) { b = (mstruct[1].representsInteger() || (mstruct[1].isNumber() && mstruct[1].number().isRational() && mstruct[1].number().denominatorIsEven())); } } if(b) { b = false; bool b2test = false; if(IS_REAL(mstruct[1]) && IS_REAL(CHILD(1))) { if(mstruct[1].number().isPositive() == CHILD(1).number().isPositive()) { b2 = true; b = true; } else if(!mstruct[1].number().isMinusOne() && !CHILD(1).number().isMinusOne()) { b2 = (mstruct[1].number() + CHILD(1).number()).isNegative(); b = true; if(!b2) b2test = true; } } if(!b || b2test) { b = (!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !CHILD(0).representsZero(true)) || CHILD(0).representsNonZero(true) || (CHILD(1).representsPositive() && mstruct[1].representsPositive()) || (CHILD(1).representsNegative() && mstruct[1].representsNegative()); if(!b && eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !CHILD(0).representsZero(true)) { b = true; b_warn = true; } if(b2test) { b2 = b; b = true; } } } if(b) { if(IS_REAL(CHILD(1)) && IS_REAL(mstruct[1])) { if(!b2 && !do_append) return -1; if(b_warn && !warn_about_denominators_assumed_nonzero(CHILD(0), eo)) return -1; if(b2) { CHILD(1).number() += mstruct[1].number(); calculateRaiseExponent(eo, mparent, index_this); } else { if(CHILD(1).number().isNegative()) { CHILD(1).number()++; mstruct[1].number() += CHILD(1).number(); CHILD(1).number().set(-1, 1); } else { mstruct[1].number()++; CHILD(1).number() += mstruct[1].number(); mstruct[1].number().set(-1, 1); } MERGE_APPROX_AND_PREC(mstruct) transform(STRUCT_MULTIPLICATION); CHILD(0).calculateRaiseExponent(eo, this, 0); if(reversed) { PREPEND_REF(&mstruct); CHILD(0).calculateRaiseExponent(eo, this, 0); calculateMultiplyIndex(0, eo, true, mparent, index_this); } else { APPEND_REF(&mstruct); CHILD(1).calculateRaiseExponent(eo, this, 1); calculateMultiplyLast(eo, true, mparent, index_this); } } return 1; } else { MathStructure mstruct2(CHILD(1)); mstruct2 += mstruct[1]; if(mstruct2.calculatesub(eo, eo, false)) { if(b_warn && !warn_about_denominators_assumed_nonzero_llgg(CHILD(0), CHILD(1), mstruct[1], eo)) return -1; CHILD(1) = mstruct2; calculateRaiseExponent(eo, mparent, index_this); return 1; } } } } else if(mstruct[1] == CHILD(1) && (mstruct[1].representsInteger() || CHILD(0).representsPositive(true) || mstruct[0].representsPositive(true))) { MathStructure mstruct2(CHILD(0)); if(mstruct2.calculateMultiply(mstruct[0], eo)) { CHILD(0) = mstruct2; MERGE_APPROX_AND_PREC(mstruct) calculateRaiseExponent(eo, mparent, index_this); return 1; } } break; } default: { if(!mstruct.isNumber() && CHILD(1).isNumber() && CHILD(0) == mstruct && addablePower(*this, eo)) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !CHILD(0).representsZero(true)) || (CHILD(1).isNumber() && CHILD(1).number().isReal() && !CHILD(1).number().isMinusOne()) || CHILD(0).representsNonZero(true) || CHILD(1).representsPositive() || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !CHILD(0).representsZero(true) && warn_about_denominators_assumed_nonzero_or_positive(CHILD(0), CHILD(1), eo))) { CHILD(1).number()++; MERGE_APPROX_AND_PREC(mstruct) calculateRaiseExponent(eo, mparent, index_this); return 1; } } if(mstruct.isZero() && (!eo.keep_zero_units || containsRepresentativeOfType(STRUCT_UNIT, true, true) == 0) && !representsUndefined(true, true, !eo.assume_denominators_nonzero)) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } break; } } return -1; } default: { switch(mstruct.type()) { case STRUCT_VECTOR: {} case STRUCT_ADDITION: {} case STRUCT_MULTIPLICATION: {} case STRUCT_POWER: { return 0; } default: { if(mstruct.isZero() && (!eo.keep_zero_units || containsRepresentativeOfType(STRUCT_UNIT, true, true) == 0) && !representsUndefined(true, true, !eo.assume_denominators_nonzero) && representsNonMatrix()) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 3; } if(isZero() && !mstruct.representsUndefined(true, true, !eo.assume_denominators_nonzero) && (!eo.keep_zero_units || !mstruct.containsRepresentativeOfType(STRUCT_UNIT, true, true)) && mstruct.representsNonMatrix()) { MERGE_APPROX_AND_PREC(mstruct) return 2; } if(equals(mstruct)) { raise_nocopy(new MathStructure(2, 1)); MERGE_APPROX_AND_PREC(mstruct) calculateRaiseExponent(eo, mparent, index_this); return 1; } break; } } break; } } return -1; } int MathStructure::merge_power(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this, size_t index_mstruct, bool) { if(mstruct.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.raise(mstruct.number(), eo.approximation != APPROXIMATION_APPROXIMATE) && (eo.approximation == APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.isInfinite() || o_number.isInfinite() || mstruct.number().isInfinite())) { if(o_number == nr) { o_number = nr; numberUpdated(); return 2; } o_number = nr; numberUpdated(); return 1; } if(mstruct.number().isRational()) { if(!mstruct.number().numeratorIsOne() && o_number.isPositive()) { nr = o_number; if(nr.raise(mstruct.number().numerator()) && (eo.approximation == APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.isInfinite() || o_number.isInfinite() || mstruct.number().isInfinite())) { o_number = nr; numberUpdated(); nr.set(mstruct.number().denominator()); nr.recip(); calculateRaise(nr, eo, mparent, index_this); return 1; } } else if(eo.split_squares && o_number.isInteger() && mstruct.number().denominatorIsTwo()) { nr.set(1, 1); bool b = true, overflow; int val; while(b) { b = false; overflow = false; val = o_number.intValue(&overflow); if(overflow) { cln::cl_I cval = cln::numerator(cln::rational(cln::realpart(o_number.internalNumber()))); for(size_t i = 0; i < NR_OF_PRIMES; i++) { if(cln::zerop(cln::rem(cval, SQUARE_PRIMES[i]))) { nr *= PRIMES[i]; o_number /= SQUARE_PRIMES[i]; b = true; break; } } } else { for(size_t i = 0; i < NR_OF_PRIMES; i++) { if(SQUARE_PRIMES[i] > val) { break; } else if(val % SQUARE_PRIMES[i] == 0) { nr *= PRIMES[i]; o_number /= SQUARE_PRIMES[i]; b = true; break; } } } } if(!nr.isOne()) { transform(STRUCT_MULTIPLICATION); CHILD(0).calculateRaise(mstruct, eo, this, 0); PREPEND(nr); calculateMultiplyIndex(0, eo, true, mparent, index_this); return 1; } } } return -1; } if(mstruct.isOne()) { MERGE_APPROX_AND_PREC(mstruct) return 2; } if(m_type == STRUCT_NUMBER && o_number.isInfinite()) { if(mstruct.representsNegative(false)) { o_number.clear(); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.representsNonZero(false) && mstruct.representsNumber(false)) { if(o_number.isMinusInfinity()) { if(mstruct.representsEven(false)) { o_number.setPlusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.representsOdd(false)) { MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.representsInteger(false)) { o_number.setInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } else if(mstruct.isNumber() && mstruct.number().isInfinite()) { if(mstruct.number().isInfinity()) { } else if(mstruct.number().isMinusInfinity()) { if(representsReal(false) && representsNonZero(false)) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(mstruct.number().isPlusInfinity()) { if(representsPositive(false)) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 1; } } } if(representsUndefined() || mstruct.representsUndefined()) return -1; if(isZero() && mstruct.representsPositive()) { return 1; } if(mstruct.isZero() && !representsUndefined(true, true)) { set(m_one); MERGE_APPROX_AND_PREC(mstruct) return 1; } switch(m_type) { case STRUCT_VECTOR: { if(mstruct.isNumber() && mstruct.number().isInteger()) { if(isMatrix()) { if(matrixIsSquare()) { Number nr(mstruct.number()); bool b_neg = false; if(nr.isNegative()) { nr.setNegative(false); b_neg = true; } if(!nr.isOne()) { MathStructure msave(*this); nr--; while(nr.isPositive()) { calculateMultiply(msave, eo); nr--; } } if(b_neg) { invertMatrix(eo); } MERGE_APPROX_AND_PREC(mstruct) return 1; } return -1; } else { if(mstruct.number().isMinusOne()) { return -1; } Number nr(mstruct.number()); if(nr.isNegative()) { nr++; } else { nr--; } MathStructure msave(*this); calculateMultiply(msave, eo); calculateRaise(nr, eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } } goto default_power_merge; } case STRUCT_ADDITION: { if(mstruct.isNumber() && mstruct.number().isInteger()) { if(mstruct.number().isMinusOne()) { return -1; bool bnum = false; for(size_t i = 0; !bnum && i < SIZE; i++) { switch(CHILD(i).type()) { case STRUCT_NUMBER: { if(!CHILD(i).number().isZero() && CHILD(i).number().isReal()) { bnum = true; } break; } case STRUCT_MULTIPLICATION: { if(CHILD(i).size() > 0 && CHILD(i)[0].isNumber()) { if(!CHILD(i)[0].number().isZero() && CHILD(i)[0].number().isReal()) { bnum = true; } break; } } default: {} } } if(bnum) { Number nr; size_t negs = 0; for(size_t i = 0; i < SIZE; i++) { switch(CHILD(i).type()) { case STRUCT_NUMBER: { if(!CHILD(i).number().isZero() && CHILD(i).number().isReal()) { if(CHILD(i).number().isNegative()) negs++; if(nr.isZero()) { nr = CHILD(i).number(); } else { if(negs) { if(CHILD(i).number().isNegative()) { nr.setNegative(true); if(CHILD(i).number().isGreaterThan(nr)) { nr = CHILD(i).number(); } break; } else { nr.setNegative(false); } } if(CHILD(i).number().isLessThan(nr)) { nr = CHILD(i).number(); } } } break; } case STRUCT_MULTIPLICATION: { if(CHILD(i).size() > 0 && CHILD(i)[0].isNumber()) { if(!CHILD(i)[0].number().isZero() && CHILD(i)[0].number().isReal()) { if(CHILD(i)[0].number().isNegative()) negs++; if(nr.isZero()) { nr = CHILD(i)[0].number(); } else { if(negs) { if(CHILD(i)[0].number().isNegative()) { nr.setNegative(true); if(CHILD(i)[0].number().isGreaterThan(nr)) { nr = CHILD(i)[0].number(); } break; } else { nr.setNegative(false); } } if(CHILD(i)[0].number().isLessThan(nr)) { nr = CHILD(i)[0].number(); } } } break; } } default: { if(nr.isZero() || !nr.isFraction()) { nr.set(1, 1); } } } } nr.setNegative(negs > SIZE - negs); if(bnum && !nr.isOne() && !nr.isZero()) { nr.recip(); for(size_t i = 0; i < SIZE; i++) { switch(CHILD(i).type()) { case STRUCT_NUMBER: { if(IS_REAL(CHILD(i))) CHILD(i).number() *= nr; else CHILD(i).calculateMultiply(nr, eo); break; } case STRUCT_MULTIPLICATION: { if(IS_REAL(CHILD(i)[0])) { CHILD(i)[0].number() *= nr; CHILD(i).calculateMultiplyIndex(0, eo, true, this, i); } else { CHILD(i).calculateMultiply(nr, eo, this, i); } break; } default: { CHILD(i).calculateMultiply(nr, eo); } } } calculatesub(eo, eo, false); mstruct.ref(); raise_nocopy(&mstruct); calculateRaiseExponent(eo); calculateMultiply(nr, eo, mparent, index_this); return 1; } } } else if(eo.expand && !mstruct.number().isZero()) { bool neg = mstruct.number().isNegative(); Number m(mstruct.number()); m.setNegative(false); if(!representsNonMatrix()) { MathStructure mthis(*this); while(!m.isOne()) { calculateMultiply(mthis, eo); m--; } } else { MathStructure mstruct1(CHILD(0)); MathStructure mstruct2(CHILD(1)); for(size_t i = 2; i < SIZE; i++) { mstruct2.add(CHILD(i), true); } Number k(1); Number p1(m); Number p2(1); p1--; Number bn; CLEAR APPEND(mstruct1); CHILD(0).calculateRaise(m, eo); while(k.isLessThan(m)) { bn.binomial(m, k); APPEND_NEW(bn); LAST.multiply(mstruct1); if(!p1.isOne()) { LAST[1].raise_nocopy(new MathStructure(p1)); LAST[1].calculateRaiseExponent(eo); } LAST.multiply(mstruct2, true); if(!p2.isOne()) { LAST[2].raise_nocopy(new MathStructure(p2)); LAST[2].calculateRaiseExponent(eo); } LAST.calculatesub(eo, eo, false); k++; p1--; p2++; } APPEND(mstruct2); LAST.calculateRaise(m, eo); calculatesub(eo, eo, false); } if(neg) calculateInverse(eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } } goto default_power_merge; } case STRUCT_MULTIPLICATION: { if(mstruct.representsInteger()) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculateRaise(mstruct, eo, this, i); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false, mparent, index_this); return 1; } else { bool b = true; for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNonNegative(true)) { b = false; break; } } if(b) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculateRaise(mstruct, eo, this, i); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false, mparent, index_this); return 1; } } goto default_power_merge; } case STRUCT_POWER: { if(mstruct.representsInteger() || (mstruct.isNumber() && mstruct.number().isRational() && !mstruct.number().denominatorIsEven()) || representsNonNegative(true)) { if(CHILD(1).isNumber() && CHILD(1).number().isRational() && (CHILD(1).isInteger() || CHILD(1).number().denominatorIsEven() || (!CHILD(1).number().numeratorIsEven() && mstruct.representsOdd()) || CHILD(0).representsNonNegative(true)) && (eo.allow_complex || !CHILD(1).number().denominatorIsEven() || CHILD(0).representsPositive(true) || CHILD(0).representsComplex())) { if(CHILD(1).number().numeratorIsEven() && !mstruct.representsInteger()) { if(CHILD(0).representsNegative(true)) { CHILD(0).calculateNegate(eo); } else if(!CHILD(0).representsNonNegative(true)) { MathStructure mstruct_base(CHILD(0)); CHILD(0).set(CALCULATOR->f_abs, &mstruct_base, NULL); } } mstruct.ref(); MERGE_APPROX_AND_PREC(mstruct) CHILD(1).multiply_nocopy(&mstruct, true); CHILD(1).calculateMultiplyLast(eo, true, this, 1); calculateRaiseExponent(eo, mparent, index_this); return 1; } else if(CHILD(0).representsNonNegative(true) || CHILD(1).representsInteger()) { mstruct.ref(); MERGE_APPROX_AND_PREC(mstruct) CHILD(1).multiply_nocopy(&mstruct, true); CHILD(1).calculateMultiplyLast(eo, true, this, 1); calculateRaiseExponent(eo, mparent, index_this); return 1; } } goto default_power_merge; } case STRUCT_VARIABLE: { if(o_variable == CALCULATOR->v_e) { if(mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[1].isVariable() && mstruct[1].variable() == CALCULATOR->v_pi) { if(mstruct[0].isNumber()) { if(mstruct[0].number().isI() || mstruct[0].number().isMinusI()) { set(m_minus_one, true); return 1; } else if(mstruct[0].number().isComplex() && !mstruct[0].number().hasRealPart()) { Number img(mstruct[0].number().imaginaryPart()); if(img.isInteger()) { if(img.isEven()) { set(m_one, true); } else { set(m_minus_one, true); } MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(img == Number(1, 2)) { clear(true); img.set(1, 1); o_number.setImaginaryPart(img); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(img == Number(-1, 2)) { clear(true); img.set(-1, 1); o_number.setImaginaryPart(img); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } else if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_ln && mstruct.size() == 1) { if(mstruct[0].representsPositive() || mstruct[0].representsComplex()) { set_nocopy(mstruct[0], true); return 1; } } } goto default_power_merge; } default: { default_power_merge: if(mstruct.isAddition()) { bool b = representsNonNegative(true); if(!b) { b = true; bool bneg = representsNegative(true); for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].representsInteger() && (!bneg || !eo.allow_complex || !mstruct[i].isNumber() || !mstruct[i].number().isRational() || !mstruct[i].number().denominatorIsEven())) { b = false; break; } } } if(b) { MathStructure msave(*this); clear(true); m_type = STRUCT_MULTIPLICATION; MERGE_APPROX_AND_PREC(mstruct) for(size_t i = 0; i < mstruct.size(); i++) { APPEND(msave); mstruct[i].ref(); LAST.raise_nocopy(&mstruct[i]); LAST.calculateRaiseExponent(eo, this, SIZE - 1); calculateMultiplyLast(eo, false); } if(SIZE == 1) { setToChild(1, false, mparent, index_this + 1); } else if(SIZE == 0) { clear(true); } else { evalSort(); } return 1; } } else if(mstruct.isMultiplication() && mstruct.size() > 1) { bool b = representsNonNegative(true); if(!b) { b = true; for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].representsInteger()) { b = false; break; } } } if(b) { MathStructure mthis(*this); for(size_t i = 0; i < mstruct.size(); i++) { if(isZero() && !mstruct[i].representsPositive(true)) continue; if(i == 0) mthis.raise(mstruct[i]); else mthis[1] = mstruct[i]; if(mthis.calculateRaiseExponent(eo)) { set(mthis); if(mstruct.size() == 2) { if(i == 0) { mstruct[1].ref(); raise_nocopy(&mstruct[1]); } else { mstruct[0].ref(); raise_nocopy(&mstruct[0]); } } else { mstruct.ref(); raise_nocopy(&mstruct); CHILD(1).delChild(i + 1); } calculateRaiseExponent(eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } else if(mstruct.isNumber() && mstruct.number().isRational() && !mstruct.number().isInteger() && !mstruct.number().numeratorIsOne() && !mstruct.number().numeratorIsMinusOne()) { if(representsNonNegative(true)) { if(isFunction() && function() == CALCULATOR->f_abs && size() == 1 && mstruct.number().numeratorIsEven()) { setToChild(1); } bool b; if(mstruct.number().isNegative()) { b = calculateRaise(-mstruct.number().numerator(), eo); if(!b) { setToChild(1); break; } raise(m_minus_one); CHILD(1).number() /= mstruct.number().denominator(); } else { b = calculateRaise(mstruct.number().numerator(), eo); if(!b) { setToChild(1); break; } raise(m_one); CHILD(1).number() /= mstruct.number().denominator(); } if(b) calculateRaiseExponent(eo); return 1; } else if(mstruct.number().denominatorIsEven() || !mstruct.number().numeratorIsEven()) { raise(m_one); CHILD(1).number() /= mstruct.number().denominator(); if(calculateRaiseExponent(eo)) { calculateRaise(mstruct.number().numerator(), eo); } else { setToChild(1); break; raise(mstruct.number().numerator()); } return 1; } } break; } } return -1; } int MathStructure::merge_logical_and(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this, size_t index_mstruct, bool) { if(equals(mstruct)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } if(mstruct.representsPositive()) { MERGE_APPROX_AND_PREC(mstruct) return 2; } if(mstruct.representsNonPositive()) { if(isZero()) return 2; clear(true); MERGE_APPROX_AND_PREC(mstruct) return 3; } if(representsPositive()) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } if(representsNonPositive()) { if(!isZero()) clear(true); MERGE_APPROX_AND_PREC(mstruct) return 2; } if(isLogicalOr()) { MERGE_APPROX_AND_PREC(mstruct) if(mstruct.isLogicalOr()) { for(size_t i = 0; i < SIZE; ) { MathStructure msave(CHILD(i)); for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(i2 > 0) { insertChild(msave, i + 1); } CHILD(i).calculateLogicalAnd(mstruct[i2], eo, this, i); i++; } } } else { for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculateLogicalAnd(mstruct, eo, this, i); } } calculatesub(eo, eo, false); return 1; } else if(mstruct.isLogicalOr()) { MathStructure mthis(*this); MERGE_APPROX_AND_PREC(mstruct) for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i].ref(); if(i == 0) { add_nocopy(&mstruct[i], OPERATION_LOGICAL_AND, true); calculateLogicalAndLast(eo, true); } else { add(mthis, OPERATION_LOGICAL_OR, true); LAST.add_nocopy(&mstruct[i], OPERATION_LOGICAL_AND, true); LAST.calculateLogicalAndLast(eo, true, this, SIZE - 1); } } calculatesub(eo, eo, false); return 1; } else if(isComparison() && mstruct.isComparison()) { if(CHILD(0) == mstruct[0]) { ComparisonResult cr = mstruct[1].compare(CHILD(1)); ComparisonType ct1 = ct_comp, ct2 = mstruct.comparisonType(); switch(cr) { case COMPARISON_RESULT_UNKNOWN: { return -1; } case COMPARISON_RESULT_NOT_EQUAL: { if(ct_comp == COMPARISON_EQUALS && ct2 == COMPARISON_EQUALS) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(ct_comp == COMPARISON_EQUALS && ct2 == COMPARISON_NOT_EQUALS) { MERGE_APPROX_AND_PREC(mstruct) return 2; } else if(ct_comp == COMPARISON_NOT_EQUALS && ct2 == COMPARISON_EQUALS) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } return -1; } case COMPARISON_RESULT_EQUAL: { MERGE_APPROX_AND_PREC(mstruct) if(ct_comp == ct2) return 1; if(ct_comp == COMPARISON_NOT_EQUALS) { if(ct2 == COMPARISON_LESS || ct2 == COMPARISON_EQUALS_LESS) { ct_comp = COMPARISON_LESS; if(ct2 == COMPARISON_LESS) return 3; return 1; } else if(ct2 == COMPARISON_GREATER || ct2 == COMPARISON_EQUALS_GREATER) { ct_comp = COMPARISON_GREATER; if(ct2 == COMPARISON_GREATER) return 3; return 1; } } else if(ct2 == COMPARISON_NOT_EQUALS) { if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { if(ct_comp == COMPARISON_LESS) return 2; ct_comp = COMPARISON_LESS; return 1; } else if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) { if(ct_comp == COMPARISON_GREATER) return 2; ct_comp = COMPARISON_GREATER; return 1; } } else if((ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER || ct_comp == COMPARISON_EQUALS) && (ct2 == COMPARISON_EQUALS_LESS || ct2 == COMPARISON_EQUALS_GREATER || ct2 == COMPARISON_EQUALS)) { if(ct_comp == COMPARISON_EQUALS) return 2; ct_comp = COMPARISON_EQUALS; if(ct2 == COMPARISON_EQUALS) return 3; return 1; } else if((ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) && (ct2 == COMPARISON_LESS || ct2 == COMPARISON_EQUALS_LESS)) { if(ct_comp == COMPARISON_LESS) return 2; ct_comp = COMPARISON_LESS; if(ct2 == COMPARISON_LESS) return 3; return 1; } else if((ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) && (ct2 == COMPARISON_GREATER || ct2 == COMPARISON_EQUALS_GREATER)) { if(ct_comp == COMPARISON_GREATER) return 2; ct_comp = COMPARISON_GREATER; if(ct2 == COMPARISON_GREATER) return 3; return 1; } clear(true); return 1; } case COMPARISON_RESULT_EQUAL_OR_GREATER: { switch(ct1) { case COMPARISON_GREATER: {ct1 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct1 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct1 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct1 = COMPARISON_EQUALS_GREATER; break;} default: {} } switch(ct2) { case COMPARISON_GREATER: {ct2 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct2 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct2 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct2 = COMPARISON_EQUALS_GREATER; break;} default: {} } } case COMPARISON_RESULT_EQUAL_OR_LESS: { switch(ct1) { case COMPARISON_LESS: { if(ct2 == COMPARISON_GREATER || ct2 == COMPARISON_EQUALS) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(ct2 == COMPARISON_LESS || ct2 == COMPARISON_EQUALS_LESS || ct2 == COMPARISON_NOT_EQUALS) { MERGE_APPROX_AND_PREC(mstruct) return 2; } break; } case COMPARISON_GREATER: { if(ct2 == COMPARISON_GREATER) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } break; } case COMPARISON_EQUALS_LESS: { if(ct2 == COMPARISON_EQUALS_LESS) { MERGE_APPROX_AND_PREC(mstruct) return 2; } break; } case COMPARISON_EQUALS_GREATER: { if(ct2 == COMPARISON_EQUALS_GREATER || ct2 == COMPARISON_EQUALS) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } break; } case COMPARISON_EQUALS: { if(ct2 == COMPARISON_GREATER) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } break; } case COMPARISON_NOT_EQUALS: { if(ct2 == COMPARISON_GREATER) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } break; } } break; } case COMPARISON_RESULT_GREATER: { switch(ct1) { case COMPARISON_GREATER: {ct1 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct1 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct1 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct1 = COMPARISON_EQUALS_GREATER; break;} default: {} } switch(ct2) { case COMPARISON_GREATER: {ct2 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct2 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct2 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct2 = COMPARISON_EQUALS_GREATER; break;} default: {} } } case COMPARISON_RESULT_LESS: { switch(ct1) { case COMPARISON_EQUALS: { switch(ct2) { case COMPARISON_EQUALS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: {MERGE_APPROX_AND_PREC(mstruct) clear(true); return 1;} case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: {MERGE_APPROX_AND_PREC(mstruct) return 2;} default: {} } break; } case COMPARISON_NOT_EQUALS: { switch(ct2) { case COMPARISON_EQUALS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } default: {} } break; } case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: { switch(ct2) { case COMPARISON_EQUALS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: {MERGE_APPROX_AND_PREC(mstruct) clear(true); return 1;} case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: {MERGE_APPROX_AND_PREC(mstruct) return 2;} } break; } case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: { switch(ct2) { case COMPARISON_EQUALS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } default: {} } break; } } break; } } } } else if(isLogicalAnd()) { if(mstruct.isLogicalAnd()) { for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false); } else { APPEND_REF(&mstruct); MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false); } return 1; } else if(mstruct.isLogicalAnd()) { transform(STRUCT_LOGICAL_AND); for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false); return 1; } return -1; } int MathStructure::merge_logical_or(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this, size_t index_mstruct, bool) { if(mstruct.representsPositive()) { if(isOne()) { MERGE_APPROX_AND_PREC(mstruct) return 2; } set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 3; } if(mstruct.representsNonPositive()) { if(representsNonPositive() && !isZero()) clear(true); MERGE_APPROX_AND_PREC(mstruct) return 2; } if(representsPositive()) { if(!isOne()) set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 2; } if(representsNonPositive()) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } if(equals(mstruct)) { return 2; } if(isLogicalAnd()) { if(mstruct.isLogicalAnd()) { if(SIZE < mstruct.size()) { bool b = true; for(size_t i = 0; i < SIZE; i++) { b = false; for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(CHILD(i) == mstruct[i2]) { b = true; break; } } if(!b) break; } if(b) { MERGE_APPROX_AND_PREC(mstruct) return 2; } } else if(SIZE > mstruct.size()) { bool b = true; for(size_t i = 0; i < mstruct.size(); i++) { b = false; for(size_t i2 = 0; i2 < SIZE; i2++) { if(mstruct[i] == CHILD(i2)) { b = true; break; } } if(!b) break; } if(b) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } } } else { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i) == mstruct) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } } } } else if(mstruct.isLogicalAnd()) { for(size_t i = 0; i < mstruct.size(); i++) { if(equals(mstruct[i])) { MERGE_APPROX_AND_PREC(mstruct) return 2; } } } if(isComparison() && mstruct.isComparison()) { if(CHILD(0) == mstruct[0]) { ComparisonResult cr = mstruct[1].compare(CHILD(1)); ComparisonType ct1 = ct_comp, ct2 = mstruct.comparisonType(); switch(cr) { case COMPARISON_RESULT_UNKNOWN: { return -1; } case COMPARISON_RESULT_NOT_EQUAL: { return -1; } case COMPARISON_RESULT_EQUAL: { if(ct_comp == ct2) return 1; switch(ct_comp) { case COMPARISON_EQUALS: { switch(ct2) { case COMPARISON_NOT_EQUALS: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_EQUALS_LESS: {} case COMPARISON_EQUALS_GREATER: {ct_comp = ct2; MERGE_APPROX_AND_PREC(mstruct) return 3;} case COMPARISON_LESS: {ct_comp = COMPARISON_EQUALS_LESS; MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_GREATER: {ct_comp = COMPARISON_EQUALS_GREATER; MERGE_APPROX_AND_PREC(mstruct) return 1;} default: {} } break; } case COMPARISON_NOT_EQUALS: { switch(ct2) { case COMPARISON_EQUALS_LESS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_EQUALS: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_LESS: {} case COMPARISON_GREATER: {MERGE_APPROX_AND_PREC(mstruct) return 2;} default: {} } break; } case COMPARISON_EQUALS_LESS: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_GREATER: {} case COMPARISON_EQUALS_GREATER: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_EQUALS: {} case COMPARISON_LESS: {MERGE_APPROX_AND_PREC(mstruct) return 2;} default: {} } break; } case COMPARISON_LESS: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_LESS: {ct_comp = ct2; MERGE_APPROX_AND_PREC(mstruct) return 3;} case COMPARISON_EQUALS_GREATER: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_EQUALS: {ct_comp = COMPARISON_EQUALS_LESS; MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_GREATER: {ct_comp = COMPARISON_NOT_EQUALS; MERGE_APPROX_AND_PREC(mstruct) return 1;} default: {} } break; } case COMPARISON_EQUALS_GREATER: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_LESS: {} case COMPARISON_EQUALS_LESS: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_EQUALS: {} case COMPARISON_GREATER: {MERGE_APPROX_AND_PREC(mstruct) return 2;} default: {} } break; } case COMPARISON_GREATER: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_GREATER: {ct_comp = ct2; MERGE_APPROX_AND_PREC(mstruct) return 3;} case COMPARISON_EQUALS_LESS: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_EQUALS: {ct_comp = COMPARISON_EQUALS_GREATER; MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_LESS: {ct_comp = COMPARISON_NOT_EQUALS; MERGE_APPROX_AND_PREC(mstruct) return 1;} default: {} } break; } } break; } case COMPARISON_RESULT_EQUAL_OR_GREATER: { switch(ct1) { case COMPARISON_GREATER: {ct1 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct1 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct1 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct1 = COMPARISON_EQUALS_GREATER; break;} default: {} } switch(ct2) { case COMPARISON_GREATER: {ct2 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct2 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct2 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct2 = COMPARISON_EQUALS_GREATER; break;} default: {} } } case COMPARISON_RESULT_EQUAL_OR_LESS: { switch(ct1) { case COMPARISON_LESS: { if(ct2 == COMPARISON_LESS || ct2 == COMPARISON_EQUALS_LESS || ct2 == COMPARISON_NOT_EQUALS) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } break; } case COMPARISON_GREATER: { if(ct2 == COMPARISON_GREATER) { MERGE_APPROX_AND_PREC(mstruct) return 2; } break; } case COMPARISON_EQUALS_LESS: { if(ct2 == COMPARISON_EQUALS_LESS) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } break; } case COMPARISON_EQUALS_GREATER: { if(ct2 == COMPARISON_EQUALS_GREATER || ct2 == COMPARISON_EQUALS) { MERGE_APPROX_AND_PREC(mstruct) return 2; } break; } case COMPARISON_NOT_EQUALS: { if(ct2 == COMPARISON_GREATER) { MERGE_APPROX_AND_PREC(mstruct) return 2; } break; } default: {} } break; } case COMPARISON_RESULT_GREATER: { switch(ct1) { case COMPARISON_GREATER: {ct1 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct1 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct1 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct1 = COMPARISON_EQUALS_GREATER; break;} default: {} } switch(ct2) { case COMPARISON_GREATER: {ct2 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct2 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct2 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct2 = COMPARISON_EQUALS_GREATER; break;} default: {} } } case COMPARISON_RESULT_LESS: { switch(ct1) { case COMPARISON_EQUALS: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } default: {} } break; } case COMPARISON_NOT_EQUALS: { switch(ct2) { case COMPARISON_EQUALS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: {MERGE_APPROX_AND_PREC(mstruct) return 2;} case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} default: {} } break; } case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } default: {} } break; } case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_EQUALS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: {MERGE_APPROX_AND_PREC(mstruct) return 2;} } break; } } break; } } } } else if(isLogicalOr()) { if(mstruct.isLogicalOr()) { for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false); } else { APPEND_REF(&mstruct); MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false); } return 1; } else if(mstruct.isLogicalOr()) { transform(STRUCT_LOGICAL_OR); for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false); return 1; } return -1; } int MathStructure::merge_logical_xor(MathStructure &mstruct, const EvaluationOptions&, MathStructure*, size_t, size_t, bool) { if(equals(mstruct)) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } bool bp1 = representsPositive(); bool bp2 = mstruct.representsPositive(); if(bp1 && bp2) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } bool bn1 = representsNonPositive(); bool bn2 = mstruct.representsNonPositive(); if(bn1 && bn2) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } if((bn1 && bp2) || (bp1 && bn2)) { set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1; } return -1; } int MathStructure::merge_bitwise_and(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure*, size_t, size_t, bool) { if(mstruct.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.bitAnd(mstruct.number()) && (eo.approximation == APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.isInfinite() || o_number.isInfinite() || mstruct.number().isInfinite())) { if(o_number == nr) { o_number = nr; numberUpdated(); return 2; } o_number = nr; numberUpdated(); return 1; } return -1; } switch(m_type) { case STRUCT_VECTOR: { switch(mstruct.type()) { case STRUCT_VECTOR: { if(SIZE < mstruct.size()) return 0; for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i].ref(); CHILD(i).add_nocopy(&mstruct[i], OPERATION_LOGICAL_AND); CHILD(i).calculatesub(eo, eo, false); } MERGE_APPROX_AND_PREC(mstruct) return 1; } default: { return -1; } } return -1; } case STRUCT_BITWISE_AND: { switch(mstruct.type()) { case STRUCT_VECTOR: { return -1; } case STRUCT_BITWISE_AND: { for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } calculatesub(eo, eo, false); MERGE_APPROX_AND_PREC(mstruct) return 1; } default: { APPEND_REF(&mstruct); calculatesub(eo, eo, false); MERGE_APPROX_AND_PREC(mstruct) return 1; } } break; } default: { switch(mstruct.type()) { case STRUCT_BITWISE_AND: { return 0; } default: {} } } } return -1; } int MathStructure::merge_bitwise_or(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure*, size_t, size_t, bool) { if(mstruct.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.bitOr(mstruct.number()) && (eo.approximation == APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.isInfinite() || o_number.isInfinite() || mstruct.number().isInfinite())) { if(o_number == nr) { o_number = nr; numberUpdated(); return 2; } o_number = nr; numberUpdated(); return 1; } return -1; } switch(m_type) { case STRUCT_VECTOR: { switch(mstruct.type()) { case STRUCT_VECTOR: { if(SIZE < mstruct.size()) return 0; for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i].ref(); CHILD(i).add_nocopy(&mstruct[i], OPERATION_LOGICAL_OR); CHILD(i).calculatesub(eo, eo, false); } MERGE_APPROX_AND_PREC(mstruct) return 1; } default: { return -1; } } return -1; } case STRUCT_BITWISE_OR: { switch(mstruct.type()) { case STRUCT_VECTOR: { return -1; } case STRUCT_BITWISE_OR: { for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } calculatesub(eo, eo, false); MERGE_APPROX_AND_PREC(mstruct) return 1; } default: { APPEND_REF(&mstruct); calculatesub(eo, eo, false); MERGE_APPROX_AND_PREC(mstruct) return 1; } } break; } default: { switch(mstruct.type()) { case STRUCT_BITWISE_OR: { return 0; } default: {} } } } return -1; } int MathStructure::merge_bitwise_xor(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure*, size_t, size_t, bool) { if(mstruct.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.bitXor(mstruct.number()) && (eo.approximation == APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.isInfinite() || o_number.isInfinite() || mstruct.number().isInfinite())) { if(o_number == nr) { o_number = nr; numberUpdated(); return 2; } o_number = nr; numberUpdated(); return 1; } return -1; } switch(m_type) { case STRUCT_VECTOR: { switch(mstruct.type()) { case STRUCT_VECTOR: { if(SIZE < mstruct.size()) return 0; for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i].ref(); CHILD(i).add_nocopy(&mstruct[i], OPERATION_LOGICAL_XOR); CHILD(i).calculatesub(eo, eo, false); } MERGE_APPROX_AND_PREC(mstruct) return 1; } default: { return -1; } } return -1; } default: {} } return -1; } #define MERGE_RECURSE if(recursive) {\ for(size_t i = 0; i < SIZE; i++) {\ CHILD(i).calculatesub(eo, feo, true, this, i);\ }\ CHILDREN_UPDATED;\ } #define MERGE_ALL(FUNC, TRY_LABEL) size_t i2, i3 = SIZE;\ for(size_t i = 0; i < SIZE - 1; i++) {\ i2 = i + 1;\ TRY_LABEL:\ for(; i2 < i; i2++) {\ int r = CHILD(i2).FUNC(CHILD(i), eo, this, i2, i);\ if(r == 0) {\ SWAP_CHILDREN(i2, i);\ r = CHILD(i2).FUNC(CHILD(i), eo, this, i2, i, true);\ if(r < 1) {\ SWAP_CHILDREN(i2, i);\ }\ }\ if(r >= 1) {\ ERASE(i);\ b = true;\ i3 = i;\ i = i2;\ i2 = 0;\ goto TRY_LABEL;\ }\ }\ for(i2 = i + 1; i2 < SIZE; i2++) {\ int r = CHILD(i).FUNC(CHILD(i2), eo, this, i, i2);\ if(r == 0) {\ SWAP_CHILDREN(i, i2);\ r = CHILD(i).FUNC(CHILD(i2), eo, this, i, i2, true);\ if(r < 1) {\ SWAP_CHILDREN(i, i2);\ } else if(r == 2) {\ r = 3;\ } else if(r == 3) {\ r = 2;\ }\ }\ if(r >= 1) {\ ERASE(i2);\ b = true;\ if(r != 2) {\ i2 = 0;\ goto TRY_LABEL;\ }\ i2--;\ }\ }\ if(i3 < SIZE) {\ if(i3 == SIZE - 1) break;\ i = i3;\ i3 = SIZE;\ i2 = i + 1;\ goto TRY_LABEL;\ }\ } #define MERGE_ALL2 if(SIZE == 1) {\ setToChild(1, false, mparent, index_this + 1);\ } else if(SIZE == 0) {\ clear(true);\ } else {\ evalSort();\ } bool MathStructure::calculatesub(const EvaluationOptions &eo, const EvaluationOptions &feo, bool recursive, MathStructure *mparent, size_t index_this) { if(b_protected) return false; bool b = false; switch(m_type) { case STRUCT_VARIABLE: { if(eo.calculate_variables && o_variable->isKnown()) { if(eo.approximation == APPROXIMATION_APPROXIMATE || !o_variable->isApproximate()) { set(((KnownVariable*) o_variable)->get()); if(eo.calculate_functions) { calculateFunctions(feo); unformat(feo); } b = true; calculatesub(eo, feo, true, mparent, index_this); } } break; } case STRUCT_POWER: { if(recursive) { CHILD(0).calculatesub(eo, feo, true, this, 0); CHILD(1).calculatesub(eo, feo, true, this, 1); CHILDREN_UPDATED; } if(CHILD(0).merge_power(CHILD(1), eo) >= 1) { b = true; setToChild(1, false, mparent, index_this + 1); } break; } case STRUCT_ADDITION: { MERGE_RECURSE MERGE_ALL(merge_addition, try_add) MERGE_ALL2 break; } case STRUCT_MULTIPLICATION: { MERGE_RECURSE if(representsNonMatrix()) { MERGE_ALL(merge_multiplication, try_multiply) } else { size_t i2, i3 = SIZE; for(size_t i = 0; i < SIZE - 1; i++) { i2 = i + 1; try_multiply_matrix: bool b_matrix = !CHILD(i).representsNonMatrix(); if(i2 < i) { for(; ; i2--) { int r = CHILD(i2).merge_multiplication(CHILD(i), eo, this, i2, i); if(r == 0) { SWAP_CHILDREN(i2, i); r = CHILD(i2).merge_multiplication(CHILD(i), eo, this, i2, i, true); if(r < 1) { SWAP_CHILDREN(i2, i); } } if(r >= 1) { ERASE(i); b = true; i3 = i; i = i2; i2 = 0; goto try_multiply_matrix; } if(i2 == 0) break; if(b_matrix && !CHILD(i2).representsNonMatrix()) break; } } bool had_matrix = false; for(i2 = i + 1; i2 < SIZE; i2++) { if(had_matrix && !CHILD(i2).representsNonMatrix()) continue; int r = CHILD(i).merge_multiplication(CHILD(i2), eo, this, i, i2); if(r == 0) { SWAP_CHILDREN(i, i2); r = CHILD(i).merge_multiplication(CHILD(i2), eo, this, i, i2, true); if(r < 1) { SWAP_CHILDREN(i, i2); } else if(r == 2) { r = 3; } else if(r == 3) { r = 2; } } if(r >= 1) { ERASE(i2); b = true; if(r != 2) { i2 = 0; goto try_multiply_matrix; } i2--; } if(i == SIZE - 1) break; if(b_matrix && !CHILD(i2).representsNonMatrix()) had_matrix = true; } if(i3 < SIZE) { if(i3 == SIZE - 1) break; i = i3; i3 = SIZE; i2 = i + 1; goto try_multiply_matrix; } } } MERGE_ALL2 break; } case STRUCT_BITWISE_AND: { MERGE_RECURSE MERGE_ALL(merge_bitwise_and, try_bitand) MERGE_ALL2 break; } case STRUCT_BITWISE_OR: { MERGE_RECURSE MERGE_ALL(merge_bitwise_or, try_bitor) MERGE_ALL2 break; } case STRUCT_BITWISE_XOR: { MERGE_RECURSE MERGE_ALL(merge_bitwise_xor, try_bitxor) MERGE_ALL2 break; } case STRUCT_BITWISE_NOT: { if(recursive) { CHILD(0).calculatesub(eo, feo, true, this, 0); CHILDREN_UPDATED; } switch(CHILD(0).type()) { case STRUCT_NUMBER: { Number nr(CHILD(0).number()); if(nr.bitNot() && (eo.approximation == APPROXIMATION_APPROXIMATE || !nr.isApproximate() || CHILD(0).number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || CHILD(0).number().isComplex()) && (eo.allow_infinite || !nr.isInfinite() || CHILD(0).number().isInfinite())) { set(nr, true); } break; } case STRUCT_VECTOR: { SET_CHILD_MAP(0); for(size_t i = 0; i < SIZE; i++) { CHILD(i).setLogicalNot(); } break; } case STRUCT_BITWISE_NOT: { setToChild(1); setToChild(1); break; } default: {} } break; } case STRUCT_LOGICAL_AND: { if(recursive) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculatesub(eo, feo, true, this, i); CHILD_UPDATED(i) if(CHILD(i).representsNonPositive()) { clear(true); b = true; break; } } if(b) break; } MERGE_ALL(merge_logical_and, try_logand) if(SIZE == 1) { if(CHILD(0).representsBoolean() || (mparent && !mparent->isMultiplication() && mparent->representsBoolean())) { setToChild(1, false, mparent, index_this + 1); } else if(CHILD(0).representsPositive()) { set(1, 1, 0, true); } else if(CHILD(0).representsNonPositive()) { clear(true); } else { APPEND(m_zero); m_type = STRUCT_COMPARISON; ct_comp = COMPARISON_GREATER; } } else if(SIZE == 0) { clear(true); } else { evalSort(); } break; } case STRUCT_LOGICAL_OR: { if(recursive) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculatesub(eo, feo, true, this, i); CHILD_UPDATED(i) if(CHILD(i).representsPositive()) { set(1, 1, 0, true); b = true; break; } } if(b) break; } MERGE_ALL(merge_logical_or, try_logor) if(SIZE == 1) { if(CHILD(0).representsBoolean() || (mparent && !mparent->isMultiplication() && mparent->representsBoolean())) { setToChild(1, false, mparent, index_this + 1); } else if(CHILD(0).representsPositive()) { set(1, 1, 0, true); } else if(CHILD(0).representsNonPositive()) { clear(true); } else { APPEND(m_zero); m_type = STRUCT_COMPARISON; ct_comp = COMPARISON_GREATER; } } else if(SIZE == 0) { clear(true); } else { evalSort(); } break; } case STRUCT_LOGICAL_XOR: { if(recursive) { CHILD(0).calculatesub(eo, feo, true, this, 0); CHILD(1).calculatesub(eo, feo, true, this, 1); CHILDREN_UPDATED; } if(CHILD(0).merge_logical_xor(CHILD(1), eo) >= 1) { b = true; setToChild(1, false, mparent, index_this + 1); } break; } case STRUCT_LOGICAL_NOT: { if(recursive) { CHILD(0).calculatesub(eo, feo, true, this, 0); CHILDREN_UPDATED; } if(CHILD(0).representsPositive()) { clear(true); b = true; } else if(CHILD(0).representsNonPositive()) { set(1, 1, 0, true); b = true; } else if(CHILD(0).isLogicalNot()) { setToChild(1); setToChild(1); if(!representsBoolean() || (mparent && !mparent->isMultiplication() && mparent->representsBoolean())) { add(m_zero, OPERATION_GREATER); calculatesub(eo, feo, false); } b = true; } break; } case STRUCT_COMPARISON: { EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = false; if(recursive) { CHILD(0).calculatesub(eo2, feo, true, this, 0); CHILD(1).calculatesub(eo2, feo, true, this, 1); CHILDREN_UPDATED; } if(CHILD(0).isNumber() && CHILD(1).isNumber()) { ComparisonResult cr = CHILD(1).number().compareApproximately(CHILD(0).number()); if(cr == COMPARISON_RESULT_UNKNOWN) { break; } switch(ct_comp) { case COMPARISON_EQUALS: { if(cr == COMPARISON_RESULT_EQUAL) { set(1, 1, 0, true); b = true; } else if(COMPARISON_IS_NOT_EQUAL(cr)) { clear(true); b = true; } break; } case COMPARISON_NOT_EQUALS: { if(cr == COMPARISON_RESULT_EQUAL) { clear(true); b = true; } else if(COMPARISON_IS_NOT_EQUAL(cr)) { set(1, 1, 0, true); b = true; } break; } case COMPARISON_LESS: { if(cr == COMPARISON_RESULT_LESS) { set(1, 1, 0, true); b = true; } else if(cr != COMPARISON_RESULT_EQUAL_OR_LESS && cr != COMPARISON_RESULT_NOT_EQUAL) { clear(true); b = true; } break; } case COMPARISON_EQUALS_LESS: { if(COMPARISON_IS_EQUAL_OR_LESS(cr)) { set(1, 1, 0, true); b = true; } else if(cr != COMPARISON_RESULT_EQUAL_OR_GREATER && cr != COMPARISON_RESULT_NOT_EQUAL) { clear(true); b = true; } break; } case COMPARISON_GREATER: { if(cr == COMPARISON_RESULT_GREATER) { set(1, 1, 0, true); b = true; } else if(cr != COMPARISON_RESULT_EQUAL_OR_GREATER && cr != COMPARISON_RESULT_NOT_EQUAL) { clear(true); b = true; } break; } case COMPARISON_EQUALS_GREATER: { if(COMPARISON_IS_EQUAL_OR_GREATER(cr)) { set(1, 1, 0, true); b = true; } else if(cr != COMPARISON_RESULT_EQUAL_OR_LESS && cr != COMPARISON_RESULT_NOT_EQUAL) { clear(true); b = true; } break; } } break; } if(!eo.test_comparisons) { break; } if((CHILD(0).representsUndefined() && !CHILD(1).representsUndefined(true, true, true)) || (CHILD(1).representsUndefined() && !CHILD(0).representsUndefined(true, true, true))) { if(ct_comp == COMPARISON_EQUALS) { clear(true); b = true; break; } else if(ct_comp == COMPARISON_NOT_EQUALS) { set(1, 1, 0, true); b = true; break; } } if((ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_GREATER) && CHILD(1).isZero()) { if(CHILD(0).isLogicalNot() || CHILD(0).isLogicalAnd() || CHILD(0).isLogicalOr() || CHILD(0).isLogicalXor() || CHILD(0).isComparison()) { if(ct_comp == COMPARISON_EQUALS_LESS) { ERASE(1); m_type = STRUCT_LOGICAL_NOT; calculatesub(eo, feo, false, mparent, index_this); } else { setToChild(1, false, mparent, index_this + 1); } b = true; } } else if((ct_comp == COMPARISON_EQUALS_GREATER || ct_comp == COMPARISON_LESS) && CHILD(0).isZero()) { if(CHILD(0).isLogicalNot() || CHILD(1).isLogicalAnd() || CHILD(1).isLogicalOr() || CHILD(1).isLogicalXor() || CHILD(1).isComparison()) { if(ct_comp == COMPARISON_EQUALS_GREATER) { ERASE(0); m_type = STRUCT_LOGICAL_NOT; calculatesub(eo, feo, false, mparent, index_this); } else { setToChild(2, false, mparent, index_this + 1); } b = true; } } if(ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) { if((CHILD(0).representsReal(false) && CHILD(1).representsComplex(false)) || (CHILD(1).representsReal(false) && CHILD(0).representsComplex(false))) { if(ct_comp == COMPARISON_EQUALS) { clear(true); } else { set(1, 1, 0, true); } b = true; } } if(b) break; MathStructure *mtest; if(!CHILD(1).isZero()) { if(!eo.isolate_x || find_x_var().isUndefined()) { CHILD(0).calculateSubtract(CHILD(1), eo2); CHILD(1).clear(); mtest = &CHILD(0); mtest->ref(); } else { mtest = new MathStructure(CHILD(0)); mtest->calculateSubtract(CHILD(1), eo2); } } else { mtest = &CHILD(0); mtest->ref(); } bool incomp = false; if(mtest->isAddition()) { for(size_t i = 1; i < mtest->size(); i++) { if((*mtest)[i - 1].isUnitCompatible((*mtest)[i]) == 0) { incomp = true; break; } } } switch(ct_comp) { case COMPARISON_EQUALS: { if(incomp) { clear(true); b = true; } else if(mtest->representsZero(true)) { set(1, 1, 0, true); b = true; } else if(mtest->representsNonZero(true)) { clear(true); b = true; } break; } case COMPARISON_NOT_EQUALS: { if(incomp) { set(1, 1, 0, true); b = true; } else if(mtest->representsNonZero(true)) { set(1, 1, 0, true); b = true; } else if(mtest->representsZero(true)) { clear(true); b = true; } break; } case COMPARISON_LESS: { if(incomp) { } else if(mtest->representsNegative(true)) { set(1, 1, 0, true); b = true; } else if(mtest->representsNonNegative(true)) { clear(true); b = true; } break; } case COMPARISON_GREATER: { if(incomp) { } else if(mtest->representsPositive(true)) { set(1, 1, 0, true); b = true; } else if(mtest->representsNonPositive(true)) { clear(true); b = true; } break; } case COMPARISON_EQUALS_LESS: { if(incomp) { } else if(mtest->representsNonPositive(true)) { set(1, 1, 0, true); b = true; } else if(mtest->representsPositive(true)) { clear(true); b = true; } break; } case COMPARISON_EQUALS_GREATER: { if(incomp) { } else if(mtest->representsNonNegative(true)) { set(1, 1, 0, true); b = true; } else if(mtest->representsNegative(true)) { clear(true); b = true; } break; } } mtest->unref(); break; } case STRUCT_FUNCTION: { if(o_function == CALCULATOR->f_abs) { b = calculateFunctions(eo, false); unformat(eo); if(b) calculatesub(eo, feo, true, mparent, index_this); break; } } default: { if(recursive) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).calculatesub(eo, feo, true, this, i)) b = true; } CHILDREN_UPDATED; } } } return b; } #define MERGE_INDEX(FUNC, TRY_LABEL) bool b = false;\ TRY_LABEL:\ for(size_t i = 0; i < index; i++) {\ int r = CHILD(i).FUNC(CHILD(index), eo, this, i, index);\ if(r == 0) {\ SWAP_CHILDREN(i, index);\ r = CHILD(i).FUNC(CHILD(index), eo, this, i, index, true);\ if(r < 1) {\ SWAP_CHILDREN(i, index);\ } else if(r == 2) {\ r = 3;\ } else if(r == 3) {\ r = 2;\ }\ }\ if(r >= 1) {\ ERASE(index);\ if(!b && r == 2) {\ b = true;\ index = SIZE;\ break;\ } else {\ b = true;\ index = i;\ goto TRY_LABEL;\ }\ }\ }\ for(size_t i = index + 1; i < SIZE; i++) {\ int r = CHILD(index).FUNC(CHILD(i), eo, this, index, i);\ if(r == 0) {\ SWAP_CHILDREN(index, i);\ r = CHILD(index).FUNC(CHILD(i), eo, this, index, i, true);\ if(r < 1) {\ SWAP_CHILDREN(index, i);\ } else if(r == 2) {\ r = 3;\ } else if(r == 3) {\ r = 2;\ }\ }\ if(r >= 1) {\ ERASE(i);\ if(!b && r == 3) {\ b = true;\ break;\ }\ b = true;\ if(r != 2) {\ goto TRY_LABEL;\ }\ i--;\ }\ } #define MERGE_INDEX2 if(b && check_size) {\ if(SIZE == 1) {\ setToChild(1, false, mparent, index_this + 1);\ } else if(SIZE == 0) {\ clear(true);\ } else {\ evalSort();\ }\ return true;\ } else {\ evalSort();\ return b;\ } bool MathStructure::calculateMergeIndex(size_t index, const EvaluationOptions &eo, const EvaluationOptions &feo, MathStructure *mparent, size_t index_this) { switch(m_type) { case STRUCT_MULTIPLICATION: { return calculateMultiplyIndex(index, eo, true, mparent, index_this); } case STRUCT_ADDITION: { return calculateAddIndex(index, eo, true, mparent, index_this); } case STRUCT_POWER: { return calculateRaiseExponent(eo, mparent, index_this); } case STRUCT_LOGICAL_AND: { return calculateLogicalAndIndex(index, eo, true, mparent, index_this); } case STRUCT_LOGICAL_OR: { return calculateLogicalOrIndex(index, eo, true, mparent, index_this); } case STRUCT_LOGICAL_XOR: { return calculateLogicalXorLast(eo, mparent, index_this); } case STRUCT_BITWISE_AND: { return calculateBitwiseAndIndex(index, eo, true, mparent, index_this); } case STRUCT_BITWISE_OR: { return calculateBitwiseOrIndex(index, eo, true, mparent, index_this); } case STRUCT_BITWISE_XOR: { return calculateBitwiseXorIndex(index, eo, true, mparent, index_this); } default: {} } return calculatesub(eo, feo, false, mparent, index_this); } bool MathStructure::calculateLogicalOrLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateLogicalOrIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateLogicalOrIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isLogicalOr()) { CALCULATOR->error(true, "calculateLogicalOrIndex() error: %s. %s", print().c_str(), _("This is a bug. Please report it."), NULL); return false; } MERGE_INDEX(merge_logical_or, try_logical_or_index) if(b && check_size) { if(SIZE == 1) { if(CHILD(0).representsBoolean() || (mparent && !mparent->isMultiplication() && mparent->representsBoolean())) { setToChild(1, false, mparent, index_this + 1); } else if(CHILD(0).representsPositive()) { clear(true); o_number.setTrue(); } else if(CHILD(0).representsNonPositive()) { clear(true); o_number.setFalse(); } else { APPEND(m_zero); m_type = STRUCT_COMPARISON; ct_comp = COMPARISON_GREATER; } } else if(SIZE == 0) { clear(true); } else { evalSort(); } return true; } else { evalSort(); return false; } } bool MathStructure::calculateLogicalOr(const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { add(mor, OPERATION_LOGICAL_OR, true); LAST.evalSort(); return calculateLogicalOrIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateLogicalXorLast(const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { if(!isLogicalXor()) { CALCULATOR->error(true, "calculateLogicalXorLast() error: %s. %s", print().c_str(), _("This is a bug. Please report it."), NULL); return false; } if(CHILD(0).merge_logical_xor(CHILD(1), eo, this, 0, 1) >= 1) { if(CHILD(0).representsBoolean() || (mparent && !mparent->isMultiplication() && mparent->representsBoolean())) { setToChild(1, false, mparent, index_this + 1); } else if(CHILD(0).representsPositive()) { clear(true); o_number.setTrue(); } else if(CHILD(0).representsNonPositive()) { clear(true); o_number.setFalse(); } else { APPEND(m_zero); m_type = STRUCT_COMPARISON; ct_comp = COMPARISON_GREATER; } return true; } return false; } bool MathStructure::calculateLogicalXor(const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { add(mxor, OPERATION_LOGICAL_XOR); LAST.evalSort(); return calculateLogicalXorLast(eo, mparent, index_this); } bool MathStructure::calculateLogicalAndLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateLogicalAndIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateLogicalAndIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isLogicalAnd()) { CALCULATOR->error(true, "calculateLogicalAndIndex() error: %s. %s", print().c_str(), _("This is a bug. Please report it."), NULL); return false; } MERGE_INDEX(merge_logical_and, try_logical_and_index) if(b && check_size) { if(SIZE == 1) { if(CHILD(0).representsBoolean() || (mparent && !mparent->isMultiplication() && mparent->representsBoolean())) { setToChild(1, false, mparent, index_this + 1); } else if(CHILD(0).representsPositive()) { clear(true); o_number.setTrue(); } else if(CHILD(0).representsNonPositive()) { clear(true); o_number.setFalse(); } else { APPEND(m_zero); m_type = STRUCT_COMPARISON; ct_comp = COMPARISON_GREATER; } } else if(SIZE == 0) { clear(true); } else { evalSort(); } return true; } else { evalSort(); return false; } } bool MathStructure::calculateLogicalAnd(const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { add(mand, OPERATION_LOGICAL_AND, true); LAST.evalSort(); return calculateLogicalAndIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateInverse(const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { return calculateRaise(m_minus_one, eo, mparent, index_this); } bool MathStructure::calculateNegate(const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { if(!isMultiplication()) transform(STRUCT_MULTIPLICATION); PREPEND(m_minus_one); return calculateMultiplyIndex(0, eo, true, mparent, index_this); } bool MathStructure::calculateBitwiseNot(const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { transform(STRUCT_LOGICAL_NOT); return calculatesub(eo, eo, false, mparent, index_this); } bool MathStructure::calculateLogicalNot(const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { transform(STRUCT_BITWISE_NOT); return calculatesub(eo, eo, false, mparent, index_this); } bool MathStructure::calculateRaiseExponent(const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { if(!isPower()) { CALCULATOR->error(true, "calculateRaiseExponent() error: %s. %s", print().c_str(), _("This is a bug. Please report it."), NULL); return false; } if(CHILD(0).merge_power(CHILD(1), eo, this, 0, 1) >= 1) { setToChild(1, false, mparent, index_this + 1); return true; } return false; } bool MathStructure::calculateRaise(const MathStructure &mexp, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { raise(mexp); LAST.evalSort(); return calculateRaiseExponent(eo, mparent, index_this); } bool MathStructure::calculateBitwiseAndLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateBitwiseAndIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateBitwiseAndIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isBitwiseAnd()) { CALCULATOR->error(true, "calculateBitwiseAndIndex() error: %s. %s", print().c_str(), _("This is a bug. Please report it."), NULL); return false; } MERGE_INDEX(merge_bitwise_and, try_bitwise_and_index) MERGE_INDEX2 } bool MathStructure::calculateBitwiseAnd(const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { add(mand, OPERATION_BITWISE_AND, true); LAST.evalSort(); return calculateBitwiseAndIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateBitwiseOrLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateBitwiseOrIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateBitwiseOrIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isBitwiseOr()) { CALCULATOR->error(true, "calculateBitwiseOrIndex() error: %s. %s", print().c_str(), _("This is a bug. Please report it."), NULL); return false; } MERGE_INDEX(merge_bitwise_or, try_bitwise_or_index) MERGE_INDEX2 } bool MathStructure::calculateBitwiseOr(const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { add(mor, OPERATION_BITWISE_OR, true); LAST.evalSort(); return calculateBitwiseOrIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateBitwiseXorLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateBitwiseXorIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateBitwiseXorIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isBitwiseXor()) { CALCULATOR->error(true, "calculateBitwiseXorIndex() error: %s. %s", print().c_str(), _("This is a bug. Please report it."), NULL); return false; } MERGE_INDEX(merge_bitwise_xor, try_bitwise_xor_index) MERGE_INDEX2 } bool MathStructure::calculateBitwiseXor(const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { add(mxor, OPERATION_BITWISE_XOR, true); LAST.evalSort(); return calculateBitwiseXorIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateMultiplyLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateMultiplyIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateMultiplyIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isMultiplication()) { CALCULATOR->error(true, "calculateMultiplyIndex() error: %s. %s", print().c_str(), _("This is a bug. Please report it."), NULL); return false; } bool b = false; try_multiply_matrix_index: bool b_matrix = !CHILD(index).representsNonMatrix(); if(index > 0) { for(size_t i = index - 1; ; i--) { int r = CHILD(i).merge_multiplication(CHILD(index), eo, this, i, index); if(r == 0) { SWAP_CHILDREN(i, index); r = CHILD(i).merge_multiplication(CHILD(index), eo, this, i, index, true); if(r < 1) { SWAP_CHILDREN(i, index); } else if(r == 2) { r = 3; } else if(r == 3) { r = 2; } } if(r >= 1) { ERASE(index); if(!b && r == 2) { b = true; index = SIZE; break; } else { b = true; index = i; goto try_multiply_matrix_index; } } if(i == 0) break; if(b_matrix && !CHILD(i).representsNonMatrix()) break; } } bool had_matrix = false; for(size_t i = index + 1; i < SIZE; i++) { if(had_matrix && !CHILD(i).representsNonMatrix()) continue; int r = CHILD(index).merge_multiplication(CHILD(i), eo, this, index, i); if(r == 0) { SWAP_CHILDREN(index, i); r = CHILD(index).merge_multiplication(CHILD(i), eo, this, index, i, true); if(r < 1) { SWAP_CHILDREN(index, i); } else if(r == 2) { r = 3; } else if(r == 3) { r = 2; } } if(r >= 1) { ERASE(i); if(!b && r == 3) { b = true; break; } b = true; if(r != 2) { goto try_multiply_matrix_index; } i--; } if(i == SIZE - 1) break; if(b_matrix && !CHILD(i).representsNonMatrix()) had_matrix = true; } MERGE_INDEX2 } bool MathStructure::calculateMultiply(const MathStructure &mmul, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { multiply(mmul, true); LAST.evalSort(); return calculateMultiplyIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateDivide(const MathStructure &mdiv, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { MathStructure *mmul = new MathStructure(mdiv); mmul->evalSort(); multiply_nocopy(mmul, true); LAST.calculateInverse(eo, this, SIZE - 1); return calculateMultiplyIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateAddLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateAddIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateAddIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isAddition()) { CALCULATOR->error(true, "calculateAddIndex() error: %s. %s", print().c_str(), _("This is a bug. Please report it."), NULL); return false; } MERGE_INDEX(merge_addition, try_add_index) MERGE_INDEX2 } bool MathStructure::calculateAdd(const MathStructure &madd, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { add(madd, true); LAST.evalSort(); return calculateAddIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateSubtract(const MathStructure &msub, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { MathStructure *madd = new MathStructure(msub); madd->evalSort(); add_nocopy(madd, true); LAST.calculateNegate(eo, this, SIZE - 1); return calculateAddIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateFunctions(const EvaluationOptions &eo, bool recursive) { if(m_type == STRUCT_FUNCTION) { if(function_value) { function_value->unref(); function_value = NULL; } if(!o_function->testArgumentCount(SIZE)) { return false; } if(o_function->maxargs() > -1 && (int) SIZE > o_function->maxargs()) { REDUCE(o_function->maxargs()); } m_type = STRUCT_VECTOR; Argument *arg = NULL, *last_arg = NULL; int last_i = 0; for(size_t i = 0; i < SIZE; i++) { arg = o_function->getArgumentDefinition(i + 1); if(arg) { last_arg = arg; last_i = i; if(!arg->test(CHILD(i), i + 1, o_function, eo)) { m_type = STRUCT_FUNCTION; CHILD_UPDATED(i); return false; } else { CHILD_UPDATED(i); } } } if(last_arg && o_function->maxargs() < 0 && last_i >= o_function->minargs()) { for(size_t i = last_i + 1; i < SIZE; i++) { if(!last_arg->test(CHILD(i), i + 1, o_function, eo)) { m_type = STRUCT_FUNCTION; CHILD_UPDATED(i); return false; } else { CHILD_UPDATED(i); } } } if(!o_function->testCondition(*this)) { m_type = STRUCT_FUNCTION; return false; } MathStructure *mstruct = new MathStructure(); int i = o_function->calculate(*mstruct, *this, eo); if(i > 0) { set_nocopy(*mstruct, true); if(recursive) calculateFunctions(eo); mstruct->unref(); return true; } else { if(i < 0) { i = -i; if(o_function->maxargs() > 0 && i > o_function->maxargs()) { if(mstruct->isVector()) { for(size_t arg_i = 1; arg_i <= SIZE && arg_i <= mstruct->size(); arg_i++) { mstruct->getChild(arg_i)->ref(); setChild_nocopy(mstruct->getChild(arg_i), arg_i); } } } else if(i <= (int) SIZE) { mstruct->ref(); setChild_nocopy(mstruct, i); } } /*if(eo.approximation == APPROXIMATION_EXACT) { mstruct->clear(); EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->beginTemporaryStopMessages(); if(o_function->calculate(*mstruct, *this, eo2) > 0) { function_value = mstruct; function_value->ref(); function_value->calculateFunctions(eo2); } if(CALCULATOR->endTemporaryStopMessages() > 0 && function_value) { function_value->unref(); function_value = NULL; } }*/ m_type = STRUCT_FUNCTION; mstruct->unref(); return false; } } bool b = false; if(recursive) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).calculateFunctions(eo)) { CHILD_UPDATED(i); b = true; } } } return b; } int evalSortCompare(const MathStructure &mstruct1, const MathStructure &mstruct2, const MathStructure &parent); int evalSortCompare(const MathStructure &mstruct1, const MathStructure &mstruct2, const MathStructure &parent) { if(parent.isMultiplication()) { if(!mstruct1.representsNonMatrix() && !mstruct2.representsNonMatrix()) { return 0; } } if(parent.isAddition()) { if(mstruct1.isMultiplication() && mstruct1.size() > 0) { size_t start = 0; while(mstruct1[start].isNumber() && mstruct1.size() > start + 1) { start++; } int i2; if(mstruct2.isMultiplication()) { if(mstruct2.size() < 1) return -1; size_t start2 = 0; while(mstruct2[start2].isNumber() && mstruct2.size() > start2 + 1) { start2++; } for(size_t i = 0; i + start < mstruct1.size(); i++) { if(i + start2 >= mstruct2.size()) return 1; i2 = evalSortCompare(mstruct1[i + start], mstruct2[i + start2], parent); if(i2 != 0) return i2; } if(mstruct1.size() - start == mstruct2.size() - start2) return 0; return -1; } else { i2 = evalSortCompare(mstruct1[start], mstruct2, parent); if(i2 != 0) return i2; } } else if(mstruct2.isMultiplication() && mstruct2.size() > 0) { size_t start = 0; while(mstruct2[start].isNumber() && mstruct2.size() > start + 1) { start++; } int i2; if(mstruct1.isMultiplication()) { return 1; } else { i2 = evalSortCompare(mstruct1, mstruct2[start], parent); if(i2 != 0) return i2; } } } if(mstruct1.type() != mstruct2.type()) { if(!parent.isMultiplication()) { if(mstruct2.isNumber()) return -1; if(mstruct1.isNumber()) return 1; } if(!parent.isMultiplication() || (!mstruct1.isNumber() && !mstruct2.isNumber())) { if(mstruct2.isPower()) { int i = evalSortCompare(mstruct1, mstruct2[0], parent); if(i == 0) { return evalSortCompare(m_one, mstruct2[1], parent); } return i; } if(mstruct1.isPower()) { int i = evalSortCompare(mstruct1[0], mstruct2, parent); if(i == 0) { return evalSortCompare(mstruct1[1], m_one, parent); } return i; } } if(mstruct2.isInverse()) return -1; if(mstruct1.isInverse()) return 1; if(mstruct2.isDivision()) return -1; if(mstruct1.isDivision()) return 1; if(mstruct2.isNegate()) return -1; if(mstruct1.isNegate()) return 1; if(mstruct2.isLogicalAnd()) return -1; if(mstruct1.isLogicalAnd()) return 1; if(mstruct2.isLogicalOr()) return -1; if(mstruct1.isLogicalOr()) return 1; if(mstruct2.isLogicalXor()) return -1; if(mstruct1.isLogicalXor()) return 1; if(mstruct2.isLogicalNot()) return -1; if(mstruct1.isLogicalNot()) return 1; if(mstruct2.isComparison()) return -1; if(mstruct1.isComparison()) return 1; if(mstruct2.isBitwiseOr()) return -1; if(mstruct1.isBitwiseOr()) return 1; if(mstruct2.isBitwiseXor()) return -1; if(mstruct1.isBitwiseXor()) return 1; if(mstruct2.isBitwiseAnd()) return -1; if(mstruct1.isBitwiseAnd()) return 1; if(mstruct2.isBitwiseNot()) return -1; if(mstruct1.isBitwiseNot()) return 1; if(mstruct2.isUndefined()) return -1; if(mstruct1.isUndefined()) return 1; if(mstruct2.isFunction()) return -1; if(mstruct1.isFunction()) return 1; if(mstruct2.isAddition()) return -1; if(mstruct1.isAddition()) return 1; if(mstruct2.isMultiplication()) return -1; if(mstruct1.isMultiplication()) return 1; if(mstruct2.isPower()) return -1; if(mstruct1.isPower()) return 1; if(mstruct2.isUnit()) return -1; if(mstruct1.isUnit()) return 1; if(mstruct2.isSymbolic()) return -1; if(mstruct1.isSymbolic()) return 1; if(mstruct2.isVariable()) return -1; if(mstruct1.isVariable()) return 1; if(parent.isMultiplication()) { if(mstruct2.isNumber()) return -1; if(mstruct1.isNumber()) return 1; } return -1; } switch(mstruct1.type()) { case STRUCT_NUMBER: { if(!mstruct1.number().isComplex() && !mstruct2.number().isComplex()) { ComparisonResult cmp = mstruct1.number().compare(mstruct2.number()); if(cmp == COMPARISON_RESULT_LESS) return -1; else if(cmp == COMPARISON_RESULT_GREATER) return 1; return 0; } else { if(!mstruct1.number().hasRealPart()) { if(mstruct2.number().hasRealPart()) { return 1; } else { ComparisonResult cmp = mstruct1.number().compareImaginaryParts(mstruct2.number()); if(cmp == COMPARISON_RESULT_LESS) return -1; else if(cmp == COMPARISON_RESULT_GREATER) return 1; return 0; } } else if(mstruct2.number().hasRealPart()) { ComparisonResult cmp = mstruct1.number().compareRealParts(mstruct2.number()); if(cmp == COMPARISON_RESULT_EQUAL) { cmp = mstruct1.number().compareImaginaryParts(mstruct2.number()); } if(cmp == COMPARISON_RESULT_LESS) return -1; else if(cmp == COMPARISON_RESULT_GREATER) return 1; return 0; } else { return -1; } } return -1; } case STRUCT_UNIT: { if(mstruct1.unit() < mstruct2.unit()) return -1; if(mstruct1.unit() == mstruct2.unit()) return 0; return 1; } case STRUCT_SYMBOLIC: { if(mstruct1.symbol() < mstruct2.symbol()) return -1; else if(mstruct1.symbol() == mstruct2.symbol()) return 0; return 1; } case STRUCT_VARIABLE: { if(mstruct1.variable() < mstruct2.variable()) return -1; else if(mstruct1.variable() == mstruct2.variable()) return 0; return 1; } case STRUCT_FUNCTION: { if(mstruct1.function() < mstruct2.function()) return -1; if(mstruct1.function() == mstruct2.function()) { for(size_t i = 0; i < mstruct2.size(); i++) { if(i >= mstruct1.size()) { return -1; } int i2 = evalSortCompare(mstruct1[i], mstruct2[i], parent); if(i2 != 0) return i2; } return 0; } return 1; } case STRUCT_POWER: { int i = evalSortCompare(mstruct1[0], mstruct2[0], parent); if(i == 0) { return evalSortCompare(mstruct1[1], mstruct2[1], parent); } return i; } default: { if(mstruct2.size() < mstruct1.size()) return -1; else if(mstruct2.size() > mstruct1.size()) return 1; int ie; for(size_t i = 0; i < mstruct1.size(); i++) { ie = evalSortCompare(mstruct1[i], mstruct2[i], parent); if(ie != 0) { return ie; } } } } return 0; } void MathStructure::evalSort(bool recursive) { if(recursive) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).evalSort(true); } } //if(m_type != STRUCT_ADDITION && m_type != STRUCT_MULTIPLICATION && m_type != STRUCT_LOGICAL_AND && m_type != STRUCT_LOGICAL_OR && m_type != STRUCT_LOGICAL_XOR && m_type != STRUCT_BITWISE_AND && m_type != STRUCT_BITWISE_OR && m_type != STRUCT_BITWISE_XOR) return; if(m_type != STRUCT_ADDITION && m_type != STRUCT_MULTIPLICATION && m_type != STRUCT_BITWISE_AND && m_type != STRUCT_BITWISE_OR && m_type != STRUCT_BITWISE_XOR) return; vector sorted; for(size_t i = 0; i < SIZE; i++) { if(i == 0) { sorted.push_back(v_order[i]); } else { if(evalSortCompare(CHILD(i), *v_subs[sorted.back()], *this) >= 0) { sorted.push_back(v_order[i]); } else if(sorted.size() == 1) { sorted.insert(sorted.begin(), v_order[i]); } else { for(size_t i2 = sorted.size() - 2; ; i2--) { if(evalSortCompare(CHILD(i), *v_subs[sorted[i2]], *this) >= 0) { sorted.insert(sorted.begin() + i2 + 1, v_order[i]); break; } if(i2 == 0) { sorted.insert(sorted.begin(), v_order[i]); break; } } } } } for(size_t i2 = 0; i2 < sorted.size(); i2++) { v_order[i2] = sorted[i2]; } } int sortCompare(const MathStructure &mstruct1, const MathStructure &mstruct2, const MathStructure &parent, const PrintOptions &po); int sortCompare(const MathStructure &mstruct1, const MathStructure &mstruct2, const MathStructure &parent, const PrintOptions &po) { if(parent.isMultiplication()) { if(!mstruct1.representsNonMatrix() && !mstruct2.representsNonMatrix()) { return 0; } } if(parent.isAddition() && po.sort_options.minus_last) { bool m1 = mstruct1.hasNegativeSign(), m2 = mstruct2.hasNegativeSign(); if(m1 && !m2) { return 1; } else if(m2 && !m1) { return -1; } } bool isdiv1 = false, isdiv2 = false; if(!po.negative_exponents) { if(mstruct1.isMultiplication()) { for(size_t i = 0; i < mstruct1.size(); i++) { if(mstruct1[i].isPower() && mstruct1[i][1].hasNegativeSign()) { isdiv1 = true; break; } } } else if(mstruct1.isPower() && mstruct1[1].hasNegativeSign()) { isdiv1 = true; } if(mstruct2.isMultiplication()) { for(size_t i = 0; i < mstruct2.size(); i++) { if(mstruct2[i].isPower() && mstruct2[i][1].hasNegativeSign()) { isdiv2 = true; break; } } } else if(mstruct2.isPower() && mstruct2[1].hasNegativeSign()) { isdiv2 = true; } } if(parent.isAddition() && isdiv1 == isdiv2) { if(mstruct1.isMultiplication() && mstruct1.size() > 0) { size_t start = 0; while(mstruct1[start].isNumber() && mstruct1.size() > start + 1) { start++; } int i2; if(mstruct2.isMultiplication()) { if(mstruct2.size() < 1) return -1; size_t start2 = 0; while(mstruct2[start2].isNumber() && mstruct2.size() > start2 + 1) { start2++; } for(size_t i = 0; i + start < mstruct1.size(); i++) { if(i + start2 >= mstruct2.size()) return 1; i2 = sortCompare(mstruct1[i + start], mstruct2[i + start2], parent, po); if(i2 != 0) return i2; } if(mstruct1.size() - start == mstruct2.size() - start2) return 0; if(parent.isMultiplication()) return -1; else return 1; } else { i2 = sortCompare(mstruct1[start], mstruct2, parent, po); if(i2 != 0) return i2; } } else if(mstruct2.isMultiplication() && mstruct2.size() > 0) { size_t start = 0; while(mstruct2[start].isNumber() && mstruct2.size() > start + 1) { start++; } int i2; if(mstruct1.isMultiplication()) { return 1; } else { i2 = sortCompare(mstruct1, mstruct2[start], parent, po); if(i2 != 0) return i2; } } } if(mstruct1.type() != mstruct2.type()) { if(mstruct1.isVariable() && mstruct2.isSymbolic()) { if(parent.isMultiplication()) { if(mstruct1.variable()->isKnown()) return -1; } if(mstruct1.variable()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg).name < mstruct2.symbol()) return -1; else return 1; } if(mstruct2.isVariable() && mstruct1.isSymbolic()) { if(parent.isMultiplication()) { if(mstruct2.variable()->isKnown()) return 1; } if(mstruct1.symbol() < mstruct2.variable()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg).name) return -1; else return 1; } if(!parent.isMultiplication() || (!mstruct1.isNumber() && !mstruct2.isNumber())) { if(mstruct2.isPower()) { int i = sortCompare(mstruct1, mstruct2[0], parent, po); if(i == 0) { return sortCompare(m_one, mstruct2[1], parent, po); } return i; } if(mstruct1.isPower()) { int i = sortCompare(mstruct1[0], mstruct2, parent, po); if(i == 0) { return sortCompare(mstruct1[1], m_one, parent, po); } return i; } } if(parent.isMultiplication()) { if(mstruct2.isUnit()) return -1; if(mstruct1.isUnit()) return 1; } if(mstruct2.isInverse()) return -1; if(mstruct1.isInverse()) return 1; if(mstruct2.isDivision()) return -1; if(mstruct1.isDivision()) return 1; if(mstruct2.isNegate()) return -1; if(mstruct1.isNegate()) return 1; if(mstruct2.isLogicalAnd()) return -1; if(mstruct1.isLogicalAnd()) return 1; if(mstruct2.isLogicalOr()) return -1; if(mstruct1.isLogicalOr()) return 1; if(mstruct2.isLogicalXor()) return -1; if(mstruct1.isLogicalXor()) return 1; if(mstruct2.isLogicalNot()) return -1; if(mstruct1.isLogicalNot()) return 1; if(mstruct2.isComparison()) return -1; if(mstruct1.isComparison()) return 1; if(mstruct2.isBitwiseOr()) return -1; if(mstruct1.isBitwiseOr()) return 1; if(mstruct2.isBitwiseXor()) return -1; if(mstruct1.isBitwiseXor()) return 1; if(mstruct2.isBitwiseAnd()) return -1; if(mstruct1.isBitwiseAnd()) return 1; if(mstruct2.isBitwiseNot()) return -1; if(mstruct1.isBitwiseNot()) return 1; if(mstruct2.isUndefined()) return -1; if(mstruct1.isUndefined()) return 1; if(mstruct2.isFunction()) return -1; if(mstruct1.isFunction()) return 1; if(mstruct2.isAddition()) return -1; if(mstruct1.isAddition()) return 1; if(!parent.isMultiplication()) { if(isdiv2 && mstruct2.isMultiplication()) return -1; if(isdiv1 && mstruct1.isMultiplication()) return 1; if(mstruct2.isNumber()) return -1; if(mstruct1.isNumber()) return 1; } if(mstruct2.isMultiplication()) return -1; if(mstruct1.isMultiplication()) return 1; if(mstruct2.isPower()) return -1; if(mstruct1.isPower()) return 1; if(mstruct2.isUnit()) return -1; if(mstruct1.isUnit()) return 1; if(mstruct2.isSymbolic()) return -1; if(mstruct1.isSymbolic()) return 1; if(mstruct2.isVariable()) return -1; if(mstruct1.isVariable()) return 1; if(parent.isMultiplication()) { if(mstruct2.isNumber()) return -1; if(mstruct1.isNumber()) return 1; } return -1; } switch(mstruct1.type()) { case STRUCT_NUMBER: { if(!mstruct1.number().isComplex() && !mstruct2.number().isComplex()) { ComparisonResult cmp; if(parent.isMultiplication() && mstruct2.number().isNegative() != mstruct1.number().isNegative()) cmp = mstruct2.number().compare(mstruct1.number()); else cmp = mstruct1.number().compare(mstruct2.number()); if(cmp == COMPARISON_RESULT_LESS) return -1; else if(cmp == COMPARISON_RESULT_GREATER) return 1; return 0; } else { if(!mstruct1.number().hasRealPart()) { if(mstruct2.number().hasRealPart()) { return 1; } else { ComparisonResult cmp = mstruct1.number().compareImaginaryParts(mstruct2.number()); if(cmp == COMPARISON_RESULT_LESS) return -1; else if(cmp == COMPARISON_RESULT_GREATER) return 1; return 0; } } else if(mstruct2.number().hasRealPart()) { ComparisonResult cmp = mstruct1.number().compareRealParts(mstruct2.number()); if(cmp == COMPARISON_RESULT_EQUAL) { cmp = mstruct1.number().compareImaginaryParts(mstruct2.number()); } if(cmp == COMPARISON_RESULT_LESS) return -1; else if(cmp == COMPARISON_RESULT_GREATER) return 1; return 0; } else { return -1; } } return -1; } case STRUCT_UNIT: { if(mstruct1.unit() == mstruct2.unit()) return 0; if(mstruct1.unit()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, mstruct1.isPlural(), po.use_reference_names).name < mstruct2.unit()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, mstruct2.isPlural(), po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg).name) return -1; return 1; } case STRUCT_SYMBOLIC: { if(mstruct1.symbol() < mstruct2.symbol()) return -1; else if(mstruct1.symbol() == mstruct2.symbol()) return 0; return 1; } case STRUCT_VARIABLE: { if(mstruct1.variable() == mstruct2.variable()) return 0; if(parent.isMultiplication()) { if(mstruct1.variable()->isKnown() && !mstruct2.variable()->isKnown()) return -1; if(!mstruct1.variable()->isKnown() && mstruct2.variable()->isKnown()) return 1; } if(mstruct1.variable()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names).name < mstruct2.variable()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg).name) return -1; return 1; } case STRUCT_FUNCTION: { if(mstruct1.function() == mstruct2.function()) { for(size_t i = 0; i < mstruct2.size(); i++) { if(i >= mstruct1.size()) { return -1; } int i2 = sortCompare(mstruct1[i], mstruct2[i], parent, po); if(i2 != 0) return i2; } return 0; } if(mstruct1.function()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names).name < mstruct2.function()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg).name) return -1; return 1; } case STRUCT_POWER: { int i = sortCompare(mstruct1[0], mstruct2[0], parent, po); if(i == 0) { return sortCompare(mstruct1[1], mstruct2[1], parent, po); } return i; } case STRUCT_MULTIPLICATION: { if(isdiv1 != isdiv2) { if(isdiv1) return 1; return -1; } } case STRUCT_COMPARISON: { if((mstruct1.comparisonType() == COMPARISON_LESS || mstruct1.comparisonType() == COMPARISON_EQUALS_LESS) && (mstruct2.comparisonType() == COMPARISON_GREATER || mstruct2.comparisonType() == COMPARISON_EQUALS_GREATER)) { return 1; } if((mstruct1.comparisonType() == COMPARISON_GREATER || mstruct1.comparisonType() == COMPARISON_EQUALS_GREATER) && (mstruct2.comparisonType() == COMPARISON_LESS || mstruct2.comparisonType() == COMPARISON_EQUALS_LESS)) { return -1; } } default: { int ie; for(size_t i = 0; i < mstruct1.size(); i++) { if(i >= mstruct2.size()) return 1; ie = sortCompare(mstruct1[i], mstruct2[i], parent, po); if(ie != 0) { return ie; } } } } return 0; } void MathStructure::sort(const PrintOptions &po, bool recursive) { if(recursive) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).sort(po); } } if(m_type != STRUCT_ADDITION && m_type != STRUCT_MULTIPLICATION && m_type != STRUCT_BITWISE_AND && m_type != STRUCT_BITWISE_OR && m_type != STRUCT_BITWISE_XOR) return; vector sorted; bool b; PrintOptions po2 = po; po2.sort_options.minus_last = po.sort_options.minus_last && SIZE == 2; //!containsUnknowns(); for(size_t i = 0; i < SIZE; i++) { b = false; for(size_t i2 = 0; i2 < sorted.size(); i2++) { if(sortCompare(CHILD(i), *v_subs[sorted[i2]], *this, po2) < 0) { sorted.insert(sorted.begin() + i2, v_order[i]); b = true; break; } } if(!b) sorted.push_back(v_order[i]); } if(m_type == STRUCT_ADDITION && SIZE > 2 && po.sort_options.minus_last && v_subs[sorted[0]]->hasNegativeSign()) { for(size_t i2 = 1; i2 < sorted.size(); i2++) { if(!v_subs[sorted[i2]]->hasNegativeSign()) { sorted.insert(sorted.begin(), sorted[i2]); sorted.erase(sorted.begin() + (i2 + 1)); break; } } } for(size_t i2 = 0; i2 < sorted.size(); i2++) { v_order[i2] = sorted[i2]; } } bool MathStructure::containsOpaqueContents() const { if(isFunction()) return true; if(isUnit() && o_unit->subtype() != SUBTYPE_BASE_UNIT) return true; if(isVariable() && o_variable->isKnown()) return true; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsOpaqueContents()) return true; } return false; } bool MathStructure::containsAdditionPower() const { if(m_type == STRUCT_POWER && CHILD(0).isAddition()) return true; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsAdditionPower()) return true; } return false; } size_t MathStructure::countTotalChildren(bool count_function_as_one) const { if((m_type == STRUCT_FUNCTION && count_function_as_one) || SIZE == 0) return 1; size_t count = 0; for(size_t i = 0; i < SIZE; i++) { count += CHILD(i).countTotalChildren() + 1; } return count; } bool test_comparisons(const MathStructure &msave, MathStructure &mthis, const MathStructure &x_var, const EvaluationOptions &eo, bool sub = false); bool try_isolate_x(MathStructure &mstruct, EvaluationOptions &eo3, const EvaluationOptions &eo); bool try_isolate_x(MathStructure &mstruct, EvaluationOptions &eo3, const EvaluationOptions &eo) { if(mstruct.isProtected()) return false; if(mstruct.isComparison()) { MathStructure mtest(mstruct); eo3.test_comparisons = false; eo3.warn_about_denominators_assumed_nonzero = false; mtest[0].calculatesub(eo3, eo); mtest[1].calculatesub(eo3, eo); eo3.test_comparisons = eo.test_comparisons; const MathStructure *x_var2; if(eo.isolate_var) x_var2 = eo.isolate_var; else x_var2 = &mstruct.find_x_var(); if(x_var2->isUndefined()) return false; if(mtest[0] == *x_var2 && !mtest[1].contains(*x_var2)) return false; if(mtest.isolate_x(eo3, eo, *x_var2, false)) { if(test_comparisons(mstruct, mtest, *x_var2, eo3)) { mstruct = mtest; return true; } } } else { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(try_isolate_x(mstruct[i], eo3, eo)) b = true; } return b; } return false; } bool compare_delete(MathStructure &mnum, MathStructure &mden, bool &erase1, bool &erase2, const EvaluationOptions &eo) { erase1 = false; erase2 = false; if(mnum == mden) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mnum.representsZero(true)) || mnum.representsNonZero(true) || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mnum.representsZero(true) && warn_about_denominators_assumed_nonzero(mnum, eo))) { erase1 = true; erase2 = true; } else { if(mnum.isPower()) { mnum.setToChild(1); mden.setToChild(1); return true; } return false; } return true; } if(!mnum.isPower() && !mden.isPower()) return false; MathStructure *mbase1, *mbase2, *mexp1 = NULL, *mexp2 = NULL; if(mnum.isPower()) { if(!IS_REAL(mnum[1])) return false; mexp1 = &mnum[1]; mbase1 = &mnum[0]; } else { mbase1 = &mnum; } if(mden.isPower()) { if(!IS_REAL(mden[1])) return false; mexp2 = &mden[1]; mbase2 = &mden[0]; } else { mbase2 = &mden; } if(mbase1->equals(*mbase2)) { if(mexp1 && mexp2) { if(mexp1->number().isLessThan(mexp2->number())) { erase1 = true; mexp2->number() -= mexp1->number(); if(mexp2->isOne()) mden.setToChild(1, true); } else { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mbase2->representsZero(true)) || mbase2->representsNonZero(true) || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mbase2->representsZero(true) && warn_about_denominators_assumed_nonzero(*mbase2, eo))) { erase2 = true; mexp1->number() -= mexp2->number(); if(mexp1->isOne()) mnum.setToChild(1, true); } else { if(mexp2->number().isFraction()) return false; mexp2->number()--; mexp1->number() -= mexp2->number(); if(mexp1->isOne()) mnum.setToChild(1, true); if(mexp2->isOne()) mden.setToChild(1, true); return true; } } return true; } else if(mexp1) { if(mexp1->number().isFraction()) { erase1 = true; mbase2->raise(m_one); (*mbase2)[1].number() -= mexp1->number(); return true; } if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mbase2->representsZero(true)) || mbase2->representsNonZero(true) || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mbase2->representsZero(true) && warn_about_denominators_assumed_nonzero(*mbase2, eo))) { mexp1->number()--; erase2 = true; if(mexp1->isOne()) mnum.setToChild(1, true); return true; } return false; } else if(mexp2) { if(mexp2->number().isFraction()) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mbase2->representsZero(true)) || mbase2->representsNonZero(true) || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mbase2->representsZero(true) && warn_about_denominators_assumed_nonzero(*mbase2, eo))) { erase2 = true; mbase1->raise(m_one); (*mbase1)[1].number() -= mexp2->number(); return true; } return false; } mexp2->number()--; erase1 = true; if(mexp2->isOne()) mden.setToChild(1, true); return true; } } return false; } bool factor1(const MathStructure &mstruct, MathStructure &mnum, MathStructure &mden, const EvaluationOptions &eo) { mnum.setUndefined(); mden.setUndefined(); if(mstruct.isAddition()) { bool b_num = false, b_den = false; for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { if(mstruct[i][i2].isPower() && mstruct[i][i2][1].hasNegativeSign()) { b_den = true; if(b_num) break; } else { b_num = true; if(b_den) break; } } } else if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { b_den = true; if(b_num) break; } else { b_num = true; if(b_den) break; } } if(b_num && b_den) { MathStructure *mden_cur = NULL; vector multi_index; for(size_t i = 0; i < mstruct.size(); i++) { if(mnum.isUndefined()) { mnum.transform(STRUCT_ADDITION); } else { mnum.addChild(m_undefined); } if(mstruct[i].isMultiplication()) { if(!mden_cur) { mden_cur = new MathStructure(); mden_cur->setUndefined(); } for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { if(mstruct[i][i2].isPower() && mstruct[i][i2][1].hasNegativeSign()) { if(mden_cur->isUndefined()) { if(mstruct[i][i2][1].isMinusOne()) { *mden_cur = mstruct[i][i2][0]; } else if(mstruct[i][i2][1].isNumber()) { *mden_cur = mstruct[i][i2]; (*mden_cur)[1].number().negate(); } else { *mden_cur = mstruct[i][i2]; (*mden_cur)[1][0].number().negate(); } } else { if(mstruct[i][i2][1].isMinusOne()) { mden_cur->multiply(mstruct[i][i2][0], true); } else if(mstruct[i][i2][1].isNumber()) { mden_cur->multiply(mstruct[i][i2], true); (*mden_cur)[mden_cur->size() - 1][1].number().negate(); } else { mden_cur->multiply(mstruct[i][i2], true); (*mden_cur)[mden_cur->size() - 1][1][0].number().negate(); } } } else { if(mnum[mnum.size() - 1].isUndefined()) { mnum[mnum.size() - 1] = mstruct[i][i2]; } else { mnum[mnum.size() - 1].multiply(mstruct[i][i2], true); } } } if(mnum[mnum.size() - 1].isUndefined()) mnum[mnum.size() - 1].set(1, 1); if(mden_cur->isUndefined()) { multi_index.push_back(-1); } else { multi_index.push_back(mden.size()); if(mden.isUndefined()) { mden.transform(STRUCT_MULTIPLICATION); mden[mden.size() - 1].set_nocopy(*mden_cur); mden_cur->unref(); } else { mden.addChild_nocopy(mden_cur); } mden_cur = NULL; } } else if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { multi_index.push_back(mden.size()); if(mden.isUndefined()) { mden.transform(STRUCT_MULTIPLICATION); } else { mden.addChild(m_undefined); } if(mstruct[i][1].isMinusOne()) { mden[mden.size() - 1] = mstruct[i][0]; } else { mden[mden.size() - 1] = mstruct[i]; unnegate_sign(mden[mden.size() - 1][1]); } mnum[mnum.size() - 1].set(1, 1); } else { multi_index.push_back(-1); mnum[mnum.size() - 1] = mstruct[i]; } } for(size_t i = 0; i < mnum.size(); i++) { if(multi_index[i] < 0 && mnum[i].isOne()) { if(mden.size() == 1) { mnum[i] = mden[0]; } else { mnum[i] = mden; } } else { for(size_t i2 = 0; i2 < mden.size(); i2++) { if((int) i2 != multi_index[i]) { mnum[i].multiply(mden[i2], true); } } } mnum[i].calculatesub(eo, eo, false); } if(mden.size() == 1) { mden.setToChild(1); } else { mden.calculatesub(eo, eo, false); } mnum.calculatesub(eo, eo, false); } } else if(mstruct.isMultiplication()) { bool b_num = false, b_den = false; for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { b_den = true; if(b_num) break; } else { b_num = true; if(b_den) break; } } if(b_den && b_num) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { if(mden.isUndefined()) { if(mstruct[i][1].isMinusOne()) { mden = mstruct[i][0]; } else { mden = mstruct[i]; unnegate_sign(mden[1]); } } else { if(mstruct[i][1].isMinusOne()) { mden.multiply(mstruct[i][0], true); } else { mden.multiply(mstruct[i], true); unnegate_sign(mden[mden.size() - 1][1]); } } } else { if(mnum.isUndefined()) { mnum = mstruct[i]; } else { mnum.multiply(mstruct[i], true); } } } } mden.calculatesub(eo, eo, false); } if(!mnum.isUndefined() && !mden.isUndefined()) { while(true) { mnum.factorize(eo); mnum.evalSort(true); if(mnum.isMultiplication()) { for(size_t i = 0; i < mnum.size(); ) { if(mnum[i].isPower() && mnum[i][1].hasNegativeSign()) { if(mnum[i][1].isMinusOne()) { mnum[i][0].ref(); mden.multiply_nocopy(&mnum[i][0], true); } else { mnum[i].ref(); mden.multiply_nocopy(&mnum[i], true); unnegate_sign(mden[mden.size() - 1][1]); } mden.calculateMultiplyLast(eo); mnum.delChild(i + 1); } else { i++; } } if(mnum.size() == 0) mnum.set(1, 1); else if(mnum.size() == 1) mnum.setToChild(1); } mden.factorize(eo); mden.evalSort(true); bool b = false; if(mden.isMultiplication()) { for(size_t i = 0; i < mden.size(); ) { if(mden[i].isPower() && mden[i][1].hasNegativeSign()) { MathStructure *mden_inv = new MathStructure(mden[i]); if(mden_inv->calculateInverse(eo)) { mnum.multiply_nocopy(mden_inv, true); mnum.calculateMultiplyLast(eo); mden.delChild(i + 1); b = true; } else { mden_inv->unref(); i++; } } else { i++; } } if(mden.size() == 0) mden.set(1, 1); else if(mden.size() == 1) mden.setToChild(1); } if(!b) break; } bool erase1, erase2, b; if(mnum.isMultiplication()) { for(int i = 0; i < (int) mnum.size(); i++) { if(mden.isMultiplication()) { for(size_t i2 = 0; i2 < mden.size(); i2++) { if(compare_delete(mnum[i], mden[i2], erase1, erase2, eo)) { if(erase1) mnum.delChild(i + 1); if(erase2) mden.delChild(i2 + 1); i--; b = true; break; } } } else { if(compare_delete(mnum[i], mden, erase1, erase2, eo)) { if(erase1) mnum.delChild(i + 1); if(erase2) mden.set(1, 1); b = true; break; } } } } else if(mden.isMultiplication()) { for(size_t i = 0; i < mden.size(); i++) { if(compare_delete(mnum, mden[i], erase1, erase2, eo)) { if(erase1) mnum.set(1, 1); if(erase2) mden.delChild(i + 1); b = true; break; } } } else { if(compare_delete(mnum, mden, erase1, erase2, eo)) { if(erase1) mnum.set(1, 1); if(erase2) mden.set(1, 1); b = true; } } if(mnum.isMultiplication()) { if(mnum.size() == 0) mnum.set(1, 1); else if(mnum.size() == 1) mnum.setToChild(1); } if(mden.isMultiplication()) { if(mden.size() == 0) mden.set(1, 1); else if(mden.size() == 1) mden.setToChild(1); } return true; } return false; } bool MathStructure::simplify(const EvaluationOptions &eo, bool unfactorize) { if(SIZE == 0) return false; if(unfactorize) { EvaluationOptions eo2 = eo; eo2.expand = true; calculatesub(eo2, eo2); } if(!isMultiplication() && !isAddition()) { bool b = false; if(isComparison()) { EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = false; for(size_t i = 0; i < SIZE; i++) { b = CHILD(i).simplify(eo2, false); } } else { for(size_t i = 0; i < SIZE; i++) { b = CHILD(i).simplify(eo, false); } } return b; } EvaluationOptions eo2 = eo; eo2.expand = true; MathStructure mden, mnum; if(factor1(*this, mnum, mden, eo)) { mnum.calculatesub(eo2, eo2); mden.calculatesub(eo2, eo2); if(mden.isOne()) { set_nocopy(mnum); return true; } if(mnum.countTotalChildren() + mden.countTotalChildren() + 2 < countTotalChildren()) { MathStructure mtest(mnum); mtest.divide(mden); mtest.calculatesub(eo2, eo2); if(mnum.countTotalChildren() + mden.countTotalChildren() + 2 <= mtest.countTotalChildren()) { set_nocopy(mnum); if(!mden.isOne()) { MathStructure *mnew = new MathStructure(); mnew->set_nocopy(mden); divide_nocopy(mnew); } } else { set_nocopy(mtest); } return true; } else { MathStructure mtest; mtest.set_nocopy(mnum); if(!mden.isOne()) { MathStructure *mnew = new MathStructure(); mnew->set_nocopy(mden); mtest.divide_nocopy(mnew); } mtest.calculatesub(eo2, eo2); if(mtest.countTotalChildren() < countTotalChildren()) { set_nocopy(mtest); return true; } } } return false; } void clean_multiplications(MathStructure &mstruct); void clean_multiplications(MathStructure &mstruct) { if(mstruct.isMultiplication()) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isMultiplication()) { size_t i2 = 0; for(; i2 < mstruct[i + i2].size(); i2++) { mstruct[i + i2][i2].ref(); mstruct.insertChild_nocopy(&mstruct[i + i2][i2], i + i2 + 1); } mstruct.delChild(i + i2 + 1); } } } for(size_t i = 0; i < mstruct.size(); i++) { clean_multiplications(mstruct[i]); } } void MathStructure::calculateUncertaintyPropagation(const EvaluationOptions &eo) { if(o_uncertainty) return; MathStructure *new_uncertainty = NULL; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isFunction() && CHILD(i).function() == CALCULATOR->f_uncertainty) { MathStructure mstruct = CHILD(i)[1]; CHILD(i).setToChild(1); if(o_uncertainty == NULL) { new_uncertainty = new MathStructure(); new_uncertainty->set(CALCULATOR->f_diff, this, &CHILD(i), NULL); new_uncertainty->multiply(mstruct); } else { MathStructure *uncertainty_add = new MathStructure(CALCULATOR->f_diff, this, &CHILD(i), NULL); uncertainty_add->multiply(mstruct); new_uncertainty->add_nocopy(uncertainty_add, true); } new_uncertainty->eval(eo); break; } } o_uncertainty = new_uncertainty; } MathStructure &MathStructure::eval(const EvaluationOptions &eo) { unformat(eo); bool found_complex_relations = false; if(eo.sync_units && syncUnits(false, &found_complex_relations, false)) { unformat(eo); } EvaluationOptions feo = eo; if(eo.structuring == STRUCTURING_FACTORIZE) feo.structuring = STRUCTURING_SIMPLIFY; EvaluationOptions eo2 = eo; eo2.structuring = STRUCTURING_NONE; eo2.expand = false; eo2.test_comparisons = false; calculateUncertaintyPropagation(eo); if(eo.calculate_functions && calculateFunctions(feo)) { unformat(eo); if(eo.sync_units && syncUnits(false, &found_complex_relations, true, feo)) { unformat(eo); } } if(eo2.approximation == APPROXIMATION_TRY_EXACT) { EvaluationOptions eo3 = eo2; eo3.approximation = APPROXIMATION_EXACT; eo3.split_squares = false; eo3.assume_denominators_nonzero = false; calculatesub(eo3, feo); if(eo.sync_units && syncUnits(false, &found_complex_relations, true, feo)) { unformat(eo); calculatesub(eo3, feo); } eo2.approximation = APPROXIMATION_APPROXIMATE; } calculatesub(eo2, feo); if(eo.sync_units && syncUnits(false, &found_complex_relations, true, feo)) { unformat(eo); calculatesub(eo2, feo); } if(eo2.isolate_x) { eo2.assume_denominators_nonzero = false; if(isolate_x(eo2, feo)) { eo2.assume_denominators_nonzero = eo.assume_denominators_nonzero; calculatesub(eo2, feo); } else { eo2.assume_denominators_nonzero = eo.assume_denominators_nonzero; } } if(eo.expand || (eo.test_comparisons && !found_complex_relations && containsType(STRUCT_COMPARISON))) { eo2.test_comparisons = eo.test_comparisons && !found_complex_relations; eo2.expand = eo.expand; bool b = eo2.test_comparisons; if(!b && isAddition()) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsType(STRUCT_ADDITION, false) == 1) { b = true; break; } } } else if(!b) { b = containsType(STRUCT_ADDITION, false) == 1; } if(b) { calculatesub(eo2, feo); if(eo2.isolate_x) { eo2.assume_denominators_nonzero = false; if(isolate_x(eo2, feo)) { eo2.assume_denominators_nonzero = eo.assume_denominators_nonzero; calculatesub(eo2, feo); } else { eo2.assume_denominators_nonzero = eo.assume_denominators_nonzero; } } } } if(eo2.isolate_x && containsType(STRUCT_COMPARISON) && eo2.assume_denominators_nonzero) { if(try_isolate_x(*this, eo2, feo)) { calculatesub(eo2, feo); } } eo2.test_comparisons = eo.test_comparisons; if(eo2.sync_units && eo2.sync_complex_unit_relations && found_complex_relations) { if(syncUnits(true, NULL, true, feo)) { unformat(eo); calculatesub(eo2, feo); if(eo2.isolate_x) { eo2.assume_denominators_nonzero = false; isolate_x(eo2, feo); if(isolate_x(eo2, feo)) { eo2.assume_denominators_nonzero = eo.assume_denominators_nonzero; calculatesub(eo2, feo); } else { eo2.assume_denominators_nonzero = eo.assume_denominators_nonzero; } } } } if(eo.structuring == STRUCTURING_SIMPLIFY) { simplify(eo2, false); clean_multiplications(*this); } else if(eo.structuring == STRUCTURING_FACTORIZE) { factorize(eo2); clean_multiplications(*this); } return *this; } bool factorize_find_multiplier(const MathStructure &mstruct, MathStructure &mnew, MathStructure &factor_mstruct, bool only_units = false) { factor_mstruct.set(m_one); switch(mstruct.type()) { case STRUCT_ADDITION: { if(!only_units) { bool bfrac = false, bint = true; idm1(mstruct, bfrac, bint); if(bfrac || bint) { Number gcd(1, 1); idm2(mstruct, bfrac, bint, gcd); if((bint || bfrac) && !gcd.isOne()) { if(bfrac) gcd.recip(); factor_mstruct.set(gcd); } } } if(mstruct.size() > 0) { size_t i = 0; const MathStructure *cur_mstruct; while(true) { if(mstruct[0].isMultiplication()) { if(i >= mstruct[0].size()) { break; } cur_mstruct = &mstruct[0][i]; } else { cur_mstruct = &mstruct[0]; } if(!cur_mstruct->isNumber() && (!only_units || cur_mstruct->isUnit_exp())) { const MathStructure *exp = NULL; const MathStructure *bas; if(cur_mstruct->isPower() && IS_REAL((*cur_mstruct)[1])) { exp = cur_mstruct->exponent(); bas = cur_mstruct->base(); } else { bas = cur_mstruct; } bool b = true; for(size_t i2 = 1; i2 < mstruct.size(); i2++) { b = false; size_t i3 = 0; const MathStructure *cmp_mstruct; while(true) { if(mstruct[i2].isMultiplication()) { if(i3 >= mstruct[i2].size()) { break; } cmp_mstruct = &mstruct[i2][i3]; } else { cmp_mstruct = &mstruct[i2]; } if(cmp_mstruct->equals(*bas)) { if(exp) { exp = NULL; } b = true; break; } else if(cmp_mstruct->isPower() && cmp_mstruct->base()->equals(*bas)) { if(exp) { if(IS_REAL((*cmp_mstruct)[1])) { if(cmp_mstruct->exponent()->number().isLessThan(exp->number())) { exp = cmp_mstruct->exponent(); } b = true; break; } else { exp = NULL; } } else { b = true; break; } } if(!mstruct[i2].isMultiplication()) { break; } i3++; } if(!b) break; } if(b) { if(exp) { MathStructure *mstruct = new MathStructure(*bas); mstruct->raise(*exp); if(factor_mstruct.isOne()) { factor_mstruct.set_nocopy(*mstruct); mstruct->unref(); } else { factor_mstruct.multiply_nocopy(mstruct, true); } } else { if(factor_mstruct.isOne()) factor_mstruct.set(*bas); else factor_mstruct.multiply(*bas, true); } } } if(!mstruct[0].isMultiplication()) { break; } i++; } } if(!factor_mstruct.isOne()) { if(&mstruct != &mnew) mnew.set(mstruct); MathStructure *mfactor; size_t i = 0; while(true) { if(factor_mstruct.isMultiplication()) { if(i >= factor_mstruct.size()) break; mfactor = &factor_mstruct[i]; } else { mfactor = &factor_mstruct; } for(size_t i2 = 0; i2 < mnew.size(); i2++) { switch(mnew[i2].type()) { case STRUCT_NUMBER: { if(mfactor->isNumber()) { mnew[i2].number() /= mfactor->number(); } break; } case STRUCT_POWER: { if(!IS_REAL(mnew[i2][1])) { if(mfactor->isNumber()) { mnew[i2].transform(STRUCT_MULTIPLICATION); mnew[i2].insertChild(MathStructure(1, 1), 1); mnew[i2][0].number() /= mfactor->number(); } else { mnew[i2].set(m_one); } } else if(mfactor->isNumber()) { mnew[i2].transform(STRUCT_MULTIPLICATION); mnew[i2].insertChild(MathStructure(1, 1), 1); mnew[i2][0].number() /= mfactor->number(); } else if(mfactor->isPower() && IS_REAL((*mfactor)[1])) { if(mfactor->equals(mnew[i2])) { mnew[i2].set(m_one); } else { mnew[i2][1].number() -= mfactor->exponent()->number(); if(mnew[i2][1].number().isOne()) { mnew[i2].setToChild(1, true); } } } else { mnew[i2][1].number() -= 1; if(mnew[i2][1].number().isOne()) { mnew[i2].setToChild(1); } else if(mnew[i2][1].number().isZero()) { mnew[i2].set(m_one); } } break; } case STRUCT_MULTIPLICATION: { bool b = true; if(mfactor->isNumber() && (mnew[i2].size() < 1 || !mnew[i2][0].isNumber())) { mnew[i2].insertChild(MathStructure(1, 1), 1); } for(size_t i3 = 0; i3 < mnew[i2].size() && b; i3++) { switch(mnew[i2][i3].type()) { case STRUCT_NUMBER: { if(mfactor->isNumber()) { if(mfactor->equals(mnew[i2][i3])) { mnew[i2].delChild(i3 + 1); } else { mnew[i2][i3].number() /= mfactor->number(); } b = false; } break; } case STRUCT_POWER: { if(!IS_REAL(mnew[i2][i3][1])) { if(mfactor->equals(mnew[i2][i3])) { mnew[i2].delChild(i3 + 1); b = false; } } else if(mfactor->isPower() && IS_REAL((*mfactor)[1]) && mfactor->base()->equals(mnew[i2][i3][0])) { if(mfactor->equals(mnew[i2][i3])) { mnew[i2].delChild(i3 + 1); } else { mnew[i2][i3][1].number() -= mfactor->exponent()->number(); if(mnew[i2][i3][1].number().isOne()) { MathStructure mstruct2(mnew[i2][i3][0]); mnew[i2][i3] = mstruct2; } else if(mnew[i2][i3][1].number().isZero()) { mnew[i2].delChild(i3 + 1); } } b = false; } else if(mfactor->equals(mnew[i2][i3][0])) { if(mnew[i2][i3][1].number() == 2) { MathStructure mstruct2(mnew[i2][i3][0]); mnew[i2][i3] = mstruct2; } else if(mnew[i2][i3][1].number().isOne()) { mnew[i2].delChild(i3 + 1); } else { mnew[i2][i3][1].number() -= 1; } b = false; } break; } default: { if(mfactor->equals(mnew[i2][i3])) { mnew[i2].delChild(i3 + 1); b = false; } } } } if(mnew[i2].size() == 1) { MathStructure mstruct2(mnew[i2][0]); mnew[i2] = mstruct2; } break; } default: { if(mfactor->isNumber()) { mnew[i2].transform(STRUCT_MULTIPLICATION); mnew[i2].insertChild(MathStructure(1, 1), 1); mnew[i2][0].number() /= mfactor->number(); } else { mnew[i2].set(m_one); } } } } if(factor_mstruct.isMultiplication()) { i++; } else { break; } } return true; } } default: {} } return false; } struct sym_desc { MathStructure sym; Number deg_a; Number deg_b; Number ldeg_a; Number ldeg_b; Number max_deg; size_t max_lcnops; bool operator<(const sym_desc &x) const { if (max_deg == x.max_deg) return max_lcnops < x.max_lcnops; else return max_deg.isLessThan(x.max_deg); } }; typedef std::vector sym_desc_vec; void integer_content(const MathStructure &mpoly, Number &icontent); void interpolate(const MathStructure &gamma, const Number &xi, const MathStructure &xvar, MathStructure &minterp, const EvaluationOptions &eo); bool get_first_symbol(const MathStructure &mpoly, MathStructure &xvar); bool divide_in_z(const MathStructure &mnum, const MathStructure &mden, MathStructure &mquotient, sym_desc_vec::const_iterator var, const EvaluationOptions &eo); bool prem(const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar, MathStructure &mrem, const EvaluationOptions &eo, bool check_args = true); bool sr_gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mgcd, sym_desc_vec::const_iterator var, const EvaluationOptions &eo); void polynomial_smod(const MathStructure &mpoly, const Number &xi, MathStructure &msmod, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_smod = 0); bool heur_gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mgcd, const EvaluationOptions &eo, MathStructure *ca, MathStructure *cb, sym_desc_vec::const_iterator var); void add_symbol(const MathStructure &mpoly, sym_desc_vec &v); void collect_symbols(const MathStructure &mpoly, sym_desc_vec &v); void add_symbol(const MathStructure &mpoly, vector &v); void collect_symbols(const MathStructure &mpoly, vector &v); void get_symbol_stats(const MathStructure &m1, const MathStructure &m2, sym_desc_vec &v); bool get_first_symbol(const MathStructure &mpoly, MathStructure &xvar) { if(IS_A_SYMBOL(mpoly) || mpoly.isUnit()) { xvar = mpoly; return true; } else if(mpoly.isAddition() || mpoly.isMultiplication()) { for(size_t i = 0; i < mpoly.size(); i++) { if(get_first_symbol(mpoly[i], xvar)) return true; } } else if(mpoly.isPower()) { return get_first_symbol(mpoly[0], xvar); } return false; } bool MathStructure::polynomialDivide(const MathStructure &mnum, const MathStructure &mden, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args) { mquotient.clear(); if(mden.isZero()) { //division by zero return false; } if(mnum.isZero()) { mquotient.clear(); return true; } if(mden.isNumber()) { mquotient = mnum; if(mnum.isNumber()) { mquotient.number() /= mden.number(); } else { mquotient.calculateDivide(mden, eo); } return true; } else if(mnum.isNumber()) { return false; } if(mnum == mden) { mquotient.set(1, 1); return true; } if(check_args && (!mnum.isRationalPolynomial() || !mden.isRationalPolynomial())) { return false; } MathStructure xvar; if(!get_first_symbol(mnum, xvar) && !get_first_symbol(mden, xvar)) return false; Number numdeg = mnum.degree(xvar); Number dendeg = mden.degree(xvar); MathStructure dencoeff; mden.coefficient(xvar, dendeg, dencoeff); MathStructure mrem(mnum); while(numdeg.isGreaterThanOrEqualTo(dendeg)) { MathStructure numcoeff; mrem.coefficient(xvar, numdeg, numcoeff); numdeg -= dendeg; if(numcoeff == dencoeff) { if(numdeg.isZero()) { numcoeff.set(1, 1); } else { numcoeff = xvar; if(!numdeg.isOne()) { numcoeff.raise(numdeg); } } } else { if(dencoeff.isNumber()) { if(numcoeff.isNumber()) { numcoeff.number() /= dencoeff.number(); } else { numcoeff.calculateDivide(dencoeff, eo); } } else { MathStructure mcopy(numcoeff); if(!MathStructure::polynomialDivide(mcopy, dencoeff, numcoeff, eo, false)) { return false; } } if(!numdeg.isZero() && !numcoeff.isZero()) { if(numcoeff.isOne()) { numcoeff = xvar; if(!numdeg.isOne()) { numcoeff.raise(numdeg); } } else { numcoeff.multiply(xvar, true); if(!numdeg.isOne()) { numcoeff[numcoeff.size() - 1].raise(numdeg); } numcoeff.calculateMultiplyLast(eo); } } } if(mquotient.isZero()) mquotient = numcoeff; else mquotient.add(numcoeff, true); numcoeff.calculateMultiply(mden, eo); mrem.calculateSubtract(numcoeff, eo); if(mrem.isZero()) return true; numdeg = mrem.degree(xvar); } return false; } bool divide_in_z(const MathStructure &mnum, const MathStructure &mden, MathStructure &mquotient, sym_desc_vec::const_iterator var, const EvaluationOptions &eo) { mquotient.clear(); if(mden.isZero()) return false; if(mnum.isZero()) return true; if(mden.isOne()) { mquotient = mnum; return true; } if(mnum.isNumber()) { if(!mden.isNumber()) { return false; } mquotient = mnum; return mquotient.number().divide(mden.number()) && mquotient.isInteger(); } if(mnum == mden) { mquotient.set(1, 1); return true; } if(mden.isPower()) { MathStructure qbar(mnum); for(Number ni(mden[1].number()); ni.isPositive(); ni--) { if(!divide_in_z(qbar, mden[0], mquotient, var, eo)) return false; qbar = mquotient; } return true; } if(mden.isMultiplication()) { MathStructure qbar(mnum); for(size_t i = 0; i < mden.size(); i++) { sym_desc_vec sym_stats; get_symbol_stats(mnum, mden[i], sym_stats); if(!divide_in_z(qbar, mden[i], mquotient, sym_stats.begin(), eo)) return false; qbar = mquotient; } return true; } const MathStructure &xvar = var->sym; Number numdeg = mnum.degree(xvar); Number dendeg = mden.degree(xvar); if(dendeg.isGreaterThan(numdeg)) return false; MathStructure dencoeff; MathStructure mrem(mnum); mden.coefficient(xvar, dendeg, dencoeff); while(numdeg.isGreaterThanOrEqualTo(dendeg)) { MathStructure numcoeff; mrem.coefficient(xvar, numdeg, numcoeff); MathStructure term; if(!divide_in_z(numcoeff, dencoeff, term, var + 1, eo)) break; numdeg -= dendeg; if(!numdeg.isZero() && !term.isZero()) { if(term.isOne()) { term = xvar; if(!numdeg.isOne()) { term.raise(numdeg); } } else { term.multiply(xvar, true); if(!numdeg.isOne()) { term[term.size() - 1].raise(numdeg); } term.calculateMultiplyLast(eo); } } if(mquotient.isZero()) { mquotient = term; } else { mquotient.calculateAdd(term, eo); } term.calculateMultiply(mden, eo); mrem.calculateSubtract(term, eo); if(mrem.isZero()) { return true; } numdeg = mrem.degree(xvar); } return false; } bool prem(const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar, MathStructure &mrem, const EvaluationOptions &eo, bool check_args) { mrem.clear(); if(mden.isZero()) { //division by zero return false; } if(mnum.isNumber()) { if(!mden.isNumber()) { mrem = mden; } return true; } if(check_args && (!mnum.isRationalPolynomial() || !mden.isRationalPolynomial())) { return false; } mrem = mnum; MathStructure eb(mden); Number rdeg = mrem.degree(xvar); Number bdeg = eb.degree(xvar); MathStructure blcoeff; if(bdeg.isLessThanOrEqualTo(rdeg)) { eb.coefficient(xvar, bdeg, blcoeff); if(bdeg == 0) { eb.clear(); } else { MathStructure mpow(xvar); mpow.raise(bdeg); POWER_CLEAN(mpow) mpow.calculateMultiply(blcoeff, eo); eb.calculateSubtract(mpow, eo); } } else { blcoeff.set(1, 1); } Number delta(rdeg); delta -= bdeg; delta++; int i = 0; while(rdeg.isGreaterThanOrEqualTo(bdeg) && !mrem.isZero()) { MathStructure rlcoeff; mrem.coefficient(xvar, rdeg, rlcoeff); MathStructure term(xvar); term.raise(rdeg); term[1].number() -= bdeg; POWER_CLEAN(term) term.calculateMultiply(rlcoeff, eo); term.calculateMultiply(eb, eo); if(rdeg == 0) { mrem = term; mrem.calculateNegate(eo); } else { if(!rdeg.isZero()) { rlcoeff.multiply(xvar, true); if(!rdeg.isOne()) rlcoeff[rlcoeff.size() - 1].raise(rdeg); rlcoeff.calculateMultiplyLast(eo); } mrem.calculateSubtract(rlcoeff, eo); mrem.calculateMultiply(blcoeff, eo); mrem.calculateSubtract(term, eo); } rdeg = mrem.degree(xvar); i++; } delta -= i; blcoeff.raise(delta); mrem.calculateMultiply(blcoeff, eo); return true; } bool sr_gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mgcd, sym_desc_vec::const_iterator var, const EvaluationOptions &eo) { const MathStructure &xvar = var->sym; MathStructure c, d; Number adeg = m1.degree(xvar); Number bdeg = m2.degree(xvar); Number cdeg, ddeg; if(adeg.isGreaterThanOrEqualTo(bdeg)) { c = m1; d = m2; cdeg = adeg; ddeg = bdeg; } else { c = m2; d = m1; cdeg = bdeg; ddeg = adeg; } MathStructure cont_c, cont_d; c.polynomialContent(xvar, cont_c, eo); d.polynomialContent(xvar, cont_d, eo); MathStructure gamma; MathStructure::gcd(cont_c, cont_d, gamma, eo, false); if(ddeg.isZero()) { mgcd = gamma; return true; } MathStructure prim_c, prim_d; c.polynomialPrimpart(xvar, cont_c, prim_c, eo); d.polynomialPrimpart(xvar, cont_d, prim_d, eo); c = prim_c; d = prim_d; MathStructure r; MathStructure ri(1, 1); MathStructure psi(1, 1); Number delta(cdeg); delta -= ddeg; while(true) { prem(c, d, xvar, r, eo, false); if(r.isZero()) { mgcd = gamma; MathStructure mprim; d.polynomialPrimpart(xvar, mprim, eo); mgcd.calculateMultiply(mprim, eo); return true; } c = d; cdeg = ddeg; MathStructure psi_pow(psi); psi_pow.calculateRaise(delta, eo); ri.calculateMultiply(psi_pow, eo); if(!divide_in_z(r, ri, d, var, eo)) { return false; } ddeg = d.degree(xvar); if(ddeg.isZero()) { if(r.isNumber()) { mgcd = gamma; } else { r.polynomialPrimpart(xvar, mgcd, eo); mgcd.calculateMultiply(gamma, eo); } return true; } c.lcoefficient(xvar, ri); if(delta.isOne()) { psi = ri; } else if(!delta.isZero()) { MathStructure ri_pow(ri); ri_pow.calculateRaise(delta, eo); MathStructure psi_pow(psi); delta--; psi_pow.calculateRaise(delta, eo); divide_in_z(ri_pow, psi_pow, psi, var + 1, eo); } delta = cdeg; delta -= ddeg; } return false; } Number MathStructure::maxCoefficient() { if(isNumber()) { Number nr(o_number); nr.abs(); return nr; } else if(isAddition()) { Number cur_max(overallCoefficient()); cur_max.abs(); for(size_t i = 0; i < SIZE; i++) { Number a(CHILD(i).overallCoefficient()); a.abs(); if(a.isGreaterThan(cur_max)) cur_max = a; } return cur_max; } else if(isMultiplication()) { Number nr(overallCoefficient()); nr.abs(); return nr; } else { return nr_one; } } void polynomial_smod(const MathStructure &mpoly, const Number &xi, MathStructure &msmod, const EvaluationOptions &eo, MathStructure *mparent, size_t index_smod) { if(mpoly.isNumber()) { msmod = mpoly; msmod.number().smod(xi); } else if(mpoly.isAddition()) { msmod.clear(); msmod.setType(STRUCT_ADDITION); msmod.resizeVector(mpoly.size(), m_zero); for(size_t i = 0; i < mpoly.size(); i++) { polynomial_smod(mpoly[i], xi, msmod[i], eo, &msmod, i); } msmod.calculatesub(eo, eo, false, mparent, index_smod); } else if(mpoly.isMultiplication()) { msmod = mpoly; if(msmod.size() > 0 && msmod[0].isNumber()) { if(!msmod[0].number().smod(xi) || msmod[0].isZero()) { msmod.clear(); } } } else { msmod = mpoly; } } void interpolate(const MathStructure &gamma, const Number &xi, const MathStructure &xvar, MathStructure &minterp, const EvaluationOptions &eo) { MathStructure e(gamma); Number rxi(xi); rxi.recip(); minterp.clear(); for(int i = 0; !e.isZero(); i++) { MathStructure gi; polynomial_smod(e, xi, gi, eo); if(minterp.isZero() && !gi.isZero()) { minterp = gi; if(i != 0) { if(minterp.isOne()) { minterp = xvar; if(i != 1) minterp.raise(i); } else { minterp.multiply(xvar, true); if(i != 1) minterp[minterp.size() - 1].raise(i); minterp.calculateMultiplyLast(eo); } } } else if(!gi.isZero()) { minterp.add(gi, true); if(i != 0) { if(minterp[minterp.size() - 1].isOne()) { minterp[minterp.size() - 1] = xvar; if(i != 1) minterp[minterp.size() - 1].raise(i); } else { minterp[minterp.size() - 1].multiply(xvar, true); if(i != 1) minterp[minterp.size() - 1][minterp[minterp.size() - 1].size() - 1].raise(i); minterp[minterp.size() - 1].calculateMultiplyLast(eo); } } } if(!gi.isZero()) e.calculateSubtract(gi, eo); e.calculateMultiply(rxi, eo); } minterp.calculatesub(eo, eo, false); } bool heur_gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mgcd, const EvaluationOptions &eo, MathStructure *ca, MathStructure *cb, sym_desc_vec::const_iterator var) { if (m1.isZero() || m2.isZero()) return false; if(m1.isNumber() && m2.isNumber()) { mgcd = m1; if(!mgcd.number().gcd(m2.number())) mgcd.set(1, 1); if(ca) { *ca = m1; ca->number() /= mgcd.number(); } if(cb) { *cb = m2; cb->number() /= mgcd.number(); } return true; } // std::cout << "HEUR 1 a: " << m1.print() << " b: " << m2.print() << std::endl; const MathStructure &xvar = var->sym; Number gc; integer_content(m1, gc); Number rgc; integer_content(m2, rgc); // std::cout << " ic1: " << gc.print() << " ic2: " << rgc.print() << std::endl; gc.gcd(rgc); rgc = gc; rgc.recip(); // std::cout << "HEUR gc: " << gc.print() << " rgc: " << rgc.print() << std::endl; MathStructure p(m1); p.calculateMultiply(rgc, eo); MathStructure q(m2); q.calculateMultiply(rgc, eo); Number maxdeg(p.degree(xvar)); Number maxdeg2(q.degree(xvar)); if(maxdeg2.isGreaterThan(maxdeg)) maxdeg = maxdeg2; Number mp(p.maxCoefficient()); Number mq(q.maxCoefficient()); Number xi; if(mp.isGreaterThan(mq)) { xi = mq; } else { xi = mp; } xi *= 2; xi += 2; // std::cout << "HEUR 2 xi: " << xi.print() << " p: " << p.print() << " q: " << q.print() << std::endl; for(int t = 0; t < 6; t++) { if((maxdeg * xi.integerLength()).isGreaterThan(100000)) { return false; } MathStructure cp, cq; MathStructure gamma; MathStructure psub(p); psub.calculateReplace(xvar, xi, eo); MathStructure qsub(q); qsub.calculateReplace(xvar, xi, eo); if(heur_gcd(psub, qsub, gamma, eo, &cp, &cq, var + 1)) { // std::cout << "HEUR 4-2 gamma: " << gamma.print() << " xi: " << xi.print() << std::endl; interpolate(gamma, xi, xvar, mgcd, eo); // std::cout << "HEUR 4-3 gamma: " << gamma.print() << " g: " << mgcd.print() << std::endl; Number ig; integer_content(mgcd, ig); ig.recip(); mgcd.calculateMultiply(ig, eo); // std::cout << "HEUR 3 g: " << mgcd.print() << " p: " << p.print() << std::endl; MathStructure dummy; if(divide_in_z(p, mgcd, ca ? *ca : dummy, var, eo) && divide_in_z(q, mgcd, cb ? *cb : dummy, var, eo)) { mgcd.calculateMultiply(gc, eo); return true; } } // std::cout << "xi: " << xi.print() << std::endl; Number xi2(xi); xi2.isqrt(); xi2.isqrt(); xi *= xi2; xi *= 73794; xi.iquo(27011); // std::cout << "xi: " << xi.print() << std::endl; } return false; } int MathStructure::polynomialUnit(const MathStructure &xvar) const { MathStructure coeff; lcoefficient(xvar, coeff); if(coeff.hasNegativeSign()) return -1; return 1; } void integer_content(const MathStructure &mpoly, Number &icontent) { if(mpoly.isNumber()) { icontent = mpoly.number(); icontent.abs(); } else if(mpoly.isAddition()) { icontent.clear(); Number l(1, 1); for(size_t i = 0; i < mpoly.size(); i++) { if(mpoly[i].isNumber()) { if(!icontent.isOne()) { Number c = icontent; icontent = mpoly[i].number().numerator(); icontent.gcd(c); } Number l2 = l; l = mpoly[i].number().denominator(); l.lcm(l2); } else if(mpoly[i].isMultiplication()) { if(!icontent.isOne()) { Number c = icontent; icontent = mpoly[i].overallCoefficient().numerator(); icontent.gcd(c); } Number l2 = l; l = mpoly[i].overallCoefficient().denominator(); l.lcm(l2); } else { icontent.set(1, 1); } } icontent /= l; } else if(mpoly.isMultiplication()) { icontent = mpoly.overallCoefficient(); icontent.abs(); } else { icontent.set(1, 1); } } bool MathStructure::lcm(const MathStructure &m1, const MathStructure &m2, MathStructure &mlcm, const EvaluationOptions &eo, bool check_args) { if(m1.isNumber() && m2.isNumber()) { mlcm = m1; return mlcm.number().lcm(m2.number()); } if(check_args && (!m1.isRationalPolynomial() || !m2.isRationalPolynomial())) { return false; } MathStructure ca, cb; MathStructure::gcd(m1, m2, mlcm, eo, &ca, &cb, false); mlcm.calculateMultiply(ca, eo); mlcm.calculateMultiply(cb, eo); return true; } void MathStructure::polynomialContent(const MathStructure &xvar, MathStructure &mcontent, const EvaluationOptions &eo) const { if(isZero()) { mcontent.clear(); return; } if(isNumber()) { mcontent = *this; mcontent.number().setNegative(false); return; } MathStructure c; integer_content(*this, c.number()); MathStructure r(*this); r.calculateDivide(c, eo); MathStructure lcoeff; r.lcoefficient(xvar, lcoeff); if(lcoeff.isInteger()) { mcontent = c; return; } Number deg(r.degree(xvar)); Number ldeg(r.ldegree(xvar)); if(deg == ldeg) { mcontent = lcoeff; if(lcoeff.polynomialUnit(xvar) == -1) { c.number().negate(); } mcontent.calculateMultiply(c, eo); return; } mcontent.clear(); MathStructure mtmp, coeff; for(Number i(ldeg); i.isLessThanOrEqualTo(deg); i++) { coefficient(xvar, i, coeff); mtmp = mcontent; MathStructure::gcd(coeff, mtmp, mcontent, eo, NULL, NULL, false); } mcontent.calculateMultiply(c, eo); } void MathStructure::polynomialPrimpart(const MathStructure &xvar, MathStructure &mprim, const EvaluationOptions &eo) const { if(isZero()) { mprim.clear(); return; } if(isNumber()) { mprim.set(1, 1); return; } MathStructure c; polynomialContent(xvar, c, eo); if(c.isZero()) { mprim.clear(); return; } bool b = (polynomialUnit(xvar) == -1); if(c.isNumber()) { if(b) c.number().negate(); mprim = *this; mprim.calculateDivide(c, eo); return; } if(b) c.calculateNegate(eo); MathStructure::polynomialQuotient(*this, c, xvar, mprim, eo, false); } void MathStructure::polynomialUnitContentPrimpart(const MathStructure &xvar, int &munit, MathStructure &mcontent, MathStructure &mprim, const EvaluationOptions &eo) const { if(isZero()) { munit = 1; mcontent.clear(); mprim.clear(); return; } if(isNumber()) { if(o_number.isNegative()) { munit = -1; mcontent = *this; mcontent.number().abs(); } else { munit = 1; mcontent = *this; } mprim.set(1, 1); return; } munit = polynomialUnit(xvar); polynomialContent(xvar, mcontent, eo); if(mcontent.isZero()) { mprim.clear(); return; } if(mcontent.isNumber()) { mprim = *this; if(munit == -1) { Number c(mcontent.number()); c.negate(); mprim.calculateDivide(c, eo); } else { mprim.calculateDivide(mcontent, eo); } return; } if(munit == -1) { MathStructure c(mcontent); c.calculateNegate(eo); MathStructure::polynomialQuotient(*this, c, xvar, mprim, eo, false); } else { MathStructure::polynomialQuotient(*this, mcontent, xvar, mprim, eo, false); } } void MathStructure::polynomialPrimpart(const MathStructure &xvar, const MathStructure &c, MathStructure &mprim, const EvaluationOptions &eo) const { if(isZero() || c.isZero()) { mprim.clear(); return; } if(isNumber()) { mprim.set(1, 1); return; } bool b = (polynomialUnit(xvar) == -1); if(c.isNumber()) { MathStructure cn(c); if(b) cn.number().negate(); mprim = *this; mprim.calculateDivide(cn, eo); return; } if(b) { MathStructure cn(c); cn.calculateNegate(eo); MathStructure::polynomialQuotient(*this, cn, xvar, mprim, eo, false); } else { MathStructure::polynomialQuotient(*this, c, xvar, mprim, eo, false); } } const Number& MathStructure::degree(const MathStructure &xvar) const { const Number *c = NULL; const MathStructure *mcur = NULL; for(size_t i = 0; ; i++) { if(isAddition()) { if(i >= SIZE) break; mcur = &CHILD(i); } else { mcur = this; } if((*mcur) == xvar) { if(!c) { c = &nr_one; } } else if(mcur->isPower() && (*mcur)[0] == xvar && (*mcur)[1].isNumber()) { if(!c || c->isLessThan((*mcur)[1].number())) { c = &(*mcur)[1].number(); } } else if(mcur->isMultiplication()) { for(size_t i2 = 0; i2 < mcur->size(); i2++) { if((*mcur)[i2] == xvar) { if(!c) { c = &nr_one; } } else if((*mcur)[i2].isPower() && (*mcur)[i2][0] == xvar && (*mcur)[i2][1].isNumber()) { if(!c || c->isLessThan((*mcur)[i2][1].number())) { c = &(*mcur)[i2][1].number(); } } } } if(!isAddition()) break; } if(!c) return nr_zero; return *c; } const Number& MathStructure::ldegree(const MathStructure &xvar) const { const Number *c = NULL; const MathStructure *mcur = NULL; for(size_t i = 0; ; i++) { if(isAddition()) { if(i >= SIZE) break; mcur = &CHILD(i); } else { mcur = this; } if((*mcur) == xvar) { c = &nr_one; } else if(mcur->isPower() && (*mcur)[0] == xvar && (*mcur)[1].isNumber()) { if(!c || c->isGreaterThan((*mcur)[1].number())) { c = &(*mcur)[1].number(); } } else if(mcur->isMultiplication()) { bool b = false; for(size_t i2 = 0; i2 < mcur->size(); i2++) { if((*mcur)[i2] == xvar) { c = &nr_one; b = true; } else if((*mcur)[i2].isPower() && (*mcur)[i2][0] == xvar && (*mcur)[i2][1].isNumber()) { if(!c || c->isGreaterThan((*mcur)[i2][1].number())) { c = &(*mcur)[i2][1].number(); } b = true; } } if(!b) return nr_zero; } else { return nr_zero; } if(!isAddition()) break; } if(!c) return nr_zero; return *c; } void MathStructure::lcoefficient(const MathStructure &xvar, MathStructure &mcoeff) const { coefficient(xvar, degree(xvar), mcoeff); } void MathStructure::tcoefficient(const MathStructure &xvar, MathStructure &mcoeff) const { coefficient(xvar, ldegree(xvar), mcoeff); } void MathStructure::coefficient(const MathStructure &xvar, const Number &pownr, MathStructure &mcoeff) const { const MathStructure *mcur = NULL; mcoeff.clear(); for(size_t i = 0; ; i++) { if(isAddition()) { if(i >= SIZE) break; mcur = &CHILD(i); } else { mcur = this; } if((*mcur) == xvar) { if(pownr.isOne()) { if(mcoeff.isZero()) mcoeff.set(1, 1); else mcoeff.add(m_one, true); } } else if(mcur->isPower() && (*mcur)[0] == xvar && (*mcur)[1].isNumber()) { if((*mcur)[1].number() == pownr) { if(mcoeff.isZero()) mcoeff.set(1, 1); else mcoeff.add(m_one, true); } } else if(mcur->isMultiplication()) { bool b = false; for(size_t i2 = 0; i2 < mcur->size(); i2++) { bool b2 = false; if((*mcur)[i2] == xvar) { b = true; if(pownr.isOne()) b2 = true; } else if((*mcur)[i2].isPower() && (*mcur)[i2][0] == xvar && (*mcur)[i2][1].isNumber()) { b = true; if((*mcur)[i2][1].number() == pownr) b2 = true; } if(b2) { if(mcoeff.isZero()) { for(size_t i3 = 0; i3 < mcur->size(); i3++) { if(i3 != i2) { if(mcoeff.isZero()) mcoeff = (*mcur)[i3]; else mcoeff.multiply((*mcur)[i3], true); } } } else { mcoeff.add(m_zero, true); for(size_t i3 = 0; i3 < mcur->size(); i3++) { if(i3 != i2) { if(mcoeff[mcoeff.size() - 1].isZero()) mcoeff[mcoeff.size() - 1] = (*mcur)[i3]; else mcoeff[mcoeff.size() - 1].multiply((*mcur)[i3], true); } } } break; } } if(!b && pownr.isZero()) { if(mcoeff.isZero()) mcoeff = *mcur; else mcoeff.add(*mcur, true); } } else if(pownr.isZero()) { if(mcoeff.isZero()) mcoeff = *mcur; else mcoeff.add(*mcur, true); } if(!isAddition()) break; } mcoeff.evalSort(); } bool MathStructure::polynomialQuotient(const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args) { mquotient.clear(); if(mden.isZero()) { //division by zero return false; } if(mnum.isZero()) { mquotient.clear(); return true; } if(mden.isNumber() && mnum.isNumber()) { mquotient = mnum; if(IS_REAL(mden) && IS_REAL(mnum)) { mquotient.number() /= mden.number(); } else { mquotient.calculateDivide(mden, eo); } return true; } if(mnum == mden) { mquotient.set(1, 1); return true; } if(check_args && (!mnum.isRationalPolynomial() || !mden.isRationalPolynomial())) { return false; } Number numdeg = mnum.degree(xvar); Number dendeg = mden.degree(xvar); MathStructure dencoeff; mden.coefficient(xvar, dendeg, dencoeff); MathStructure mrem(mnum); while(numdeg.isGreaterThanOrEqualTo(dendeg)) { MathStructure numcoeff; mrem.coefficient(xvar, numdeg, numcoeff); numdeg -= dendeg; if(numcoeff == dencoeff) { if(numdeg.isZero()) { numcoeff.set(1, 1); } else { numcoeff = xvar; if(!numdeg.isOne()) { numcoeff.raise(numdeg); } } } else { if(dencoeff.isNumber()) { if(numcoeff.isNumber()) { numcoeff.number() /= dencoeff.number(); } else { numcoeff.calculateDivide(dencoeff, eo); } } else { MathStructure mcopy(numcoeff); if(!MathStructure::polynomialDivide(mcopy, dencoeff, numcoeff, eo, false)) { return false; } } if(!numdeg.isZero() && !numcoeff.isZero()) { if(numcoeff.isOne()) { numcoeff = xvar; if(!numdeg.isOne()) { numcoeff.raise(numdeg); } } else { numcoeff.multiply(xvar, true); if(!numdeg.isOne()) { numcoeff[numcoeff.size() - 1].raise(numdeg); } numcoeff.calculateMultiplyLast(eo); } } } if(mquotient.isZero()) mquotient = numcoeff; else mquotient.calculateAdd(numcoeff, eo); numcoeff.calculateMultiply(mden, eo); mrem.calculateSubtract(numcoeff, eo); if(mrem.isZero()) break; numdeg = mrem.degree(xvar); } return true; } void add_symbol(const MathStructure &mpoly, sym_desc_vec &v) { sym_desc_vec::const_iterator it = v.begin(), itend = v.end(); while (it != itend) { if(it->sym == mpoly) return; ++it; } sym_desc d; d.sym = mpoly; v.push_back(d); } void collect_symbols(const MathStructure &mpoly, sym_desc_vec &v) { if(IS_A_SYMBOL(mpoly) || mpoly.isUnit()) { add_symbol(mpoly, v); } else if(mpoly.isAddition() || mpoly.isMultiplication()) { for(size_t i = 0; i < mpoly.size(); i++) collect_symbols(mpoly[i], v); } else if(mpoly.isPower()) { collect_symbols(mpoly[0], v); } } void add_symbol(const MathStructure &mpoly, vector &v) { vector::const_iterator it = v.begin(), itend = v.end(); while (it != itend) { if(*it == mpoly) return; ++it; } v.push_back(mpoly); } void collect_symbols(const MathStructure &mpoly, vector &v) { if(IS_A_SYMBOL(mpoly)) { add_symbol(mpoly, v); } else if(mpoly.isAddition() || mpoly.isMultiplication()) { for(size_t i = 0; i < mpoly.size(); i++) collect_symbols(mpoly[i], v); } else if(mpoly.isPower()) { collect_symbols(mpoly[0], v); } } void get_symbol_stats(const MathStructure &m1, const MathStructure &m2, sym_desc_vec &v) { collect_symbols(m1, v); collect_symbols(m2, v); sym_desc_vec::iterator it = v.begin(), itend = v.end(); while (it != itend) { it->deg_a = m1.degree(it->sym); it->deg_b = m2.degree(it->sym); if(it->deg_a.isGreaterThan(it->deg_b)) { it->max_deg = it->deg_a; } else { it->max_deg = it->deg_b; } it->ldeg_a = m1.ldegree(it->sym); it->ldeg_b = m2.ldegree(it->sym); MathStructure mcoeff; m1.lcoefficient(it->sym, mcoeff); it->max_lcnops = mcoeff.size(); m2.lcoefficient(it->sym, mcoeff); if(mcoeff.size() > it->max_lcnops) it->max_lcnops = mcoeff.size(); ++it; } std::sort(v.begin(), v.end()); } bool MathStructure::gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mresult, const EvaluationOptions &eo, MathStructure *ca, MathStructure *cb, bool check_args) { if(m1.isOne() || m2.isOne()) { if(ca) *ca = m1; if(cb) *cb = m2; mresult.set(1, 1); return true; } if(m1.isNumber() && m2.isNumber()) { mresult = m1; if(!mresult.number().gcd(m2.number())) mresult.set(1, 1); if(ca || cb) { if(mresult.isZero()) { if(ca) ca->clear(); if(cb) cb->clear(); } else { if(ca) { *ca = m1; ca->number() /= mresult.number(); } if(cb) { *cb = m2; cb->number() /= mresult.number(); } } } return true; } if(m1 == m2) { if(ca) ca->set(1, 1); if(cb) cb->set(1, 1); mresult = m1; return true; } if(m1.isZero()) { if(ca) ca->clear(); if(cb) cb->set(1, 0); mresult = m2; return true; } if(m2.isZero()) { if(ca) ca->set(1, 0); if(cb) cb->clear(); mresult = m1; return true; } if(check_args && (!m1.isRationalPolynomial() || !m2.isRationalPolynomial())) { return false; } if(m1.isMultiplication()) { if(m2.isMultiplication() && m2.size() > m1.size()) goto factored_2; factored_1: mresult.clear(); mresult.setType(STRUCT_MULTIPLICATION); MathStructure acc_ca; acc_ca.setType(STRUCT_MULTIPLICATION); MathStructure part_2(m2); MathStructure part_ca, part_cb; for (size_t i = 0; i < m1.size(); i++) { mresult.addChild(m_zero); MathStructure::gcd(m1[i], part_2, mresult[i], eo, &part_ca, &part_cb, false); acc_ca.addChild(part_ca); part_2 = part_cb; } mresult.calculatesub(eo, eo, false); if(ca) { *ca = acc_ca; ca->calculatesub(eo, eo, false); } if(cb) *cb = part_2; return true; } else if(m2.isMultiplication()) { if(m1.isMultiplication() && m1.size() > m2.size()) goto factored_1; factored_2: mresult.clear(); mresult.setType(STRUCT_MULTIPLICATION); MathStructure acc_cb; acc_cb.setType(STRUCT_MULTIPLICATION); MathStructure part_1(m1); MathStructure part_ca, part_cb; for(size_t i = 0; i < m2.size(); i++) { mresult.addChild(m_zero); MathStructure::gcd(part_1, m2[i], mresult[i], eo, &part_ca, &part_cb, false); acc_cb.addChild(part_cb); part_1 = part_ca; } mresult.calculatesub(eo, eo, false); if(ca) *ca = part_1; if(cb) { *cb = acc_cb; cb->calculatesub(eo, eo, false); } return true; } if(m1.isPower()) { MathStructure p(m1[0]); if(m2.isPower()) { if(m1[0] == m2[0]) { if(m1[1].number().isLessThan(m2[1].number())) { if(ca) ca->set(1, 1); if(cb) { *cb = m2; (*cb)[1].number() -= m1[1].number(); POWER_CLEAN((*cb)) } mresult = m1; return true; } else { if(ca) { *ca = m1; (*ca)[1].number() -= m2[1].number(); POWER_CLEAN((*ca)) } if(cb) cb->set(1, 1); mresult = m2; return true; } } else { MathStructure p_co, pb_co; MathStructure p_gcd; if(!MathStructure::gcd(m1[0], m2[0], p_gcd, eo, &p_co, &pb_co, false)) return false; if(p_gcd.isOne()) { if(ca) *ca = m1; if(cb) *cb = m2; mresult.set(1, 1); return true; } else { if(m1[1].number().isLessThan(m2[1].number())) { mresult = p_gcd; mresult.calculateRaise(m1[1], eo); mresult.multiply(m_zero, true); p_co.calculateRaise(m1[1], eo); pb_co.calculateRaise(m2[1], eo); p_gcd.raise(m2[1]); p_gcd[1].number() -= m1[1].number(); p_gcd.calculateRaiseExponent(eo); p_gcd.calculateMultiply(pb_co, eo); bool b = MathStructure::gcd(p_co, p_gcd, mresult[mresult.size() - 1], eo, ca, cb, false); mresult.calculateMultiplyLast(eo); return b; } else { mresult = p_gcd; mresult.calculateRaise(m2[1], eo); mresult.multiply(m_zero, true); p_co.calculateRaise(m1[1], eo); pb_co.calculateRaise(m2[1], eo); p_gcd.raise(m1[1]); p_gcd[1].number() -= m2[1].number(); p_gcd.calculateRaiseExponent(eo); p_gcd.calculateMultiply(p_co, eo); bool b = MathStructure::gcd(p_gcd, pb_co, mresult[mresult.size() - 1], eo, ca, cb, false); mresult.calculateMultiplyLast(eo); return b; } } } } else { if(m1[0] == m2) { if(ca) { *ca = m1; (*ca)[1].number()--; POWER_CLEAN((*ca)) } if(cb) cb->set(1, 1); mresult = m2; return true; } MathStructure p_co, bpart_co; MathStructure p_gcd; if(!MathStructure::gcd(m1[0], m2, p_gcd, eo, &p_co, &bpart_co, false)) return false; if(p_gcd.isOne()) { if(ca) *ca = m1; if(cb) *cb = m2; mresult.set(1, 1); return true; } else { mresult = p_gcd; mresult.multiply(m_zero, true); p_co.calculateRaise(m1[1], eo); p_gcd.raise(m1[1]); p_gcd[1].number()--; p_gcd.calculateRaiseExponent(eo); p_gcd.calculateMultiply(p_co, eo); bool b = MathStructure::gcd(p_gcd, bpart_co, mresult[mresult.size() - 1], eo, ca, cb, false); mresult.calculateMultiplyLast(eo); return b; } } } else if(m2.isPower()) { if(m2[0] == m1) { if(ca) ca->set(1, 1); if(cb) { *cb = m2; (*cb)[1].number()--; POWER_CLEAN((*cb)) } mresult = m1; return true; } MathStructure p_co, apart_co; MathStructure p_gcd; if(!MathStructure::gcd(m1, m2[0], p_gcd, eo, &apart_co, &p_co, false)) return false; if(p_gcd.isOne()) { if(ca) *ca = m1; if(cb) *cb = m2; mresult.set(1, 1); return true; } else { mresult = p_gcd; mresult.multiply(m_zero, true); p_co.calculateRaise(m2[1], eo); p_gcd.raise(m2[1]); p_gcd[1].number()--; p_gcd.calculateRaiseExponent(eo); p_gcd.calculateMultiply(p_co, eo); bool b = MathStructure::gcd(apart_co, p_gcd, mresult[mresult.size() - 1], eo, ca, cb, false); mresult.calculateMultiplyLast(eo); return b; } } if(IS_A_SYMBOL(m1) || m1.isUnit()) { MathStructure bex(m2); bex.calculateReplace(m1, m_zero, eo); if(!bex.isZero()) { if(ca) *ca = m1; if(cb) *cb = m2; mresult.set(1, 1); return true; } } if(IS_A_SYMBOL(m2) || m2.isUnit()) { MathStructure aex(m1); aex.calculateReplace(m2, m_zero, eo); if(!aex.isZero()) { if(ca) *ca = m1; if(cb) *cb = m2; mresult.set(1, 1); return true; } } sym_desc_vec sym_stats; get_symbol_stats(m1, m2, sym_stats); sym_desc_vec::const_iterator var = sym_stats.begin(); const MathStructure &xvar = var->sym; Number ldeg_a(var->ldeg_a); Number ldeg_b(var->ldeg_b); Number min_ldeg; if(ldeg_a.isLessThan(ldeg_b)) { min_ldeg = ldeg_a; } else { min_ldeg = ldeg_b; } if(min_ldeg.isPositive()) { MathStructure aex(m1), bex(m2); MathStructure common(xvar); if(!min_ldeg.isOne()) common.raise(min_ldeg); aex.calculateDivide(common, eo); bex.calculateDivide(common, eo); MathStructure::gcd(aex, bex, mresult, eo, ca, cb, false); mresult.calculateMultiply(common, eo); return true; } if(var->deg_a.isZero()) { if(cb) { MathStructure c, mprim; int u; m2.polynomialUnitContentPrimpart(xvar, u, c, mprim, eo); MathStructure::gcd(m1, c, mresult, eo, ca, cb, false); if(u == -1) { cb->calculateNegate(eo); } cb->calculateMultiply(mprim, eo); } else { MathStructure c; m2.polynomialContent(xvar, c, eo); MathStructure::gcd(m1, c, mresult, eo, ca, cb, false); } return true; } else if(var->deg_b.isZero()) { if(ca) { MathStructure c, mprim; int u; m1.polynomialUnitContentPrimpart(xvar, u, c, mprim, eo); MathStructure::gcd(c, m2, mresult, eo, ca, cb, false); if(u == -1) { ca->calculateNegate(eo); } ca->calculateMultiply(mprim, eo); } else { MathStructure c; m1.polynomialContent(xvar, c, eo); MathStructure::gcd(c, m2, mresult, eo, ca, cb, false); } return true; } if(!heur_gcd(m1, m2, mresult, eo, ca, cb, var)) { sr_gcd(m1, m2, mresult, var, eo); if(mresult.isOne()) { if(ca) *ca = m1; if(cb) *cb = m2; } else { if(ca) { MathStructure::polynomialDivide(m1, mresult, *ca, eo, false); } if(cb) { MathStructure::polynomialDivide(m2, mresult, *cb, eo, false); } } } else { if(mresult.isOne()) { if(ca) *ca = m1; if(cb) *cb = m2; } } return true; } bool sqrfree_differentiate(const MathStructure &mpoly, const MathStructure &x_var, MathStructure &mdiff, const EvaluationOptions &eo) { if(mpoly == x_var) { mdiff.set(1, 1); return true; } switch(mpoly.type()) { case STRUCT_ADDITION: { mdiff.clear(); mdiff.setType(STRUCT_ADDITION); for(size_t i = 0; i < mpoly.size(); i++) { mdiff.addChild(m_zero); if(!sqrfree_differentiate(mpoly[i], x_var, mdiff[i], eo)) return false; } mdiff.calculatesub(eo, eo, false); break; } case STRUCT_VARIABLE: {} case STRUCT_FUNCTION: {} case STRUCT_SYMBOLIC: {} case STRUCT_UNIT: {} case STRUCT_NUMBER: { mdiff.clear(); break; } case STRUCT_POWER: { if(mpoly[0] == x_var) { mdiff = mpoly[1]; mdiff.multiply(x_var); if(!mpoly[1].number().isTwo()) { mdiff[1].raise(mpoly[1]); mdiff[1][1].number()--; } mdiff.evalSort(true); } else { mdiff.clear(); } break; } case STRUCT_MULTIPLICATION: { if(mpoly.size() < 1) { mdiff.clear(); break; } else if(mpoly.size() < 2) { return sqrfree_differentiate(mpoly[0], x_var, mdiff, eo); } mdiff.clear(); for(size_t i = 0; i < mpoly.size(); i++) { if(mpoly[i] == x_var) { if(mpoly.size() == 2) { if(i == 0) mdiff = mpoly[1]; else mdiff = mpoly[0]; } else { mdiff.setType(STRUCT_MULTIPLICATION); for(size_t i2 = 0; i2 < mpoly.size(); i2++) { if(i2 != i) { mdiff.addChild(mpoly[i2]); } } } break; } else if(mpoly[i].isPower() && mpoly[i][0] == x_var) { mdiff = mpoly; if(mpoly[i][1].number().isTwo()) { mdiff[i].setToChild(1); } else { mdiff[i][1].number()--; } if(mdiff[0].isNumber()) { mdiff[0].number() *= mpoly[i][1].number(); } else { mdiff.insertChild(mpoly[i][1].number(), 1); } mdiff.evalSort(); break; } } break; } default: { return false; } } return true; } bool sqrfree_yun(const MathStructure &a, const MathStructure &xvar, MathStructure &factors, const EvaluationOptions &eo) { factors.clearVector(); // std::cout << "A: " << a.print() << std::endl; MathStructure w(a); MathStructure z; if(!sqrfree_differentiate(a, xvar, z, eo)) { // printf("A Failed\n"); return false; } // std::cout << "Z: " << z.print() << std::endl; MathStructure g; if(!MathStructure::gcd(w, z, g, eo)) { // printf("B Failed\n"); return false; } // std::cout << "G: " << g.print() << std::endl; if(g.isOne()) { factors.addChild(a); return true; } MathStructure y; MathStructure tmp; do { tmp = w; if(!MathStructure::polynomialQuotient(tmp, g, xvar, w, eo)) { // printf("D Failed\n"); return false; } // std::cout << "W2: " << w.print() << std::endl; if(!MathStructure::polynomialQuotient(z, g, xvar, y, eo)) { // printf("E Failed\n"); return false; } // std::cout << "Y2: " << y.print() << std::endl; if(!sqrfree_differentiate(w, xvar, tmp, eo)) { // printf("F Failed\n"); return false; } z = y; // std::cout << "Z3: " << z.print() << std::endl; // std::cout << "TMP: " << tmp.print() << std::endl; z.calculateSubtract(tmp, eo); // std::cout << "Z2: " << z.print() << std::endl; if(!MathStructure::gcd(w, z, g, eo)) { // printf("H Failed\n"); return false; } // std::cout << "G2: " << g.print() << std::endl; factors.addChild(g); } while (!z.isZero()); return true; } void lcmcoeff(const MathStructure &e, const Number &l, Number &nlcm); void lcmcoeff(const MathStructure &e, const Number &l, Number &nlcm) { if(e.isNumber() && e.number().isRational()) { nlcm = e.number().denominator(); nlcm.lcm(l); } else if(e.isAddition()) { nlcm.set(1, 1); for(size_t i = 0; i < e.size(); i++) { Number c(nlcm); lcmcoeff(e[i], c, nlcm); } nlcm.lcm(l); } else if(e.isMultiplication()) { nlcm.set(1, 1); for(size_t i = 0; i < e.size(); i++) { Number c(nlcm); lcmcoeff(e[i], nr_one, c); nlcm *= c; } nlcm.lcm(l); } else if(e.isPower()) { if(IS_A_SYMBOL(e[0]) || e[0].isUnit()) { nlcm = l; } else { lcmcoeff(e[0], l, nlcm); nlcm ^= e[1].number(); } } else { nlcm = l; } } void lcm_of_coefficients_denominators(const MathStructure &e, Number &nlcm) { return lcmcoeff(e, nr_one, nlcm); } void multiply_lcm(const MathStructure &e, const Number &lcm, MathStructure &mmul, const EvaluationOptions &eo); void multiply_lcm(const MathStructure &e, const Number &lcm, MathStructure &mmul, const EvaluationOptions &eo) { if(e.isMultiplication()) { Number lcm_accum(1, 1); mmul.clear(); for(size_t i = 0; i < e.size(); i++) { Number op_lcm; lcmcoeff(e[i], nr_one, op_lcm); if(mmul.isZero()) { multiply_lcm(e[i], op_lcm, mmul, eo); if(mmul.isOne()) mmul.clear(); } else { mmul.multiply(m_one, true); multiply_lcm(e[i], op_lcm, mmul[mmul.size() - 1], eo); if(mmul[mmul.size() - 1].isOne()) { mmul.delChild(i + 1); if(mmul.size() == 1) mmul.setToChild(1); } } lcm_accum *= op_lcm; } Number lcm2(lcm); lcm2 /= lcm_accum; if(mmul.isZero()) { mmul = lcm2; } else if(!lcm2.isOne()) { if(mmul.size() > 0 && mmul[0].isNumber()) { mmul[0].number() *= lcm2; } else { mmul.multiply(lcm2, true); } } mmul.evalSort(); } else if(e.isAddition()) { mmul.clear(); for (size_t i = 0; i < e.size(); i++) { if(mmul.isZero()) { multiply_lcm(e[i], lcm, mmul, eo); } else { mmul.add(m_zero, true); multiply_lcm(e[i], lcm, mmul[mmul.size() - 1], eo); } } mmul.evalSort(); } else if(e.isPower()) { if(IS_A_SYMBOL(e[0]) || e[0].isUnit()) { mmul = e; if(!lcm.isOne()) { mmul *= lcm; mmul.evalSort(); } } else { mmul = e; Number lcm_exp = e[1].number(); lcm_exp.recip(); multiply_lcm(e[0], lcm ^ lcm_exp, mmul[0], eo); if(mmul[0] != e[0]) { mmul.calculatesub(eo, eo, false); } } } else if(e.isNumber()) { mmul = e; mmul.number() *= lcm; } else if(IS_A_SYMBOL(e) || e.isUnit()) { mmul = e; if(!lcm.isOne()) { mmul *= lcm; mmul.evalSort(); } } else { mmul = e; if(!lcm.isOne()) { mmul.calculateMultiply(lcm, eo); mmul.evalSort(); } } } //from GiNaC void sqrfree(MathStructure &mpoly, const vector &symbols, const EvaluationOptions &eo); void sqrfree(MathStructure &mpoly, const EvaluationOptions &eo) { vector symbols; collect_symbols(mpoly, symbols); sqrfree(mpoly, symbols, eo); } void sqrfree(MathStructure &mpoly, const vector &symbols, const EvaluationOptions &eo) { EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = true; eo2.warn_about_denominators_assumed_nonzero = false; eo2.reduce_divisions = true; eo2.keep_zero_units = false; eo2.expand = true; if(mpoly.size() == 0) { return; } if(symbols.empty()) return; const MathStructure &xvar = symbols[0]; Number nlcm; lcm_of_coefficients_denominators(mpoly, nlcm); MathStructure tmp; multiply_lcm(mpoly, nlcm, tmp, eo2); MathStructure factors; if(!sqrfree_yun(tmp, xvar, factors, eo2)) { factors.clearVector(); factors.addChild(tmp); } vector newsymbols; for(size_t i = 1; i < symbols.size(); i++) { newsymbols.push_back(symbols[i]); } if(newsymbols.size() > 0) { for(size_t i = 0; i < factors.size(); i++) { sqrfree(factors[i], newsymbols, eo); } } mpoly.set(1, 1); for(size_t i = 0; i < factors.size(); i++) { if(!factors[i].isOne()) { if(mpoly.isOne()) { mpoly = factors[i]; if(i != 0) mpoly.raise(MathStructure(i + 1, 1)); } else { mpoly.multiply(factors[i], true); mpoly[mpoly.size() - 1].raise(MathStructure(i + 1, 1)); } } } if(mpoly.isZero()) { CALCULATOR->error(true, "mpoly is zero: %s. %s", tmp.print().c_str(), _("This is a bug. Please report it."), NULL); return; } MathStructure mquo; MathStructure mpoly_expand(mpoly); EvaluationOptions eo3 = eo; eo3.expand = true; mpoly_expand.calculatesub(eo3, eo3); MathStructure::polynomialQuotient(tmp, mpoly_expand, xvar, mquo, eo2); if(mquo.isZero()) { CALCULATOR->error(true, "quo is zero: %s. %s", tmp.print().c_str(), _("This is a bug. Please report it."), NULL); return; } if(newsymbols.size() > 0) { sqrfree(mquo, newsymbols, eo); } if(!mquo.isOne()) { mpoly.multiply(mquo, true); } if(!nlcm.isOne()) { nlcm.recip(); mpoly.multiply(nlcm, true); } eo3.expand = false; mpoly.calculatesub(eo3, eo3, false); } bool MathStructure::integerFactorize() { if(!isNumber()) return false; vector factors; if(!o_number.factorize(factors)) return false; if(factors.size() == 1) return true; clear(true); bool b_pow = false; Number *lastnr = NULL; for(size_t i = 0; i < factors.size(); i++) { if(lastnr && factors[i] == *lastnr) { if(!b_pow) { LAST.raise(m_one); b_pow = true; } LAST[1].number()++; } else { APPEND(factors[i]); } lastnr = &factors[i]; } m_type = STRUCT_MULTIPLICATION; return true; } bool MathStructure::factorize(const EvaluationOptions &eo) { MathStructure mden, mnum; if(containsDivision() && factor1(*this, mnum, mden, eo)) { set_nocopy(mnum); if(!mden.isOne()) { MathStructure *mnew = new MathStructure(); mnew->set_nocopy(mden); divide_nocopy(mnew); } return true; } evalSort(true); if(isAddition() && isRationalPolynomial()) { MathStructure mcopy(*this); sqrfree(*this, eo); if(!equals(mcopy)) { MathStructure mcopy2(*this); EvaluationOptions eo2 = eo; eo2.expand = true; mcopy2.calculatesub(eo2, eo2); if(mcopy != mcopy2) { /*for(size_t i = 0; i < mcopy.size(); i++) { std::cout << "MCOPY " << i << ": " << mcopy[i].print() << std::endl; for(size_t i2 = 0; i2 < mcopy[i].size(); i2++) { std::cout << "MCOPY " << i << "-" << i2 << ": " << mcopy[i][i2].print() << std::endl; } } for(size_t i = 0; i < mcopy2.size(); i++) { std::cout << "MCOPY2 " << i << ": " << mcopy2[i].print() << std::endl; for(size_t i2 = 0; i2 < mcopy2[i].size(); i2++) { std::cout << "MCOPY2 " << i << "-" << i2 << ": " << mcopy2[i][i2].print() << std::endl; } } std::cout << "WRONG! this: " << print() << " copy: " << mcopy.print() << " copy2: " << mcopy2.print() << std::endl;*/ CALCULATOR->error(true, "factorized result is wrong: %s. %s", mcopy.print().c_str(), _("This is a bug. Please report it."), NULL); set(mcopy); } } if(!isAddition()) { factorize(eo); return true; } } switch(type()) { case STRUCT_ADDITION: { if(SIZE <= 3 && SIZE > 1) { MathStructure *xvar = NULL; Number nr2(1, 1); if(CHILD(0).isPower() && CHILD(0)[0].size() == 0 && CHILD(0)[1].isNumber() && CHILD(0)[1].number().isTwo()) { xvar = &CHILD(0)[0]; } else if(CHILD(0).isMultiplication() && CHILD(0).size() == 2 && CHILD(0)[0].isNumber()) { if(CHILD(0)[1].isPower()) { if(CHILD(0)[1][0].size() == 0 && CHILD(0)[1][1].isNumber() && CHILD(0)[1][1].number().isTwo()) { xvar = &CHILD(0)[1][0]; nr2.set(CHILD(0)[0].number()); } } } if(xvar) { bool factorable = false; Number nr1, nr0; if(SIZE == 2 && CHILD(1).isNumber()) { factorable = true; nr0 = CHILD(1).number(); } else if(SIZE == 3 && CHILD(2).isNumber()) { nr0 = CHILD(2).number(); if(CHILD(1).isMultiplication()) { if(CHILD(1).size() == 2 && CHILD(1)[0].isNumber() && xvar->equals(CHILD(1)[1])) { nr1 = CHILD(1)[0].number(); factorable = true; } } else if(xvar->equals(CHILD(1))) { nr1.set(1, 1); factorable = true; } } if(factorable) { Number nr4ac(4, 1); nr4ac *= nr2; nr4ac *= nr0; Number nrtwo(2, 1); Number nr2a(2, 1); nr2a *= nr2; Number sqrtb24ac(nr1); sqrtb24ac.raise(nrtwo); sqrtb24ac -= nr4ac; /*if(sqrtb24ac.isNegative()) { factorable = false; } MathStructure mstructb24(sqrtb24ac); if(factorable) { nrtwo.set(1, 2); mstructb24.number().raise(nrtwo); if(!sqrtb24ac.isApproximate() && mstructb24.number().isApproximate()) { factorable = false; } } if(factorable) {*/ if(!sqrtb24ac.isNegative()) { nrtwo.set(1, 2); MathStructure mstructb24(sqrtb24ac); if(eo.approximation == APPROXIMATION_EXACT && !sqrtb24ac.isApproximate()) { sqrtb24ac.raise(nrtwo); if(sqrtb24ac.isApproximate()) { mstructb24.raise(nrtwo); } else { mstructb24.set(sqrtb24ac); } } else { mstructb24.number().raise(nrtwo); } MathStructure m1(nr1), m2(nr1); Number mul1(1, 1), mul2(1, 1); if(mstructb24.isNumber()) { m1.number() += mstructb24.number(); m1.number() /= nr2a; if(m1.number().isRational() && !m1.number().isInteger()) { mul1 = m1.number().denominator(); m1.number() *= mul1; } m2.number() -= mstructb24.number(); m2.number() /= nr2a; if(m2.number().isRational() && !m2.number().isInteger()) { mul2 = m2.number().denominator(); m2.number() *= mul2; } } else { m1.calculateAdd(mstructb24, eo); m1.calculateDivide(nr2a, eo); if(m1.isNumber()) { if(m1.number().isRational() && !m1.number().isInteger()) { mul1 = m1.number().denominator(); m1.number() *= mul1; } } else { bool bint = false, bfrac = false; idm1(m1, bfrac, bint); if(bfrac) { idm2(m1, bfrac, bint, mul1); idm3(m1, mul1, true); } } m2.calculateSubtract(mstructb24, eo); m2.calculateDivide(nr2a, eo); if(m2.isNumber()) { if(m2.number().isRational() && !m2.number().isInteger()) { mul2 = m2.number().denominator(); m2.number() *= mul2; } } else { bool bint = false, bfrac = false; idm1(m2, bfrac, bint); if(bfrac) { idm2(m2, bfrac, bint, mul2); idm3(m2, mul2, true); } } } nr2 /= mul1; nr2 /= mul2; if(m1 == m2 && mul1 == mul2) { MathStructure xvar2(*xvar); if(!mul1.isOne()) xvar2 *= mul1; set(m1); add(xvar2, true); raise(MathStructure(2, 1)); if(!nr2.isOne()) { multiply(nr2); } } else { m1.add(*xvar, true); if(!mul1.isOne()) m1[m1.size() - 1] *= mul1; m2.add(*xvar, true); if(!mul2.isOne()) m2[m2.size() - 1] *= mul2; clear(true); m_type = STRUCT_MULTIPLICATION; if(!nr2.isOne()) { APPEND_NEW(nr2); } APPEND(m1); APPEND(m2); } EvaluationOptions eo2 = eo; eo2.expand = false; calculatesub(eo2, eo2, false); return true; } } } } MathStructure *factor_mstruct = new MathStructure(1, 1); MathStructure mnew; if(factorize_find_multiplier(*this, mnew, *factor_mstruct)) { mnew.factorize(eo); clear(true); m_type = STRUCT_MULTIPLICATION; APPEND_REF(factor_mstruct); APPEND(mnew); EvaluationOptions eo2 = eo; eo2.expand = false; calculatesub(eo2, eo2, false); factor_mstruct->unref(); return true; } factor_mstruct->unref(); if(SIZE > 1 && CHILD(SIZE - 1).isNumber() && CHILD(SIZE - 1).number().isInteger()) { MathStructure *xvar = NULL; Number qnr(1, 1); int degree = 1; bool overflow = false; int qcof = 1; if(CHILD(0).isPower() && CHILD(0)[0].size() == 0 && CHILD(0)[1].isNumber() && CHILD(0)[1].number().isInteger() && CHILD(0)[1].number().isPositive()) { xvar = &CHILD(0)[0]; degree = CHILD(0)[1].number().intValue(&overflow); } else if(CHILD(0).isMultiplication() && CHILD(0).size() == 2 && CHILD(0)[0].isNumber() && CHILD(0)[0].number().isInteger()) { if(CHILD(0)[1].isPower()) { if(CHILD(0)[1][0].size() == 0 && CHILD(0)[1][1].isNumber() && CHILD(0)[1][1].number().isInteger() && CHILD(0)[1][1].number().isPositive()) { xvar = &CHILD(0)[1][0]; qcof = CHILD(0)[0].number().intValue(&overflow); if(!overflow) { if(qcof < 0) qcof = -qcof; degree = CHILD(0)[1][1].number().intValue(&overflow); } } } } int pcof = 1; if(!overflow) { pcof = CHILD(SIZE - 1).number().intValue(&overflow); if(pcof < 0) pcof = -pcof; } if(xvar && !overflow && degree <= 1000 && degree > 2) { bool b = true; for(size_t i = 1; b && i < SIZE - 1; i++) { switch(CHILD(i).type()) { case STRUCT_NUMBER: { b = false; break; } case STRUCT_POWER: { if(!CHILD(i)[1].isNumber() || !xvar->equals(CHILD(i)[0]) || !CHILD(i)[1].number().isInteger() || !CHILD(i)[1].number().isPositive()) { b = false; } break; } case STRUCT_MULTIPLICATION: { if(!CHILD(i).size() == 2 || !CHILD(i)[0].isNumber()) { b = false; } else if(CHILD(i)[1].isPower()) { if(!CHILD(i)[1][1].isNumber() || !xvar->equals(CHILD(i)[1][0]) || !CHILD(i)[1][1].number().isInteger() || !CHILD(i)[1][1].number().isPositive()) { b = false; } } else if(!xvar->equals(CHILD(i)[1])) { b = false; } break; } default: { if(!xvar->equals(CHILD(i))) { b = false; } } } } if(b) { vector factors; factors.resize(degree + 1, Number()); factors[0] = CHILD(SIZE - 1).number(); vector ps; vector qs; vector zeroes; int curdeg = 1, prevdeg = 0; for(size_t i = 0; b && i < SIZE - 1; i++) { switch(CHILD(i).type()) { case STRUCT_POWER: { curdeg = CHILD(i)[1].number().intValue(&overflow); if(curdeg == prevdeg || curdeg > degree || prevdeg > 0 && curdeg > prevdeg || overflow) { b = false; } else { factors[curdeg].set(1, 1); } break; } case STRUCT_MULTIPLICATION: { if(CHILD(i)[1].isPower()) { curdeg = CHILD(i)[1][1].number().intValue(&overflow); } else { curdeg = 1; } if(curdeg == prevdeg || curdeg > degree || prevdeg > 0 && curdeg > prevdeg || overflow) { b = false; } else { factors[curdeg] = CHILD(i)[0].number(); } break; } default: { curdeg = 1; factors[curdeg].set(1, 1); } } prevdeg = curdeg; } while(b && degree > 2) { for(int i = 1; i <= 1000; i++) { if(i > pcof) break; if(pcof % i == 0) ps.push_back(i); } for(int i = 1; i <= 1000; i++) { if(i > qcof) break; if(qcof % i == 0) qs.push_back(i); } Number itest; int i2; size_t pi = 0, qi = 0; Number nrtest(ps[0], qs[0]); while(true) { itest.clear(); i2 = degree; while(true) { itest += factors[i2]; if(i2 == 0) break; itest *= nrtest; i2--; } if(itest.isZero()) { break; } if(nrtest.isPositive()) { nrtest.negate(); } else { qi++; if(qi == qs.size()) { qi = 0; pi++; if(pi == ps.size()) { break; } } nrtest.set(ps[pi], qs[qi]); } } if(itest.isZero()) { itest.clear(); i2 = degree; Number ntmp(factors[i2]); for(; i2 > 0; i2--) { itest += ntmp; ntmp = factors[i2 - 1]; factors[i2 - 1] = itest; itest *= nrtest; } degree--; nrtest.negate(); zeroes.push_back(nrtest); if(degree == 2) { break; } qcof = factors[degree].intValue(&overflow); if(!overflow) { if(qcof < 0) qcof = -qcof; pcof = factors[0].intValue(&overflow); if(!overflow) { if(pcof < 0) pcof = -pcof; } } if(overflow) { break; } } else { break; } ps.clear(); qs.clear(); } if(zeroes.size() > 0) { MathStructure mleft; MathStructure mtmp; MathStructure *mcur; for(int i = degree; i >= 0; i--) { if(!factors[i].isZero()) { if(mleft.isZero()) { mcur = &mleft; } else { mleft.add(m_zero, true); mcur = &mleft[mleft.size() - 1]; } if(i > 1) { if(!factors[i].isOne()) { mcur->multiply(*xvar); (*mcur)[0].set(factors[i]); mcur = &(*mcur)[1]; } else { mcur->set(*xvar); } mtmp.set(i, 1); mcur->raise(mtmp); } else if(i == 1) { if(!factors[i].isOne()) { mcur->multiply(*xvar); (*mcur)[0].set(factors[i]); } else { mcur->set(*xvar); } } else { mcur->set(factors[i]); } } } mleft.factorize(eo); vector powers; vector powers_i; int dupsfound = 0; for(size_t i = 0; i < zeroes.size() - 1; i++) { while(i + 1 < zeroes.size() && zeroes[i] == zeroes[i + 1]) { dupsfound++; zeroes.erase(zeroes.begin() + (i + 1)); } if(dupsfound > 0) { powers_i.push_back(i); powers.push_back(dupsfound + 1); dupsfound = 0; } } MathStructure xvar2(*xvar); Number *nrmul; if(mleft.isMultiplication()) { set(mleft); evalSort(); if(CHILD(0).isNumber()) { nrmul = &CHILD(0).number(); } else if(CHILD(0).isMultiplication() && CHILD(0).size() > 0 && CHILD(0)[0].isNumber()) { nrmul = &CHILD(0)[0].number(); } else { PREPEND(m_one); nrmul = &CHILD(0).number(); } } else { clear(true); m_type = STRUCT_MULTIPLICATION; APPEND(m_one); APPEND(mleft); nrmul = &CHILD(0).number(); } size_t pi = 0; for(size_t i = 0; i < zeroes.size(); i++) { if(zeroes[i].isInteger()) { APPEND(xvar2); } else { APPEND(m_zero); } mcur = &CHILD(SIZE - 1); if(pi < powers_i.size() && powers_i[pi] == i) { mcur->raise(MathStructure(powers[pi], 1)); mcur = &(*mcur)[0]; if(zeroes[i].isInteger()) { mcur->add(zeroes[i]); } else { Number nr(zeroes[i].denominator()); mcur->add(zeroes[i].numerator()); (*mcur)[0] *= xvar2; (*mcur)[0][0].number() = nr; nr.raise(powers[pi]); nrmul->divide(nr); } pi++; } else { if(zeroes[i].isInteger()) { mcur->add(zeroes[i]); } else { nrmul->divide(zeroes[i].denominator()); mcur->add(zeroes[i].numerator()); (*mcur)[0] *= xvar2; (*mcur)[0][0].number() = zeroes[i].denominator(); } } } if(CHILD(0).isNumber() && CHILD(0).number().isOne()) { ERASE(0); } else if(CHILD(0).isMultiplication() && CHILD(0).size() > 0 && CHILD(0)[0].isNumber() && CHILD(0)[0].number().isOne()) { if(CHILD(0).size() == 1) { ERASE(0); } else if(CHILD(0).size() == 2) { CHILD(0).setToChild(2, true); } else { CHILD(0).delChild(1); } } evalSort(true); Number dupspow; for(size_t i = 0; i < SIZE - 1; i++) { mcur = NULL; if(CHILD(i).isPower()) { if(CHILD(i)[0].isAddition() && CHILD(i)[1].isNumber()) { mcur = &CHILD(i)[0]; } } else if(CHILD(i).isAddition()) { mcur = &CHILD(i); } while(mcur && i + 1 < SIZE) { if(CHILD(i + 1).isPower()) { if(CHILD(i + 1)[0].isAddition() && CHILD(i + 1)[1].isNumber() && mcur->equals(CHILD(i + 1)[0])) { dupspow += CHILD(i + 1)[1].number(); } else { mcur = NULL; } } else if(CHILD(i + 1).isAddition() && mcur->equals(CHILD(i + 1))) { dupspow++; } else { mcur = NULL; } if(mcur) { ERASE(i + 1); } } if(!dupspow.isZero()) { if(CHILD(i).isPower()) { CHILD(i)[1].number() += dupspow; } else { dupspow++; CHILD(i) ^= dupspow; } dupspow.clear(); } } if(SIZE == 1) { setToChild(1, true); } else { EvaluationOptions eo2 = eo; eo2.expand = false; calculatesub(eo2, eo2, false); } return true; } } } } //x^2-y^2=(x+y)(x-y) if(SIZE == 2 && CHILD(0).isPower() && CHILD(0)[1].isNumber() && CHILD(0)[1].number().isTwo() && CHILD(1).isMultiplication() && CHILD(1).size() == 2 && CHILD(1)[0].isMinusOne() && CHILD(1)[1].isPower() && CHILD(1)[1][1].isNumber() && CHILD(1)[1][1].number().isTwo()) { if(CHILD(0)[0].representsNonMatrix() && CHILD(1)[1][0].representsNonMatrix()) { CHILD(0).setToChild(1, true); CHILD(1)[1].setToChild(1, true); MathStructure *m2 = new MathStructure(*this); (*m2)[1].setToChild(2, true); EvaluationOptions eo2 = eo; eo2.expand = false; calculatesub(eo2, eo2, false); multiply_nocopy(m2, true); return true; } } //-x^2+y^2=(x+y)(-y+x) if(SIZE == 2 && CHILD(1).isPower() && CHILD(1)[1].isNumber() && CHILD(1)[1].number().isTwo() && CHILD(0).isMultiplication() && CHILD(0).size() == 2 && CHILD(0)[0].isMinusOne() && CHILD(0)[1].isPower() && CHILD(0)[1][1].isNumber() && CHILD(0)[1][1].number().isTwo()) { if(CHILD(1)[0].representsNonMatrix() && CHILD(0)[1][0].representsNonMatrix()) { CHILD(1).setToChild(1, true); CHILD(0)[1].setToChild(1, true); MathStructure *m2 = new MathStructure(*this); (*m2)[0].setToChild(2, true); EvaluationOptions eo2 = eo; eo2.expand = false; calculatesub(eo2, eo2, false); multiply_nocopy(m2, true); return true; } } //x^3-y^3=(x-y)(x^2+xy+y^2) if(SIZE == 2 && CHILD(0).isPower() && CHILD(0)[1].isNumber() && CHILD(0)[1].number() == 3 && CHILD(1).isMultiplication() && CHILD(1).size() == 2 && CHILD(1)[0].isMinusOne() && CHILD(1)[1].isPower() && CHILD(1)[1][1].isNumber() && CHILD(1)[1][1].number() == 3) { if(CHILD(0)[0].representsNonMatrix() && CHILD(1)[1][0].representsNonMatrix()) { MathStructure *m2 = new MathStructure(*this); (*m2)[0].setToChild(1, true); (*m2)[1][1].setToChild(1, true); EvaluationOptions eo2 = eo; eo2.expand = false; m2->calculatesub(eo2, eo2, false); CHILD(0)[1].set(2, 1, 0, true); CHILD(1).setToChild(2, true); CHILD(1)[1].set(2, 1, 0, true); MathStructure *m3 = new MathStructure(CHILD(0)[0]); m3->calculateMultiply(CHILD(1)[0], eo2); add_nocopy(m3, true); calculatesub(eo2, eo2, false); multiply_nocopy(m2, true); return true; } } //-x^3+y^3=(-x+y)(x^2+xy+y^2) if(SIZE == 2 && CHILD(1).isPower() && CHILD(1)[1].isNumber() && CHILD(1)[1].number() == 3 && CHILD(0).isMultiplication() && CHILD(0).size() == 2 && CHILD(0)[0].isMinusOne() && CHILD(0)[1].isPower() && CHILD(0)[1][1].isNumber() && CHILD(0)[1][1].number() == 3) { if(CHILD(1)[0].representsNonMatrix() && CHILD(0)[1][0].representsNonMatrix()) { MathStructure *m2 = new MathStructure(*this); (*m2)[1].setToChild(1, true); (*m2)[0][1].setToChild(1, true); EvaluationOptions eo2 = eo; eo2.expand = false; m2->calculatesub(eo2, eo2, false); CHILD(1)[1].set(2, 1, 0, true); CHILD(0).setToChild(2, true); CHILD(0)[1].set(2, 1, 0, true); MathStructure *m3 = new MathStructure(CHILD(0)[0]); m3->calculateMultiply(CHILD(1)[0], eo2); add_nocopy(m3, true); calculatesub(eo2, eo2, false); multiply_nocopy(m2, true); return true; } } } default: { bool b = false; if(isComparison()) { EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).factorize(eo2)) { CHILD_UPDATED(i); b = true; } } } else { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).factorize(eo)) { CHILD_UPDATED(i); b = true; } } if(b) { EvaluationOptions eo2 = eo; eo2.expand = false; calculatesub(eo2, eo2, false); } } } } return false; } void MathStructure::swapChildren(size_t index1, size_t index2) { if(index1 > 0 && index2 > 0 && index1 <= SIZE && index2 <= SIZE) { SWAP_CHILDREN(index1 - 1, index2 - 1) } } void MathStructure::childToFront(size_t index) { if(index > 0 && index <= SIZE) { CHILD_TO_FRONT(index - 1) } } void MathStructure::addChild(const MathStructure &o) { APPEND(o); } void MathStructure::addChild_nocopy(MathStructure *o) { APPEND_POINTER(o); } void MathStructure::delChild(size_t index) { if(index > 0 && index <= SIZE) { ERASE(index - 1); } } void MathStructure::insertChild(const MathStructure &o, size_t index) { if(index > 0 && index <= v_subs.size()) { v_order.insert(v_order.begin() + (index - 1), v_subs.size()); v_subs.push_back(new MathStructure(o)); CHILD_UPDATED(index - 1); } else { addChild(o); } } void MathStructure::insertChild_nocopy(MathStructure *o, size_t index) { if(index > 0 && index <= v_subs.size()) { v_order.insert(v_order.begin() + (index - 1), v_subs.size()); v_subs.push_back(o); CHILD_UPDATED(index - 1); } else { addChild_nocopy(o); } } void MathStructure::setChild(const MathStructure &o, size_t index) { if(index > 0 && index <= SIZE) { CHILD(index - 1) = o; CHILD_UPDATED(index - 1); } } void MathStructure::setChild_nocopy(MathStructure *o, size_t index) { if(index > 0 && index <= SIZE) { v_subs[v_order[index - 1]]->unref(); v_subs[v_order[index - 1]] = o; CHILD_UPDATED(index - 1); } } const MathStructure *MathStructure::getChild(size_t index) const { if(index > 0 && index <= v_order.size()) { return &CHILD(index - 1); } return NULL; } MathStructure *MathStructure::getChild(size_t index) { if(index > 0 && index <= v_order.size()) { return &CHILD(index - 1); } return NULL; } size_t MathStructure::countChildren() const { return SIZE; } size_t MathStructure::size() const { return SIZE; } const MathStructure *MathStructure::base() const { if(m_type == STRUCT_POWER && SIZE >= 1) { return &CHILD(0); } return NULL; } const MathStructure *MathStructure::exponent() const { if(m_type == STRUCT_POWER && SIZE >= 2) { return &CHILD(1); } return NULL; } MathStructure *MathStructure::base() { if(m_type == STRUCT_POWER && SIZE >= 1) { return &CHILD(0); } return NULL; } MathStructure *MathStructure::exponent() { if(m_type == STRUCT_POWER && SIZE >= 2) { return &CHILD(1); } return NULL; } StructureType MathStructure::type() const { return m_type; } void MathStructure::unformat(const EvaluationOptions &eo) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).unformat(eo); } switch(m_type) { case STRUCT_INVERSE: { APPEND(m_minus_one); m_type = STRUCT_POWER; } case STRUCT_NEGATE: { PREPEND(m_minus_one); m_type = STRUCT_MULTIPLICATION; } case STRUCT_DIVISION: { CHILD(1).raise(m_minus_one); m_type = STRUCT_MULTIPLICATION; } case STRUCT_UNIT: { if(o_prefix && !eo.keep_prefixes) { if(o_prefix == CALCULATOR->decimal_null_prefix || o_prefix == CALCULATOR->binary_null_prefix) { o_prefix = NULL; } else { Unit *u = o_unit; Prefix *p = o_prefix; set(p->value()); multiply(u); } } b_plural = false; } default: {} } } void idm1(const MathStructure &mnum, bool &bfrac, bool &bint) { switch(mnum.type()) { case STRUCT_NUMBER: { if((!bfrac || bint) && mnum.number().isRational()) { if(!mnum.number().isInteger()) { bint = false; bfrac = true; } } else { bint = false; } break; } case STRUCT_MULTIPLICATION: { if((!bfrac || bint) && mnum.size() > 0 && mnum[0].isNumber() && mnum[0].number().isRational()) { if(!mnum[0].number().isInteger()) { bint = false; bfrac = true; } } else { bint = false; } break; } case STRUCT_ADDITION: { for(size_t i = 0; i < mnum.size() && (!bfrac || bint); i++) { idm1(mnum[i], bfrac, bint); } break; } default: { bint = false; } } } void idm2(const MathStructure &mnum, bool &bfrac, bool &bint, Number &nr) { switch(mnum.type()) { case STRUCT_NUMBER: { if(mnum.number().isRational()) { if(mnum.number().isInteger()) { if(bint) { if(mnum.number().isOne()) { bint = false; } else if(nr.isOne()) { nr = mnum.number(); } else if(nr != mnum.number()) { nr.gcd(mnum.number()); if(nr.isOne()) bint = false; } } } else { if(nr.isOne()) { nr = mnum.number().denominator(); } else { Number nden(mnum.number().denominator()); if(nr != nden) { Number ngcd(nden); ngcd.gcd(nr); nden /= ngcd; nr *= nden; } } } } break; } case STRUCT_MULTIPLICATION: { if(mnum.size() > 0 && mnum[0].isNumber() && mnum[0].number().isRational()) { if(mnum[0].number().isInteger()) { if(bint) { if(mnum[0].number().isOne()) { bint = false; } else if(nr.isOne()) { nr = mnum[0].number(); } else if(nr != mnum[0].number()) { nr.gcd(mnum[0].number()); if(nr.isOne()) bint = false; } } } else { if(nr.isOne()) { nr = mnum[0].number().denominator(); } else { Number nden(mnum[0].number().denominator()); if(nr != nden) { Number ngcd(nden); ngcd.gcd(nr); nden /= ngcd; nr *= nden; } } } } break; } case STRUCT_ADDITION: { for(size_t i = 0; i < mnum.size() && (bfrac || bint); i++) { idm2(mnum[i], bfrac, bint, nr); } break; } default: {} } } void idm3(MathStructure &mnum, Number &nr, bool expand) { switch(mnum.type()) { case STRUCT_NUMBER: { mnum.number() *= nr; mnum.numberUpdated(); break; } case STRUCT_MULTIPLICATION: { if(mnum.size() > 0 && mnum[0].isNumber()) { mnum[0].number() *= nr; if(mnum[0].number().isOne() && mnum.size() != 1) { mnum.delChild(1); if(mnum.size() == 1) mnum.setToChild(1, true); } } else { mnum.insertChild(nr, 1); } break; } case STRUCT_ADDITION: { if(expand) { for(size_t i = 0; i < mnum.size(); i++) { idm3(mnum[i], nr, true); } break; } } default: { mnum.transform(STRUCT_MULTIPLICATION); mnum.insertChild(nr, 1); } } } bool is_unit_multiexp(const MathStructure &mstruct) { if(mstruct.isUnit_exp()) return true; if(mstruct.isMultiplication()) { for(size_t i3 = 0; i3 < mstruct.size(); i3++) { if(!mstruct[i3].isUnit_exp()) { return false; break; } } return true; } if(mstruct.isPower() && mstruct[0].isMultiplication()) { for(size_t i3 = 0; i3 < mstruct[0].size(); i3++) { if(!mstruct[0][i3].isUnit_exp()) { return false; break; } } return true; } return false; } bool MathStructure::improve_division_multipliers(const PrintOptions &po) { switch(m_type) { case STRUCT_MULTIPLICATION: { size_t inum = 0, iden = 0; bool bfrac = false, bint = true, bdiv = false, bnonunitdiv = false; size_t index1 = 0, index2 = 0; bool dofrac = !po.negative_exponents; for(size_t i2 = 0; i2 < SIZE; i2++) { if(CHILD(i2).isPower() && CHILD(i2)[1].isMinusOne()) { if(!po.place_units_separately || !is_unit_multiexp(CHILD(i2)[0])) { if(iden == 0) index1 = i2; iden++; bdiv = true; if(!CHILD(i2)[0].isUnit()) bnonunitdiv = true; if(CHILD(i2)[0].containsType(STRUCT_ADDITION)) { dofrac = true; } } } else if(!bdiv && !po.negative_exponents && CHILD(i2).isPower() && CHILD(i2)[1].hasNegativeSign()) { if(!po.place_units_separately || !is_unit_multiexp(CHILD(i2)[0])) { if(!bdiv) index1 = i2; bdiv = true; if(!CHILD(i2)[0].isUnit()) bnonunitdiv = true; } } else { if(!po.place_units_separately || !is_unit_multiexp(CHILD(i2))) { if(inum == 0) index2 = i2; inum++; } } } if(!bdiv || !bnonunitdiv) break; if(iden > 1 && !po.negative_exponents) { size_t i2 = index1 + 1; while(i2 < SIZE) { if(CHILD(i2).isPower() && CHILD(i2)[1].isMinusOne()) { CHILD(index1)[0].multiply(CHILD(i2)[0], true); ERASE(i2); } else { i2++; } } iden = 1; } if(bint) bint = inum > 0 && iden == 1; if(inum > 0) idm1(CHILD(index2), bfrac, bint); if(iden > 0) idm1(CHILD(index1)[0], bfrac, bint); bool b = false; if(!dofrac) bfrac = false; if(bint || bfrac) { Number nr(1, 1); if(inum > 0) idm2(CHILD(index2), bfrac, bint, nr); if(iden > 0) idm2(CHILD(index1)[0], bfrac, bint, nr); if((bint || bfrac) && !nr.isOne()) { if(bint) { nr.recip(); } if(inum == 0) { PREPEND(MathStructure(nr)); } else if(inum > 1 && !CHILD(index2).isNumber()) { idm3(*this, nr, !po.allow_factorization); } else { idm3(CHILD(index2), nr, !po.allow_factorization); } if(iden > 0) { idm3(CHILD(index1)[0], nr, !po.allow_factorization); } else { MathStructure mstruct(nr); mstruct.raise(m_minus_one); insertChild(mstruct, index1); } b = true; } } /*if(!po.negative_exponents && SIZE == 2 && CHILD(1).isAddition()) { MathStructure factor_mstruct(1, 1); if(factorize_find_multiplier(CHILD(1), CHILD(1), factor_mstruct)) { transform(STRUCT_MULTIPLICATION); PREPEND(factor_mstruct); } }*/ return b; } case STRUCT_DIVISION: { bool bint = true, bfrac = false; idm1(CHILD(0), bfrac, bint); idm1(CHILD(1), bfrac, bint); if(bint || bfrac) { Number nr(1, 1); idm2(CHILD(0), bfrac, bint, nr); idm2(CHILD(1), bfrac, bint, nr); if((bint || bfrac) && !nr.isOne()) { if(bint) { nr.recip(); } idm3(CHILD(0), nr, !po.allow_factorization); idm3(CHILD(1), nr, !po.allow_factorization); return true; } } break; } case STRUCT_INVERSE: { bool bint = false, bfrac = false; idm1(CHILD(0), bfrac, bint); if(bint || bfrac) { Number nr(1, 1); idm2(CHILD(0), bfrac, bint, nr); if((bint || bfrac) && !nr.isOne()) { setToChild(1, true); idm3(*this, nr, !po.allow_factorization); transform_nocopy(STRUCT_DIVISION, new MathStructure(nr)); SWAP_CHILDREN(0, 1); return true; } } break; } case STRUCT_POWER: { if(CHILD(1).isMinusOne()) { bool bint = false, bfrac = false; idm1(CHILD(0), bfrac, bint); if(bint || bfrac) { Number nr(1, 1); idm2(CHILD(0), bfrac, bint, nr); if((bint || bfrac) && !nr.isOne()) { idm3(CHILD(0), nr, !po.allow_factorization); transform(STRUCT_MULTIPLICATION); PREPEND(MathStructure(nr)); return true; } } break; } } default: { bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).improve_division_multipliers()) b = true; } return b; } } return false; } void MathStructure::setPrefixes(const PrintOptions &po, MathStructure *parent, size_t pindex) { switch(m_type) { case STRUCT_MULTIPLICATION: { bool b = false; size_t i = SIZE, im = 0; bool b_im = false; for(size_t i2 = 0; i2 < SIZE; i2++) { if(CHILD(i2).isUnit_exp()) { if((CHILD(i2).isUnit() && CHILD(i2).prefix()) || (CHILD(i2).isPower() && CHILD(i2)[0].prefix())) { b = false; return; } if(po.use_prefixes_for_currencies || (CHILD(i2).isPower() && !CHILD(i2)[0].unit()->isCurrency()) || (CHILD(i2).isUnit() && !CHILD(i2).unit()->isCurrency())) { b = true; if(i > i2) {i = i2; b_im = false;} break; } else if(i < i2) { i = i2; b_im = false; } } else if(CHILD(i2).isPower() && CHILD(i2)[0].isMultiplication()) { for(size_t i3 = 0; i3 < CHILD(i2)[0].size(); i3++) { if(CHILD(i2)[0][i3].isUnit_exp()) { if((CHILD(i2)[0][i3].isUnit() && CHILD(i2)[0][i3].prefix()) || (CHILD(i2)[0][i3].isPower() && CHILD(i2)[0][i3][0].prefix())) { b = false; return; } if(po.use_prefixes_for_currencies || (CHILD(i2)[0][i3].isPower() && !CHILD(i2)[0][i3][0].unit()->isCurrency()) || (CHILD(i2)[0][i3].isUnit() && !CHILD(i2)[0][i3].unit()->isCurrency())) { b = true; if(i > i2) { i = i2; im = i3; b_im = true; } break; } else if(i < i2 || (i == i2 && im < i3)) { i = i2; im = i3; b_im = true; } } } if(b) break; } } if(b) { Number exp(1, 1); Number exp2(1, 1); bool b2 = false; MathStructure *munit = NULL, *munit2 = NULL; if(b_im) munit = &CHILD(i)[0][im]; else munit = &CHILD(i); if(CHILD(i).isPower()) { if(CHILD(i)[1].isNumber() && CHILD(i)[1].number().isInteger()) { if(b_im && munit->isPower()) { if((*munit)[1].isNumber() && (*munit)[1].number().isInteger()) { exp = CHILD(i)[1].number(); exp *= (*munit)[1].number(); } else { b = false; } } else { exp = CHILD(i)[1].number(); } } else { b = false; } } if(po.use_denominator_prefix && !exp.isNegative()) { for(size_t i2 = i + 1; i2 < SIZE; i2++) { if(CHILD(i2).isPower() && CHILD(i2)[1].isNumber() && CHILD(i2)[1].number().isNegative()) { if(CHILD(i2)[0].isUnit()) { munit2 = &CHILD(i2)[0]; if(munit2->prefix() || !CHILD(i2)[1].number().isInteger()) { break; } if(!b) { b = true; exp = CHILD(i2)[1].number(); munit = munit2; } else { b2 = true; exp2 = CHILD(i2)[1].number(); } break; } else if(CHILD(i2)[0].isMultiplication()) { for(size_t im2 = 0; im2 < CHILD(i2)[0].size(); im2++) { if(CHILD(i2)[0][im2].isUnit_exp() && (CHILD(i2)[0][im2].isUnit() || CHILD(i2)[0][im2][1].isNumber() && CHILD(i2)[0][im2][1].number().isNegative() && CHILD(i2)[0][im2][1].number().isInteger())) { Number exp_multi(1); if(CHILD(i2)[0][im2].isUnit()) { munit2 = &CHILD(i2)[0][im2]; } else { munit2 = &CHILD(i2)[0][im2][0]; exp_multi = CHILD(i2)[0][im2][1].number(); } if(munit2->prefix() || !CHILD(i2)[1].number().isInteger()) { break; } if(!b) { b = true; exp = CHILD(i2)[1].number(); exp *= exp_multi; i = i2; } else { b2 = true; exp2 = CHILD(i2)[1].number(); exp2 *= exp_multi; } break; } } } } } } else if(exp.isNegative() && b) { for(size_t i2 = i + 1; i2 < SIZE; i2++) { bool b3 = false; if(CHILD(i2).isPower() && !(CHILD(i2)[1].isNumber() && CHILD(i2)[1].number().isNegative())) { if(CHILD(i2)[0].isUnit()) { exp2 = exp; exp = CHILD(i2)[1].number(); munit2 = &CHILD(i2); } else if(CHILD(i2)[0].isMultiplication()) { for(size_t im2 = 0; im2 < CHILD(i2)[0].size(); im2++) { if(CHILD(i2)[0][im2].isUnit_exp() && (CHILD(i2)[0][im2].isUnit() || CHILD(i2)[0][im2][1].isNumber() && CHILD(i2)[0][im2][1].number().isNegative() && CHILD(i2)[0][im2][1].number().isInteger())) { exp2 = exp; Number exp_multi(1); if(CHILD(i2)[0][im2].isUnit()) { munit2 = &CHILD(i2)[0][im2]; } else { munit2 = &CHILD(i2)[0][im2][0]; exp_multi = CHILD(i2)[0][im2][1].number(); } exp = CHILD(i2)[1].number(); exp *= exp_multi; break; } } } if(munit2) { if(munit2->prefix() || !CHILD(i2)[1].number().isInteger()) { if(!po.use_denominator_prefix) { b = false; } break; } b3 = true; } } else if(CHILD(i2).isUnit()) { exp2 = exp; exp.set(1, 1); b3 = true; munit2 = &CHILD(i2); } if(b3) { if(po.use_denominator_prefix) { b2 = true; MathStructure *munit3 = munit; munit = munit2; munit2 = munit3; } else { munit = munit2; } break; } } } Number exp10; if(b) { if(po.prefix) { if(po.prefix != CALCULATOR->decimal_null_prefix && po.prefix != CALCULATOR->binary_null_prefix) { if(munit->isUnit()) munit->setPrefix(po.prefix); else (*munit)[0].setPrefix(po.prefix); if(CHILD(0).isNumber()) { CHILD(0).number() /= po.prefix->value(exp); } else { PREPEND(po.prefix->value(exp)); CHILD(0).number().recip(); } if(b2) { exp10 = CHILD(0).number(); exp10.log(10); exp10.floor(); } } } else if(po.use_unit_prefixes && CHILD(0).isNumber() && exp.isInteger()) { exp10 = CHILD(0).number(); exp10.log(10); exp10.floor(); if(b2) { Number tmp_exp(exp10); tmp_exp.setNegative(false); Number e1(3, 1); e1 *= exp; Number e2(3, 1); e2 *= exp2; e2.setNegative(false); int i4 = 0; while(true) { tmp_exp -= e1; if(!tmp_exp.isPositive()) { break; } if(exp10.isNegative()) i4++; tmp_exp -= e2; if(tmp_exp.isNegative()) { break; } if(!exp10.isNegative()) i4++; } e2.setNegative(exp10.isNegative()); e2 *= i4; exp10 -= e2; } DecimalPrefix *p = CALCULATOR->getBestDecimalPrefix(exp10, exp, po.use_all_prefixes); if(p) { Number test_exp(exp10); test_exp -= p->exponent(exp); if(test_exp.isInteger()) { if((exp10.isPositive() && exp10.compare(test_exp) == COMPARISON_RESULT_LESS) || (exp10.isNegative() && exp10.compare(test_exp) == COMPARISON_RESULT_GREATER)) { CHILD(0).number() /= p->value(exp); if(munit->isUnit()) munit->setPrefix(p); else (*munit)[0].setPrefix(p); } } } } if(b2 && CHILD(0).isNumber() && ((po.prefix && po.prefix != CALCULATOR->decimal_null_prefix && po.prefix != CALCULATOR->binary_null_prefix) || po.use_unit_prefixes)) { exp10 = CHILD(0).number(); exp10.log(10); exp10.floor(); DecimalPrefix *p = CALCULATOR->getBestDecimalPrefix(exp10, exp2, po.use_all_prefixes); if(p) { Number test_exp(exp10); test_exp -= p->exponent(exp2); if(test_exp.isInteger()) { if((exp10.isPositive() && exp10.compare(test_exp) == COMPARISON_RESULT_LESS) || (exp10.isNegative() && exp10.compare(test_exp) == COMPARISON_RESULT_GREATER)) { CHILD(0).number() /= p->value(exp2); if(munit2->isUnit()) munit2->setPrefix(p); else (*munit2)[0].setPrefix(p); } } } } } break; } } case STRUCT_UNIT: { if(!o_prefix && (po.prefix && po.prefix != CALCULATOR->decimal_null_prefix && po.prefix != CALCULATOR->binary_null_prefix)) { transform(STRUCT_MULTIPLICATION, m_one); SWAP_CHILDREN(0, 1); setPrefixes(po, parent, pindex); } break; } case STRUCT_POWER: { if(CHILD(0).isUnit()) { if(CHILD(1).isNumber() && CHILD(1).number().isReal() && !o_prefix && (po.prefix && po.prefix != CALCULATOR->decimal_null_prefix && po.prefix != CALCULATOR->binary_null_prefix)) { transform(STRUCT_MULTIPLICATION, m_one); SWAP_CHILDREN(0, 1); setPrefixes(po, parent, pindex); } break; } } default: { for(size_t i = 0; i < SIZE; i++) { CHILD(i).setPrefixes(po, this, i + 1); } } } } bool split_unit_powers(MathStructure &mstruct); bool split_unit_powers(MathStructure &mstruct) { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(split_unit_powers(mstruct[i])) { mstruct.childUpdated(i + 1); b = true; } } if(mstruct.isPower() && mstruct[0].isMultiplication()) { bool b2 = mstruct[1].isNumber(); for(size_t i = 0; i < mstruct[0].size(); i++) { if(mstruct[0][i].isPower() && (!b2 || !mstruct[0][i][1].isNumber())) return b; } MathStructure mpower(mstruct[1]); mstruct.setToChild(1); for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isPower()) mstruct[i][1].number() *= mpower.number(); else mstruct[i].raise(mpower); } mstruct.childrenUpdated(); return true; } return b; } void MathStructure::postFormatUnits(const PrintOptions &po, MathStructure*, size_t) { switch(m_type) { case STRUCT_DIVISION: { if(po.place_units_separately) { vector nums; bool b1 = false, b2 = false; if(CHILD(0).isMultiplication()) { for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isUnit_exp()) { nums.push_back(i); } else { b1 = true; } } b1 = b1 && !nums.empty(); } else if(CHILD(0).isUnit_exp()) { b1 = true; } vector dens; if(CHILD(1).isMultiplication()) { for(size_t i = 0; i < CHILD(1).size(); i++) { if(CHILD(1)[i].isUnit_exp()) { dens.push_back(i); } else { b2 = true; } } b2 = b2 && !dens.empty(); } else if(CHILD(1).isUnit_exp()) { if(CHILD(0).isUnit_exp()) { b1 = false; } else { b2 = true; } } if(b2 && !b1) b1 = true; if(b1) { MathStructure num = m_undefined; if(CHILD(0).isUnit_exp()) { num = CHILD(0); CHILD(0).set(m_one); } else if(nums.size() > 0) { num = CHILD(0)[nums[0]]; for(size_t i = 1; i < nums.size(); i++) { num.multiply(CHILD(0)[nums[i]], i > 1); } for(size_t i = 0; i < nums.size(); i++) { CHILD(0).delChild(nums[i] + 1 - i); } if(CHILD(0).size() == 1) { CHILD(0).setToChild(1, true); } } MathStructure den = m_undefined; if(CHILD(1).isUnit_exp()) { den = CHILD(1); setToChild(1, true); } else if(dens.size() > 0) { den = CHILD(1)[dens[0]]; for(size_t i = 1; i < dens.size(); i++) { den.multiply(CHILD(1)[dens[i]], i > 1); } for(size_t i = 0; i < dens.size(); i++) { CHILD(1).delChild(dens[i] + 1 - i); } if(CHILD(1).size() == 1) { CHILD(1).setToChild(1, true); } } if(num.isUndefined()) { transform(STRUCT_DIVISION, den); } else { if(!den.isUndefined()) { num.transform(STRUCT_DIVISION, den); } multiply(num, false); } if(CHILD(0).isDivision()) { if(CHILD(0)[0].isMultiplication()) { if(CHILD(0)[0].size() == 1) { CHILD(0)[0].setToChild(1, true); } else if(CHILD(0)[0].size() == 0) { CHILD(0)[0] = 1; } } if(CHILD(0)[1].isMultiplication()) { if(CHILD(0)[1].size() == 1) { CHILD(0)[1].setToChild(1, true); } else if(CHILD(0)[1].size() == 0) { CHILD(0).setToChild(1, true); } } else if(CHILD(0)[1].isOne()) { CHILD(0).setToChild(1, true); } if(CHILD(0).isDivision() && CHILD(0)[1].isNumber() && CHILD(0)[0].isMultiplication() && CHILD(0)[0].size() > 1 && CHILD(0)[0][0].isNumber()) { MathStructure *msave = new MathStructure; if(CHILD(0)[0].size() == 2) { msave->set(CHILD(0)[0][1]); CHILD(0)[0].setToChild(1, true); } else { msave->set(CHILD(0)[0]); CHILD(0)[0].setToChild(1, true); msave->delChild(1); } if(isMultiplication()) { insertChild_nocopy(msave, 2); } else { CHILD(0).multiply_nocopy(msave); } } } bool do_plural = po.short_multiplication; CHILD(0).postFormatUnits(po, this, 1); CHILD_UPDATED(0); switch(CHILD(0).type()) { case STRUCT_NUMBER: { if(CHILD(0).isZero() || CHILD(0).number().isOne() || CHILD(0).number().isMinusOne() || CHILD(0).number().isFraction()) { do_plural = false; } break; } case STRUCT_DIVISION: { if(CHILD(0)[0].isNumber() && CHILD(0)[1].isNumber()) { if(CHILD(0)[0].number().isLessThanOrEqualTo(CHILD(0)[1].number())) { do_plural = false; } } break; } case STRUCT_INVERSE: { if(CHILD(0)[0].isNumber() && CHILD(0)[0].number().isGreaterThanOrEqualTo(1)) { do_plural = false; } break; } default: {} } split_unit_powers(CHILD(1)); switch(CHILD(1).type()) { case STRUCT_UNIT: { CHILD(1).setPlural(do_plural); break; } case STRUCT_POWER: { CHILD(1)[0].setPlural(do_plural); break; } case STRUCT_MULTIPLICATION: { if(po.limit_implicit_multiplication) CHILD(1)[0].setPlural(do_plural); else CHILD(1)[CHILD(1).size() - 1].setPlural(do_plural); break; } case STRUCT_DIVISION: { switch(CHILD(1)[0].type()) { case STRUCT_UNIT: { CHILD(1)[0].setPlural(do_plural); break; } case STRUCT_POWER: { CHILD(1)[0][0].setPlural(do_plural); break; } case STRUCT_MULTIPLICATION: { if(po.limit_implicit_multiplication) CHILD(1)[0][0].setPlural(do_plural); else CHILD(1)[0][CHILD(1)[0].size() - 1].setPlural(do_plural); break; } default: {} } break; } default: {} } } } else { for(size_t i = 0; i < SIZE; i++) { CHILD(i).postFormatUnits(po, this, i + 1); CHILD_UPDATED(i); } } break; } case STRUCT_UNIT: { b_plural = false; break; } case STRUCT_MULTIPLICATION: { if(SIZE > 1 && CHILD(1).isUnit_exp() && CHILD(0).isNumber()) { bool do_plural = po.short_multiplication && !(CHILD(0).isZero() || CHILD(0).number().isOne() || CHILD(0).number().isMinusOne() || CHILD(0).number().isFraction()); size_t i = 2; for(; i < SIZE; i++) { if(CHILD(i).isUnit()) { CHILD(i).setPlural(false); } else if(CHILD(i).isPower() && CHILD(i)[0].isUnit()) { CHILD(i)[0].setPlural(false); } else { break; } } if(do_plural) { if(po.limit_implicit_multiplication) i = 1; else i--; if(CHILD(i).isUnit()) { CHILD(i).setPlural(true); } else { CHILD(i)[0].setPlural(true); } } } else if(SIZE > 0) { int last_unit = -1; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isUnit()) { CHILD(i).setPlural(false); if(!po.limit_implicit_multiplication || last_unit < 0) { last_unit = i; } } else if(CHILD(i).isPower() && CHILD(i)[0].isUnit()) { CHILD(i)[0].setPlural(false); if(!po.limit_implicit_multiplication || last_unit < 0) { last_unit = i; } } else if(last_unit >= 0) { break; } } if(po.short_multiplication && last_unit > 0) { if(CHILD(last_unit).isUnit()) { CHILD(last_unit).setPlural(true); } else { CHILD(last_unit)[0].setPlural(true); } } } break; } case STRUCT_POWER: { if(CHILD(0).isUnit()) { CHILD(0).setPlural(false); break; } } default: { for(size_t i = 0; i < SIZE; i++) { CHILD(i).postFormatUnits(po, this, i + 1); CHILD_UPDATED(i); } } } } bool MathStructure::factorizeUnits() { switch(m_type) { case STRUCT_ADDITION: { MathStructure *factor_mstruct = new MathStructure(1, 1); MathStructure mnew; if(factorize_find_multiplier(*this, mnew, *factor_mstruct, true)) { set(mnew, true); if(factor_mstruct->isMultiplication()) { for(size_t i = 0; i < factor_mstruct->size(); i++) { multiply_nocopy(factor_mstruct->getChild(i + 1), true); factor_mstruct->getChild(i + 1)->ref(); } factor_mstruct->unref(); } else { multiply_nocopy(factor_mstruct); } return true; } else { factor_mstruct->unref(); } } default: { bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).factorizeUnits()) { CHILD_UPDATED(i); b = true; } } return b; } } } void MathStructure::prefixCurrencies() { if(isMultiplication() && (!hasNegativeSign() || CALCULATOR->place_currency_code_before_negative)) { int index = -1; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isUnit_exp()) { if(CHILD(i).isUnit() && CHILD(i).unit()->isCurrency()) { if(index >= 0) { index = -1; break; } index = i; } else { index = -1; break; } } } if(index >= 0) { v_order.insert(v_order.begin(), v_order[index]); v_order.erase(v_order.begin() + (index + 1)); } } else { for(size_t i = 0; i < SIZE; i++) { CHILD(i).prefixCurrencies(); } } } void MathStructure::format(const PrintOptions &po) { if(!po.preserve_format) { if(po.place_units_separately) { factorizeUnits(); } sort(po); if(po.improve_division_multipliers) { if(improve_division_multipliers(po)) sort(po); } setPrefixes(po); } formatsub(po); if(!po.preserve_format) { postFormatUnits(po); if(po.sort_options.prefix_currencies && po.abbreviate_names && CALCULATOR->place_currency_code_before) { prefixCurrencies(); } } } void MathStructure::formatsub(const PrintOptions &po, MathStructure *parent, size_t pindex, bool recursive) { if(recursive) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).formatsub(po, this, i + 1); CHILD_UPDATED(i); } } switch(m_type) { case STRUCT_ADDITION: { break; } case STRUCT_NEGATE: { break; } case STRUCT_DIVISION: { if(po.preserve_format) break; if(CHILD(0).isAddition() && CHILD(0).size() > 0 && CHILD(0)[0].isNegate()) { int imin = 1; for(size_t i = 1; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isNegate()) { imin++; } else { imin--; } } bool b = CHILD(1).isAddition() && CHILD(1).size() > 0 && CHILD(1)[0].isNegate(); if(b) { imin++; for(size_t i = 1; i < CHILD(1).size(); i++) { if(CHILD(1)[i].isNegate()) { imin++; } else { imin--; } } } if(imin > 0 || (imin == 0 && parent && parent->isNegate())) { for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isNegate()) { CHILD(0)[i].setToChild(1, true); } else { CHILD(0)[i].transform(STRUCT_NEGATE); } } if(b) { for(size_t i = 0; i < CHILD(1).size(); i++) { if(CHILD(1)[i].isNegate()) { CHILD(1)[i].setToChild(1, true); } else { CHILD(1)[i].transform(STRUCT_NEGATE); } } } else { transform(STRUCT_NEGATE); } break; } } else if(CHILD(1).isAddition() && CHILD(1).size() > 0 && CHILD(1)[0].isNegate()) { int imin = 1; for(size_t i = 1; i < CHILD(1).size(); i++) { if(CHILD(1)[i].isNegate()) { imin++; } else { imin--; } } if(imin > 0 || (imin == 0 && parent && parent->isNegate())) { for(size_t i = 0; i < CHILD(1).size(); i++) { if(CHILD(1)[i].isNegate()) { CHILD(1)[i].setToChild(1, true); } else { CHILD(1)[i].transform(STRUCT_NEGATE); } } transform(STRUCT_NEGATE); } } break; } case STRUCT_INVERSE: { if(po.preserve_format) break; if((!parent || !parent->isMultiplication()) && CHILD(0).isAddition() && CHILD(0).size() > 0 && CHILD(0)[0].isNegate()) { int imin = 1; for(size_t i = 1; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isNegate()) { imin++; } else { imin--; } } if(imin > 0 || (imin == 0 && parent && parent->isNegate())) { for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isNegate()) { CHILD(0)[i].setToChild(1, true); } else { CHILD(0)[i].transform(STRUCT_NEGATE); } } transform(STRUCT_NEGATE); } } break; } case STRUCT_MULTIPLICATION: { if(po.preserve_format) break; if(CHILD(0).isNegate()) { if(CHILD(0)[0].isOne()) { ERASE(0); if(SIZE == 1) { setToChild(1, true); } } else { CHILD(0).setToChild(1, true); } transform(STRUCT_NEGATE); CHILD(0).formatsub(po, this, 1, false); break; } bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isInverse()) { if(!po.negative_exponents || !CHILD(i)[0].isNumber()) { b = true; break; } } else if(CHILD(i).isDivision()) { if(!CHILD(i)[0].isNumber() || !CHILD(i)[1].isNumber() || (!po.negative_exponents && CHILD(i)[0].number().isOne())) { b = true; break; } } } if(b) { MathStructure *den = new MathStructure(); MathStructure *num = new MathStructure(); num->setUndefined(); short ds = 0, ns = 0; MathStructure *mnum = NULL, *mden = NULL; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isInverse()) { mden = &CHILD(i)[0]; } else if(CHILD(i).isDivision()) { mnum = &CHILD(i)[0]; mden = &CHILD(i)[1]; } else { mnum = &CHILD(i); } if(mnum) { if(ns > 0) { if(mnum->isMultiplication() && num->isNumber()) { for(size_t i2 = 0; i2 < mnum->size(); i2++) { num->multiply((*mnum)[i2], true); } } else { num->multiply(*mnum, ns > 1); } } else { num->set(*mnum); } ns++; mnum = NULL; } if(mden) { if(ds > 0) { if(mden->isMultiplication() && den->isNumber()) { for(size_t i2 = 0; i2 < mden->size(); i2++) { den->multiply((*mden)[i2], true); } } else { den->multiply(*mden, ds > 1); } } else { den->set(*mden); } ds++; mden = NULL; } } clear(true); m_type = STRUCT_DIVISION; if(num->isUndefined()) num->set(m_one); APPEND_POINTER(num); APPEND_POINTER(den); num->formatsub(po, this, 1, false); den->formatsub(po, this, 2, false); formatsub(po, parent, pindex, false); break; } size_t index = 0; if(CHILD(0).isOne()) { index = 1; } switch(CHILD(index).type()) { case STRUCT_POWER: { if(!CHILD(index)[0].isUnit_exp()) { break; } } case STRUCT_UNIT: { if(index == 0) { if(!parent || (!parent->isPower() && !parent->isMultiplication() && !parent->isInverse() && (!parent->isDivision() || pindex != 2))) { PREPEND(m_one); } } break; } default: { if(index == 1) { ERASE(0); if(SIZE == 1) { setToChild(1, true); } } } } break; } case STRUCT_UNIT: { if(po.preserve_format) break; if(!parent || (!parent->isPower() && !parent->isMultiplication() && !parent->isInverse() && !(parent->isDivision() && pindex == 2))) { multiply(m_one); SWAP_CHILDREN(0, 1); } break; } case STRUCT_POWER: { if(po.preserve_format) break; if(!po.negative_exponents && CHILD(1).isNegate() && (!CHILD(0).isVector() || !CHILD(1).isMinusOne())) { if(CHILD(1)[0].isOne()) { m_type = STRUCT_INVERSE; ERASE(1); } else { CHILD(1).setToChild(1, true); transform(STRUCT_INVERSE); } formatsub(po, parent, pindex, false); } else if(po.halfexp_to_sqrt && ((CHILD(1).isDivision() && CHILD(1)[0].isNumber() && CHILD(1)[0].number().isInteger() && CHILD(1)[1].isNumber() && CHILD(1)[1].number().isTwo() && ((!po.negative_exponents && CHILD(0).countChildren() == 0) || CHILD(1)[0].isOne())) || (CHILD(1).isNumber() && CHILD(1).number().denominatorIsTwo() && ((!po.negative_exponents && CHILD(0).countChildren() == 0) || CHILD(1).number().numeratorIsOne())) || (CHILD(1).isInverse() && CHILD(1)[0].isNumber() && CHILD(1)[0].number() == 2))) { if(CHILD(1).isInverse() || (CHILD(1).isDivision() && CHILD(1)[0].number().isOne()) || (CHILD(1).isNumber() && CHILD(1).number().numeratorIsOne())) { m_type = STRUCT_FUNCTION; ERASE(1) o_function = CALCULATOR->f_sqrt; } else { if(CHILD(1).isNumber()) { CHILD(1).number() -= Number(1, 2); } else { Number nr = CHILD(1)[0].number(); nr /= CHILD(1)[1].number(); nr.floor(); CHILD(1).set(nr); } if(CHILD(1).number().isOne()) { setToChild(1, true); if(parent && parent->isMultiplication()) { parent->insertChild(MathStructure(CALCULATOR->f_sqrt, this, NULL), pindex + 1); } else { multiply(MathStructure(CALCULATOR->f_sqrt, this, NULL)); } } else { if(parent && parent->isMultiplication()) { parent->insertChild(MathStructure(CALCULATOR->f_sqrt, &CHILD(0), NULL), pindex + 1); } else { multiply(MathStructure(CALCULATOR->f_sqrt, &CHILD(0), NULL)); } } } formatsub(po, parent, pindex, false); } else if(CHILD(0).isUnit_exp() && (!parent || (!parent->isPower() && !parent->isMultiplication() && !parent->isInverse() && !(parent->isDivision() && pindex == 2)))) { multiply(m_one); SWAP_CHILDREN(0, 1); } break; } case STRUCT_NUMBER: { if(o_number.isNegative()) { o_number.negate(); transform(STRUCT_NEGATE); formatsub(po, parent, pindex); } else if(po.number_fraction_format == FRACTION_COMBINED && po.base != BASE_SEXAGESIMAL && po.base != BASE_TIME && o_number.isRational() && !o_number.isInteger()) { if(o_number.isFraction()) { Number num(o_number.numerator()); Number den(o_number.denominator()); clear(true); if(num.isOne()) { m_type = STRUCT_INVERSE; } else { m_type = STRUCT_DIVISION; APPEND_NEW(num); } APPEND_NEW(den); } else { Number frac(o_number); frac.frac(); MathStructure *num = new MathStructure(frac.numerator()); num->transform(STRUCT_DIVISION, frac.denominator()); o_number.trunc(); add_nocopy(num); } } else if((po.number_fraction_format == FRACTION_FRACTIONAL || po.base == BASE_ROMAN_NUMERALS) && po.base != BASE_SEXAGESIMAL && po.base != BASE_TIME && o_number.isRational() && !o_number.isInteger()) { Number num(o_number.numerator()); Number den(o_number.denominator()); clear(true); if(num.isOne()) { m_type = STRUCT_INVERSE; } else { m_type = STRUCT_DIVISION; APPEND_NEW(num); } APPEND_NEW(den); } else if(po.number_fraction_format == FRACTION_DECIMAL_EXACT && po.base != BASE_SEXAGESIMAL && po.base != BASE_TIME && o_number.isRational() && !o_number.isInteger() && !o_number.isApproximate()) { string str_den = ""; InternalPrintStruct ips_n; if(isApproximate()) ips_n.parent_approximate = true; ips_n.parent_precision = precision(); ips_n.den = &str_den; PrintOptions po2 = po; po2.is_approximate = NULL; o_number.print(po2, ips_n); if(!str_den.empty()) { Number num(o_number.numerator()); Number den(o_number.denominator()); clear(true); if(num.isOne()) { m_type = STRUCT_INVERSE; } else { m_type = STRUCT_DIVISION; APPEND_NEW(num); } APPEND_NEW(den); } } else if(o_number.isComplex()) { if(o_number.hasRealPart()) { Number re(o_number.realPart()); Number im(o_number.imaginaryPart()); MathStructure *mstruct = new MathStructure(im); if(im.isOne()) { mstruct->set(CALCULATOR->v_i); } else { mstruct->multiply_nocopy(new MathStructure(CALCULATOR->v_i)); } o_number = re; add_nocopy(mstruct); formatsub(po, parent, pindex); } else { Number im(o_number.imaginaryPart()); if(im.isOne()) { set(CALCULATOR->v_i, true); } else if(im.isMinusOne()) { set(CALCULATOR->v_i, true); transform(STRUCT_NEGATE); } else { o_number = im; multiply_nocopy(new MathStructure(CALCULATOR->v_i)); } formatsub(po, parent, pindex); } } break; } default: {} } } int namelen(const MathStructure &mstruct, const PrintOptions &po, const InternalPrintStruct&, bool *abbreviated = NULL) { const string *str; switch(mstruct.type()) { case STRUCT_FUNCTION: { const ExpressionName *ename = &mstruct.function()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); str = &ename->name; if(abbreviated) *abbreviated = ename->abbreviation; break; } case STRUCT_VARIABLE: { const ExpressionName *ename = &mstruct.variable()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); str = &ename->name; if(abbreviated) *abbreviated = ename->abbreviation; break; } case STRUCT_SYMBOLIC: { str = &mstruct.symbol(); if(abbreviated) *abbreviated = false; break; } case STRUCT_UNIT: { const ExpressionName *ename = &mstruct.unit()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, mstruct.isPlural(), po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); str = &ename->name; if(abbreviated) *abbreviated = ename->abbreviation; break; } default: {if(abbreviated) *abbreviated = false; return 0;} } if(text_length_is_one(*str)) return 1; return str->length(); } bool MathStructure::needsParenthesis(const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool flat_division, bool) const { if(o_uncertainty) return true; switch(parent.type()) { case STRUCT_MULTIPLICATION: { switch(m_type) { case STRUCT_MULTIPLICATION: {return true;} case STRUCT_DIVISION: {return flat_division;} case STRUCT_INVERSE: {return flat_division;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return po.excessive_parenthesis;} case STRUCT_NEGATE: {return po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return po.excessive_parenthesis;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return po.excessive_parenthesis;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return false;} case STRUCT_VARIABLE: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return po.excessive_parenthesis;} default: {return true;} } } case STRUCT_INVERSE: {} case STRUCT_DIVISION: { switch(m_type) { case STRUCT_MULTIPLICATION: {return flat_division || po.excessive_parenthesis;} case STRUCT_DIVISION: {return flat_division || po.excessive_parenthesis;} case STRUCT_INVERSE: {return flat_division || po.excessive_parenthesis;} case STRUCT_ADDITION: {return flat_division || po.excessive_parenthesis;} case STRUCT_POWER: {return flat_division && po.excessive_parenthesis;} case STRUCT_NEGATE: {return flat_division && po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return flat_division || po.excessive_parenthesis;} case STRUCT_BITWISE_OR: {return flat_division || po.excessive_parenthesis;} case STRUCT_BITWISE_XOR: {return flat_division || po.excessive_parenthesis;} case STRUCT_BITWISE_NOT: {return flat_division && po.excessive_parenthesis;} case STRUCT_LOGICAL_AND: {return flat_division || po.excessive_parenthesis;} case STRUCT_LOGICAL_OR: {return flat_division || po.excessive_parenthesis;} case STRUCT_LOGICAL_XOR: {return flat_division || po.excessive_parenthesis;} case STRUCT_LOGICAL_NOT: {return flat_division && po.excessive_parenthesis;} case STRUCT_COMPARISON: {return flat_division || po.excessive_parenthesis;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return false;} case STRUCT_VARIABLE: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} default: {return true;} } } case STRUCT_ADDITION: { switch(m_type) { case STRUCT_MULTIPLICATION: {return po.excessive_parenthesis;} case STRUCT_DIVISION: {return flat_division && po.excessive_parenthesis;} case STRUCT_INVERSE: {return flat_division && po.excessive_parenthesis;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return po.excessive_parenthesis;} case STRUCT_NEGATE: {return index > 1 || po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return false;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return false;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return false;} case STRUCT_VARIABLE: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} default: {return true;} } } case STRUCT_POWER: { switch(m_type) { case STRUCT_MULTIPLICATION: {return true;} case STRUCT_DIVISION: {return index == 1 || flat_division || po.excessive_parenthesis;} case STRUCT_INVERSE: {return index == 1 || flat_division || po.excessive_parenthesis;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return true;} case STRUCT_NEGATE: {return index == 1 || CHILD(0).needsParenthesis(po, ips, parent, index, flat_division);} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return index == 1 || po.excessive_parenthesis;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return index == 1 || po.excessive_parenthesis;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return false;} case STRUCT_VARIABLE: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} default: {return true;} } } case STRUCT_NEGATE: { switch(m_type) { case STRUCT_MULTIPLICATION: {return po.excessive_parenthesis;} case STRUCT_DIVISION: {return po.excessive_parenthesis;} case STRUCT_INVERSE: {return flat_division && po.excessive_parenthesis;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return true;} case STRUCT_NEGATE: {return true;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return po.excessive_parenthesis;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return po.excessive_parenthesis;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return false;} case STRUCT_VARIABLE: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} default: {return true;} } } case STRUCT_LOGICAL_OR: {} case STRUCT_LOGICAL_AND: {} case STRUCT_LOGICAL_XOR: { switch(m_type) { case STRUCT_MULTIPLICATION: {return true;} case STRUCT_DIVISION: {return flat_division;} case STRUCT_INVERSE: {return flat_division;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return po.excessive_parenthesis;} case STRUCT_NEGATE: {return po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return false;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return false;} case STRUCT_COMPARISON: {return false;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return false;} case STRUCT_VARIABLE: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} default: {return true;} } } case STRUCT_BITWISE_AND: {} case STRUCT_BITWISE_OR: {} case STRUCT_BITWISE_XOR: { switch(m_type) { case STRUCT_MULTIPLICATION: {return true;} case STRUCT_DIVISION: {return flat_division;} case STRUCT_INVERSE: {return flat_division;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return po.excessive_parenthesis;} case STRUCT_NEGATE: {return po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return false;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return false;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return false;} case STRUCT_VARIABLE: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} default: {return true;} } } case STRUCT_COMPARISON: { switch(m_type) { case STRUCT_MULTIPLICATION: {return po.excessive_parenthesis;} case STRUCT_DIVISION: {return flat_division && po.excessive_parenthesis;} case STRUCT_INVERSE: {return flat_division && po.excessive_parenthesis;} case STRUCT_ADDITION: {return po.excessive_parenthesis;} case STRUCT_POWER: {return po.excessive_parenthesis;} case STRUCT_NEGATE: {return po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return false;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return false;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return false;} case STRUCT_VARIABLE: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} default: {return true;} } } case STRUCT_LOGICAL_NOT: {} case STRUCT_BITWISE_NOT: { switch(m_type) { case STRUCT_MULTIPLICATION: {return true;} case STRUCT_DIVISION: {return true;} case STRUCT_INVERSE: {return true;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return po.excessive_parenthesis;} case STRUCT_NEGATE: {return po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return true;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return true;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return po.excessive_parenthesis;} case STRUCT_VECTOR: {return po.excessive_parenthesis;} case STRUCT_NUMBER: {return po.excessive_parenthesis;} case STRUCT_VARIABLE: {return po.excessive_parenthesis;} case STRUCT_SYMBOLIC: {return po.excessive_parenthesis;} case STRUCT_UNIT: {return po.excessive_parenthesis;} case STRUCT_UNDEFINED: {return po.excessive_parenthesis;} default: {return true;} } } case STRUCT_FUNCTION: { return false; } case STRUCT_VECTOR: { return false; } default: { return true; } } } int MathStructure::neededMultiplicationSign(const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool par, bool par_prev, bool flat_division, bool flat_power) const { if(!po.short_multiplication) return MULTIPLICATION_SIGN_OPERATOR; if(index <= 1) return MULTIPLICATION_SIGN_NONE; if(par_prev && par) return MULTIPLICATION_SIGN_NONE; if(par_prev) { if(isUnit_exp()) return MULTIPLICATION_SIGN_SPACE; if(isMultiplication() || isDivision()) { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).isUnit_exp()) { return MULTIPLICATION_SIGN_OPERATOR; } } return MULTIPLICATION_SIGN_SPACE; } return MULTIPLICATION_SIGN_OPERATOR; } int t = parent[index - 2].type(); if(flat_power && t == STRUCT_POWER) return MULTIPLICATION_SIGN_OPERATOR; if(par && t == STRUCT_POWER) return MULTIPLICATION_SIGN_SPACE; if(par) return MULTIPLICATION_SIGN_NONE; bool abbr_prev = false, abbr_this = false; int namelen_prev = namelen(parent[index - 2], po, ips, &abbr_prev); int namelen_this = namelen(*this, po, ips, &abbr_this); switch(t) { case STRUCT_MULTIPLICATION: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_INVERSE: {} case STRUCT_DIVISION: {if(flat_division) return MULTIPLICATION_SIGN_OPERATOR; return MULTIPLICATION_SIGN_SPACE;} case STRUCT_ADDITION: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_POWER: {if(flat_power) return MULTIPLICATION_SIGN_OPERATOR; break;} case STRUCT_NEGATE: {break;} case STRUCT_BITWISE_AND: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_OR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_XOR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_NOT: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_AND: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_OR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_XOR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_NOT: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_COMPARISON: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_FUNCTION: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_VECTOR: {break;} case STRUCT_NUMBER: {break;} case STRUCT_VARIABLE: {break;} case STRUCT_SYMBOLIC: { break; } case STRUCT_UNIT: { if(m_type == STRUCT_UNIT) { if(!po.limit_implicit_multiplication && !abbr_prev && !abbr_this) { return MULTIPLICATION_SIGN_SPACE; } if(po.place_units_separately) { return MULTIPLICATION_SIGN_OPERATOR_SHORT; } else { return MULTIPLICATION_SIGN_OPERATOR; } } else if(m_type == STRUCT_NUMBER) { if(namelen_prev > 1) { return MULTIPLICATION_SIGN_SPACE; } else { return MULTIPLICATION_SIGN_NONE; } } //return MULTIPLICATION_SIGN_SPACE; } case STRUCT_UNDEFINED: {break;} default: {return MULTIPLICATION_SIGN_OPERATOR;} } switch(m_type) { case STRUCT_MULTIPLICATION: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_INVERSE: {} case STRUCT_DIVISION: {if(flat_division) return MULTIPLICATION_SIGN_OPERATOR; return MULTIPLICATION_SIGN_SPACE;} case STRUCT_ADDITION: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_POWER: {return CHILD(0).neededMultiplicationSign(po, ips, parent, index, par, par_prev, flat_division, flat_power);} case STRUCT_NEGATE: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_AND: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_OR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_XOR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_NOT: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_AND: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_OR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_XOR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_NOT: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_COMPARISON: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_FUNCTION: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_VECTOR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_NUMBER: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_VARIABLE: {} case STRUCT_SYMBOLIC: { if(po.limit_implicit_multiplication && t != STRUCT_NUMBER) return MULTIPLICATION_SIGN_OPERATOR; if(t != STRUCT_NUMBER && ((namelen_prev > 1 || namelen_this > 1) || equals(parent[index - 2]))) return MULTIPLICATION_SIGN_OPERATOR; if(namelen_this > 1 || (m_type == STRUCT_SYMBOLIC && !po.allow_non_usable)) return MULTIPLICATION_SIGN_SPACE; return MULTIPLICATION_SIGN_NONE; } case STRUCT_UNIT: { if(t == STRUCT_POWER && parent[index - 2][0].isUnit_exp()) { return MULTIPLICATION_SIGN_NONE; } return MULTIPLICATION_SIGN_SPACE; } case STRUCT_UNDEFINED: {return MULTIPLICATION_SIGN_OPERATOR;} default: {return MULTIPLICATION_SIGN_OPERATOR;} } } string MathStructure::print(const PrintOptions &po, const InternalPrintStruct &ips) const { if(ips.depth == 0 && po.is_approximate) *po.is_approximate = false; string print_str; InternalPrintStruct ips_n = ips; if(isApproximate()) ips_n.parent_approximate = true; if(precision() > 0 && (ips_n.parent_precision < 1 || precision() < ips_n.parent_precision)) ips_n.parent_precision = precision(); switch(m_type) { case STRUCT_NUMBER: { print_str = o_number.print(po, ips_n); break; } case STRUCT_SYMBOLIC: { if(po.allow_non_usable) { print_str = s_sym; } else { print_str = "\""; print_str += s_sym; print_str += "\""; } break; } case STRUCT_ADDITION: { ips_n.depth++; for(size_t i = 0; i < SIZE; i++) { if(i > 0) { if(CHILD(i).type() == STRUCT_NEGATE) { if(po.spacious) print_str += " "; if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MINUS, po.can_display_unicode_string_arg))) print_str += SIGN_MINUS; else print_str += "-"; if(po.spacious) print_str += " "; ips_n.wrap = CHILD(i)[0].needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i)[0].print(po, ips_n); } else { if(po.spacious) print_str += " "; print_str += "+"; if(po.spacious) print_str += " "; ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } } else { ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } } break; } case STRUCT_NEGATE: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MINUS, po.can_display_unicode_string_arg))) print_str += SIGN_MINUS; else print_str = "-"; ips_n.depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str += CHILD(0).print(po, ips_n); break; } case STRUCT_MULTIPLICATION: { ips_n.depth++; bool par_prev = false; for(size_t i = 0; i < SIZE; i++) { ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); if(!po.short_multiplication && i > 0) { if(po.spacious) print_str += " "; if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_DOT && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIDOT, po.can_display_unicode_string_arg))) print_str += SIGN_MULTIDOT; else if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_DOT && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_SMALLCIRCLE, po.can_display_unicode_string_arg))) print_str += SIGN_SMALLCIRCLE; else if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_X && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIPLICATION, po.can_display_unicode_string_arg))) print_str += SIGN_MULTIPLICATION; else print_str += "*"; if(po.spacious) print_str += " "; } else if(i > 0) { switch(CHILD(i).neededMultiplicationSign(po, ips_n, *this, i + 1, ips_n.wrap || (CHILD(i).isPower() && CHILD(i)[0].needsParenthesis(po, ips_n, CHILD(i), 1, true, true)), par_prev, true, true)) { case MULTIPLICATION_SIGN_SPACE: {print_str += " "; break;} case MULTIPLICATION_SIGN_OPERATOR: { if(po.spacious) { if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_DOT && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIDOT, po.can_display_unicode_string_arg))) print_str += " " SIGN_MULTIDOT " "; else if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_DOT && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_SMALLCIRCLE, po.can_display_unicode_string_arg))) print_str += " " SIGN_SMALLCIRCLE " "; else if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_X && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIPLICATION, po.can_display_unicode_string_arg))) print_str += " " SIGN_MULTIPLICATION " "; else print_str += " * "; break; } } case MULTIPLICATION_SIGN_OPERATOR_SHORT: { if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_DOT && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIDOT, po.can_display_unicode_string_arg))) print_str += SIGN_MULTIDOT; else if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_DOT && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_SMALLCIRCLE, po.can_display_unicode_string_arg))) print_str += SIGN_SMALLCIRCLE; else if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_X && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIPLICATION, po.can_display_unicode_string_arg))) print_str += SIGN_MULTIPLICATION; else print_str += "*"; break; } } } print_str += CHILD(i).print(po, ips_n); par_prev = ips_n.wrap; } break; } case STRUCT_INVERSE: { print_str = "1"; if(po.spacious) print_str += " "; if(po.use_unicode_signs && po.division_sign == DIVISION_SIGN_DIVISION && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_DIVISION, po.can_display_unicode_string_arg))) { print_str += SIGN_DIVISION; } else if(po.use_unicode_signs && po.division_sign == DIVISION_SIGN_DIVISION_SLASH && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_DIVISION_SLASH, po.can_display_unicode_string_arg))) { print_str += SIGN_DIVISION_SLASH; } else { print_str += "/"; } if(po.spacious) print_str += " "; ips_n.depth++; ips_n.division_depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str += CHILD(0).print(po, ips_n); break; } case STRUCT_DIVISION: { ips_n.depth++; ips_n.division_depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str = CHILD(0).print(po, ips_n); if(po.spacious) print_str += " "; if(po.use_unicode_signs && po.division_sign == DIVISION_SIGN_DIVISION && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_DIVISION, po.can_display_unicode_string_arg))) { print_str += SIGN_DIVISION; } else if(po.use_unicode_signs && po.division_sign == DIVISION_SIGN_DIVISION_SLASH && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_DIVISION_SLASH, po.can_display_unicode_string_arg))) { print_str += SIGN_DIVISION_SLASH; } else { print_str += "/"; } if(po.spacious) print_str += " "; ips_n.wrap = CHILD(1).needsParenthesis(po, ips_n, *this, 2, true, true); print_str += CHILD(1).print(po, ips_n); break; } case STRUCT_POWER: { ips_n.depth++; ips_n.power_depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str = CHILD(0).print(po, ips_n); print_str += "^"; ips_n.wrap = CHILD(1).needsParenthesis(po, ips_n, *this, 2, true, true); PrintOptions po2 = po; po2.show_ending_zeroes = false; print_str += CHILD(1).print(po2, ips_n); break; } case STRUCT_COMPARISON: { ips_n.depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str = CHILD(0).print(po, ips_n); if(po.spacious) print_str += " "; switch(ct_comp) { case COMPARISON_EQUALS: {print_str += "="; break;} case COMPARISON_NOT_EQUALS: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_NOT_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_NOT_EQUAL; else print_str += "!="; break; } case COMPARISON_GREATER: {print_str += ">"; break;} case COMPARISON_LESS: {print_str += "<"; break;} case COMPARISON_EQUALS_GREATER: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_GREATER_OR_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_GREATER_OR_EQUAL; else print_str += ">="; break; } case COMPARISON_EQUALS_LESS: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_LESS_OR_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_LESS_OR_EQUAL; else print_str += "<="; break; } } if(po.spacious) print_str += " "; ips_n.wrap = CHILD(1).needsParenthesis(po, ips_n, *this, 2, true, true); print_str += CHILD(1).print(po, ips_n); break; } case STRUCT_BITWISE_AND: { ips_n.depth++; for(size_t i = 0; i < SIZE; i++) { if(i > 0) { if(po.spacious) print_str += " "; print_str += "&"; if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } break; } case STRUCT_BITWISE_OR: { ips_n.depth++; for(size_t i = 0; i < SIZE; i++) { if(i > 0) { if(po.spacious) print_str += " "; print_str += "|"; if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } break; } case STRUCT_BITWISE_XOR: { ips_n.depth++; for(size_t i = 0; i < SIZE; i++) { if(i > 0) { if(po.spacious) print_str += " "; print_str += "XOR"; if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } break; } case STRUCT_BITWISE_NOT: { print_str = "~"; ips_n.depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str += CHILD(0).print(po, ips_n); break; } case STRUCT_LOGICAL_AND: { ips_n.depth++; if(!po.preserve_format && SIZE == 2 && CHILD(0).isComparison() && CHILD(1).isComparison() && CHILD(0).comparisonType() != COMPARISON_EQUALS && CHILD(0).comparisonType() != COMPARISON_NOT_EQUALS && CHILD(1).comparisonType() != COMPARISON_EQUALS && CHILD(1).comparisonType() != COMPARISON_NOT_EQUALS && CHILD(0)[0] == CHILD(1)[0]) { ips_n.wrap = CHILD(0)[1].needsParenthesis(po, ips_n, CHILD(0), 2, true, true); print_str += CHILD(0)[1].print(po, ips_n); if(po.spacious) print_str += " "; switch(CHILD(0).comparisonType()) { case COMPARISON_LESS: {print_str += ">"; break;} case COMPARISON_GREATER: {print_str += "<"; break;} case COMPARISON_EQUALS_LESS: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_GREATER_OR_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_GREATER_OR_EQUAL; else print_str += ">="; break; } case COMPARISON_EQUALS_GREATER: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_LESS_OR_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_LESS_OR_EQUAL; else print_str += "<="; break; } default: {} } if(po.spacious) print_str += " "; ips_n.wrap = CHILD(0)[0].needsParenthesis(po, ips_n, CHILD(0), 1, true, true); print_str += CHILD(0)[0].print(po, ips_n); if(po.spacious) print_str += " "; switch(CHILD(1).comparisonType()) { case COMPARISON_GREATER: {print_str += ">"; break;} case COMPARISON_LESS: {print_str += "<"; break;} case COMPARISON_EQUALS_GREATER: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_GREATER_OR_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_GREATER_OR_EQUAL; else print_str += ">="; break; } case COMPARISON_EQUALS_LESS: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_LESS_OR_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_LESS_OR_EQUAL; else print_str += "<="; break; } default: {} } if(po.spacious) print_str += " "; ips_n.wrap = CHILD(1)[1].needsParenthesis(po, ips_n, CHILD(1), 2, true, true); print_str += CHILD(1)[1].print(po, ips_n); break; } for(size_t i = 0; i < SIZE; i++) { if(i > 0) { if(po.spacious) print_str += " "; if(po.spell_out_logical_operators) print_str += _("and"); else print_str += "&&"; if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } break; } case STRUCT_LOGICAL_OR: { ips_n.depth++; for(size_t i = 0; i < SIZE; i++) { if(i > 0) { if(po.spacious) print_str += " "; if(po.spell_out_logical_operators) print_str += _("or"); else print_str += "||"; if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } break; } case STRUCT_LOGICAL_XOR: { ips_n.depth++; for(size_t i = 0; i < SIZE; i++) { if(i > 0) { if(po.spacious) print_str += " "; print_str += "XOR"; if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } break; } case STRUCT_LOGICAL_NOT: { print_str = "!"; ips_n.depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str += CHILD(0).print(po, ips_n); break; } case STRUCT_VECTOR: { ips_n.depth++; print_str = "["; for(size_t i = 0; i < SIZE; i++) { if(i > 0) { print_str += po.comma(); if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } print_str += "]"; break; } case STRUCT_UNIT: { const ExpressionName *ename = &o_unit->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, b_plural, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); if(o_prefix) print_str += o_prefix->name(po.abbreviate_names && ename->abbreviation, po.use_unicode_signs, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); print_str += ename->name; if(po.hide_underscore_spaces && !ename->suffix) { gsub("_", " ", print_str); } break; } case STRUCT_VARIABLE: { const ExpressionName *ename = &o_variable->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); print_str += ename->name; if(po.hide_underscore_spaces && !ename->suffix) { gsub("_", " ", print_str); } break; } case STRUCT_FUNCTION: { ips_n.depth++; const ExpressionName *ename = &o_function->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); print_str += ename->name; if(po.hide_underscore_spaces && !ename->suffix) { gsub("_", " ", print_str); } print_str += "("; for(size_t i = 0; i < SIZE; i++) { if(i > 0) { print_str += po.comma(); if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } print_str += ")"; break; } case STRUCT_UNDEFINED: { print_str = _("undefined"); break; } } if(o_uncertainty) { if(SIZE > 0) { print_str.insert(0, "("); print_str += ")"; } print_str += SIGN_PLUSMINUS; if(o_uncertainty->size() > 0) print_str += "("; print_str += o_uncertainty->print(po); if(o_uncertainty->size() > 0) print_str += ")"; } if(ips.wrap) { print_str.insert(0, "("); print_str += ")"; } return print_str; } MathStructure &MathStructure::flattenVector(MathStructure &mstruct) const { if(!isVector()) { mstruct = *this; return mstruct; } MathStructure mstruct2; mstruct.clearVector(); for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isVector()) { CHILD(i).flattenVector(mstruct2); for(size_t i2 = 0; i2 < mstruct2.size(); i2++) { mstruct.addChild(mstruct2[i2]); } } else { mstruct.addChild(CHILD(i)); } } return mstruct; } bool MathStructure::rankVector(bool ascending) { vector ranked; vector ranked_equals_prev; bool b; for(size_t index = 0; index < SIZE; index++) { b = false; for(size_t i = 0; i < ranked.size(); i++) { ComparisonResult cmp = CHILD(index).compare(CHILD(ranked[i])); if(COMPARISON_NOT_FULLY_KNOWN(cmp)) { CALCULATOR->error(true, _("Unsolvable comparison at element %s when trying to rank vector."), i2s(index).c_str(), NULL); return false; } if((ascending && cmp == COMPARISON_RESULT_GREATER) || cmp == COMPARISON_RESULT_EQUAL || (!ascending && cmp == COMPARISON_RESULT_LESS)) { if(cmp == COMPARISON_RESULT_EQUAL) { ranked.insert(ranked.begin() + i + 1, index); ranked_equals_prev.insert(ranked_equals_prev.begin() + i + 1, true); } else { ranked.insert(ranked.begin() + i, index); ranked_equals_prev.insert(ranked_equals_prev.begin() + i, false); } b = true; break; } } if(!b) { ranked.push_back(index); ranked_equals_prev.push_back(false); } } int n_rep = 0; for(int i = (int) ranked.size() - 1; i >= 0; i--) { if(ranked_equals_prev[i]) { n_rep++; } else { if(n_rep) { MathStructure v(i + 1 + n_rep, 1); v += i + 1; v *= MathStructure(1, 2); for(; n_rep >= 0; n_rep--) { CHILD(ranked[i + n_rep]) = v; } } else { CHILD(ranked[i]).set(i + 1, 1); } n_rep = 0; } } return true; } bool MathStructure::sortVector(bool ascending) { vector ranked_mstructs; bool b; for(size_t index = 0; index < SIZE; index++) { b = false; for(size_t i = 0; i < ranked_mstructs.size(); i++) { ComparisonResult cmp = CHILD(index).compare(*v_subs[ranked_mstructs[i]]); if(COMPARISON_MIGHT_BE_LESS_OR_GREATER(cmp)) { CALCULATOR->error(true, _("Unsolvable comparison at element %s when trying to sort vector."), i2s(index).c_str(), NULL); return false; } if((ascending && COMPARISON_IS_EQUAL_OR_GREATER(cmp)) || (!ascending && COMPARISON_IS_EQUAL_OR_LESS(cmp))) { ranked_mstructs.insert(ranked_mstructs.begin() + i, v_order[index]); b = true; break; } } if(!b) { ranked_mstructs.push_back(v_order[index]); } } v_order = ranked_mstructs; return true; } MathStructure &MathStructure::getRange(int start, int end, MathStructure &mstruct) const { if(!isVector()) { if(start > 1) { mstruct.clear(); return mstruct; } else { mstruct = *this; return mstruct; } } if(start < 1) start = 1; else if(start > (int) SIZE) { mstruct.clear(); return mstruct; } if(end < (int) 1 || end > (int) SIZE) end = SIZE; else if(end < start) end = start; mstruct.clearVector(); for(; start <= end; start++) { mstruct.addChild(CHILD(start - 1)); } return mstruct; } void MathStructure::resizeVector(size_t i, const MathStructure &mfill) { if(i > SIZE) { while(i > SIZE) { APPEND(mfill); } } else if(i > SIZE) { REDUCE(i) } } size_t MathStructure::rows() const { if(m_type != STRUCT_VECTOR || SIZE == 0 || (SIZE == 1 && (!CHILD(0).isVector() || CHILD(0).size() == 0))) return 0; return SIZE; } size_t MathStructure::columns() const { if(m_type != STRUCT_VECTOR || SIZE == 0 || !CHILD(0).isVector()) return 0; return CHILD(0).size(); } const MathStructure *MathStructure::getElement(size_t row, size_t column) const { if(row == 0 || column == 0 || row > rows() || column > columns()) return NULL; if(CHILD(row - 1).size() < column) return NULL; return &CHILD(row - 1)[column - 1]; } MathStructure *MathStructure::getElement(size_t row, size_t column) { if(row == 0 || column == 0 || row > rows() || column > columns()) return NULL; if(CHILD(row - 1).size() < column) return NULL; return &CHILD(row - 1)[column - 1]; } MathStructure &MathStructure::getArea(size_t r1, size_t c1, size_t r2, size_t c2, MathStructure &mstruct) const { size_t r = rows(); size_t c = columns(); if(r1 < 1) r1 = 1; else if(r1 > r) r1 = r; if(c1 < 1) c1 = 1; else if(c1 > c) c1 = c; if(r2 < 1 || r2 > r) r2 = r; else if(r2 < r1) r2 = r1; if(c2 < 1 || c2 > c) c2 = c; else if(c2 < c1) c2 = c1; mstruct.clearMatrix(); mstruct.resizeMatrix(r2 - r1 + 1, c2 - c1 + 1, m_undefined); for(size_t index_r = r1; index_r <= r2; index_r++) { for(size_t index_c = c1; index_c <= c2; index_c++) { mstruct[index_r - r1][index_c - c1] = CHILD(index_r - 1)[index_c - 1]; } } return mstruct; } MathStructure &MathStructure::rowToVector(size_t r, MathStructure &mstruct) const { if(r > rows()) { mstruct = m_undefined; return mstruct; } if(r < 1) r = 1; mstruct = CHILD(r - 1); return mstruct; } MathStructure &MathStructure::columnToVector(size_t c, MathStructure &mstruct) const { if(c > columns()) { mstruct = m_undefined; return mstruct; } if(c < 1) c = 1; mstruct.clearVector(); for(size_t i = 0; i < SIZE; i++) { mstruct.addChild(CHILD(i)[c - 1]); } return mstruct; } MathStructure &MathStructure::matrixToVector(MathStructure &mstruct) const { if(!isVector()) { mstruct = *this; return mstruct; } mstruct.clearVector(); for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isVector()) { for(size_t i2 = 0; i2 < CHILD(i).size(); i2++) { mstruct.addChild(CHILD(i)[i2]); } } else { mstruct.addChild(CHILD(i)); } } return mstruct; } void MathStructure::setElement(const MathStructure &mstruct, size_t row, size_t column) { if(row > rows() || column > columns() || row < 1 || column < 1) return; CHILD(row - 1)[column - 1] = mstruct; CHILD(row - 1).childUpdated(column); CHILD_UPDATED(row - 1); } void MathStructure::addRows(size_t r, const MathStructure &mfill) { if(r == 0) return; size_t cols = columns(); MathStructure mstruct; mstruct.clearVector(); mstruct.resizeVector(cols, mfill); for(size_t i = 0; i < r; i++) { APPEND(mstruct); } } void MathStructure::addColumns(size_t c, const MathStructure &mfill) { if(c == 0) return; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isVector()) { for(size_t i2 = 0; i2 < c; i2++) { CHILD(i).addChild(mfill); } } } CHILDREN_UPDATED; } void MathStructure::addRow(const MathStructure &mfill) { addRows(1, mfill); } void MathStructure::addColumn(const MathStructure &mfill) { addColumns(1, mfill); } void MathStructure::resizeMatrix(size_t r, size_t c, const MathStructure &mfill) { if(r > SIZE) { addRows(r - SIZE, mfill); } else if(r != SIZE) { REDUCE(r); } size_t cols = columns(); if(c > cols) { addColumns(c - cols, mfill); } else if(c != cols) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).resizeVector(c, mfill); } } } bool MathStructure::matrixIsSquare() const { return rows() == columns(); } bool MathStructure::isNumericMatrix() const { if(!isMatrix()) return false; for(size_t index_r = 0; index_r < SIZE; index_r++) { for(size_t index_c = 0; index_c < CHILD(index_r).size(); index_c++) { if(!CHILD(index_r)[index_c].isNumber() || CHILD(index_r)[index_c].isInfinity()) return false; } } return true; } //from GiNaC int MathStructure::pivot(size_t ro, size_t co, bool symbolic) { size_t k = ro; if(symbolic) { while((k < SIZE) && (CHILD(k)[co].isZero())) ++k; } else { size_t kmax = k + 1; Number mmax(CHILD(kmax)[co].number()); mmax.abs(); while(kmax < SIZE) { if(CHILD(kmax)[co].number().isNegative()) { Number ntmp(CHILD(kmax)[co].number()); ntmp.negate(); if(ntmp.isGreaterThan(mmax)) { mmax = ntmp; k = kmax; } } else if(CHILD(kmax)[co].number().isGreaterThan(mmax)) { mmax = CHILD(kmax)[co].number(); k = kmax; } ++kmax; } if(!mmax.isZero()) k = kmax; } if(k == SIZE) return -1; if(k == ro) return 0; SWAP_CHILDREN(ro, k) return k; } //from GiNaC void determinant_minor(const MathStructure &mtrx, MathStructure &mdet, const EvaluationOptions &eo) { size_t n = mtrx.size(); if(n == 1) { mdet = mtrx[0][0]; return; } if(n == 2) { mdet = mtrx[0][0]; mdet.calculateMultiply(mtrx[1][1], eo); mdet.add(mtrx[1][0], true); mdet[mdet.size() - 1].calculateMultiply(mtrx[0][1], eo); mdet[mdet.size() - 1].calculateNegate(eo); mdet.calculateAddLast(eo); return; } if(n == 3) { mdet = mtrx[0][0]; mdet.calculateMultiply(mtrx[1][1], eo); mdet.calculateMultiply(mtrx[2][2], eo); mdet.add(mtrx[0][0], true); mdet[mdet.size() - 1].calculateMultiply(mtrx[1][2], eo); mdet[mdet.size() - 1].calculateMultiply(mtrx[2][1], eo); mdet[mdet.size() - 1].calculateNegate(eo); mdet.calculateAddLast(eo); mdet.add(mtrx[0][1], true); mdet[mdet.size() - 1].calculateMultiply(mtrx[1][0], eo); mdet[mdet.size() - 1].calculateMultiply(mtrx[2][2], eo); mdet[mdet.size() - 1].calculateNegate(eo); mdet.calculateAddLast(eo); mdet.add(mtrx[0][2], true); mdet[mdet.size() - 1].calculateMultiply(mtrx[1][0], eo); mdet[mdet.size() - 1].calculateMultiply(mtrx[2][1], eo); mdet.calculateAddLast(eo); mdet.add(mtrx[0][1], true); mdet[mdet.size() - 1].calculateMultiply(mtrx[1][2], eo); mdet[mdet.size() - 1].calculateMultiply(mtrx[2][0], eo); mdet.calculateAddLast(eo); mdet.add(mtrx[0][2], true); mdet[mdet.size() - 1].calculateMultiply(mtrx[1][1], eo); mdet[mdet.size() - 1].calculateMultiply(mtrx[2][0], eo); mdet[mdet.size() - 1].calculateNegate(eo); mdet.calculateAddLast(eo); return; } std::vector Pkey; Pkey.reserve(n); std::vector Mkey; Mkey.reserve(n - 1); typedef std::map, class MathStructure> Rmap; typedef std::map, class MathStructure>::value_type Rmap_value; Rmap A; Rmap B; for(size_t r = 0; r < n; ++r) { Pkey.erase(Pkey.begin(), Pkey.end()); Pkey.push_back(r); A.insert(Rmap_value(Pkey, mtrx[r][n - 1])); } for(int c = n - 2; c >= 0; --c) { Pkey.erase(Pkey.begin(), Pkey.end()); Mkey.erase(Mkey.begin(), Mkey.end()); for(size_t i = 0; i < n - c; ++i) Pkey.push_back(i); size_t fc = 0; do { mdet.clear(); for(size_t r = 0; r < n - c; ++r) { if (mtrx[Pkey[r]][c].isZero()) continue; Mkey.erase(Mkey.begin(), Mkey.end()); for(size_t i = 0; i < n - c; ++i) { if(i != r) Mkey.push_back(Pkey[i]); } mdet.add(mtrx[Pkey[r]][c], true); mdet[mdet.size() - 1].calculateMultiply(A[Mkey], eo); if(r % 2) mdet[mdet.size() - 1].calculateNegate(eo); mdet.calculateAddLast(eo); } if(!mdet.isZero()) B.insert(Rmap_value(Pkey, mdet)); for(fc = n - c; fc > 0; --fc) { ++Pkey[fc-1]; if(Pkey[fc - 1] < fc + c) break; } if(fc < n - c && fc > 0) { for(size_t j = fc; j < n - c; ++j) Pkey[j] = Pkey[j - 1] + 1; } } while(fc); A = B; B.clear(); } return; } //from GiNaC int MathStructure::gaussianElimination(const EvaluationOptions &eo, bool det) { if(!isMatrix()) return 0; bool isnumeric = isNumericMatrix(); size_t m = rows(); size_t n = columns(); int sign = 1; size_t r0 = 0; for(size_t c0 = 0; c0 < n && r0 < m - 1; ++c0) { int indx = pivot(r0, c0, true); if(indx == -1) { sign = 0; if(det) return 0; } if(indx >= 0) { if(indx > 0) sign = -sign; for(size_t r2 = r0 + 1; r2 < m; ++r2) { if(!CHILD(r2)[c0].isZero()) { if(isnumeric) { Number piv(CHILD(r2)[c0].number()); piv /= CHILD(r0)[c0].number(); for(size_t c = c0 + 1; c < n; ++c) { CHILD(r2)[c].number() -= piv * CHILD(r0)[c].number(); } } else { MathStructure piv(CHILD(r2)[c0]); piv.calculateDivide(CHILD(r0)[c0], eo); for(size_t c = c0 + 1; c < n; ++c) { CHILD(r2)[c].add(piv, true); CHILD(r2)[c][CHILD(r2)[c].size() - 1].calculateMultiply(CHILD(r0)[c], eo); CHILD(r2)[c][CHILD(r2)[c].size() - 1].calculateNegate(eo); CHILD(r2)[c].calculateAddLast(eo); } } } for(size_t c = r0; c <= c0; ++c) CHILD(r2)[c].clear(); } if(det) { for(size_t c = r0 + 1; c < n; ++c) CHILD(r0)[c].clear(); } ++r0; } } for(size_t r = r0 + 1; r < m; ++r) { for(size_t c = 0; c < n; ++c) CHILD(r)[c].clear(); } return sign; } //from GiNaC template int permutation_sign(It first, It last) { if (first == last) return 0; --last; if (first == last) return 0; It flag = first; int sign = 1; do { It i = last, other = last; --other; bool swapped = false; while (i != first) { if (*i < *other) { std::iter_swap(other, i); flag = other; swapped = true; sign = -sign; } else if (!(*other < *i)) return 0; --i; --other; } if (!swapped) return sign; ++flag; if (flag == last) return sign; first = flag; i = first; other = first; ++other; swapped = false; while (i != last) { if (*other < *i) { std::iter_swap(i, other); flag = other; swapped = true; sign = -sign; } else if (!(*i < *other)) return 0; ++i; ++other; } if (!swapped) return sign; last = flag; --last; } while (first != last); return sign; } //from GiNaC MathStructure &MathStructure::determinant(MathStructure &mstruct, const EvaluationOptions &eo) const { if(!matrixIsSquare()) { CALCULATOR->error(true, _("The determinant can only be calculated for square matrices."), NULL); mstruct = m_undefined; return mstruct; } if(SIZE == 1) { mstruct = CHILD(0)[0]; } else if(isNumericMatrix()) { mstruct.set(1, 1); MathStructure mtmp(*this); int sign = mtmp.gaussianElimination(eo, true); for(size_t d = 0; d < SIZE; ++d) { mstruct.number() *= mtmp[d][d].number(); } mstruct.number() *= sign; } else { typedef std::pair sizet_pair; std::vector c_zeros; for(size_t c = 0; c < CHILD(0).size(); ++c) { size_t acc = 0; for(size_t r = 0; r < SIZE; ++r) { if(CHILD(r)[c].isZero()) ++acc; } c_zeros.push_back(sizet_pair(acc, c)); } std::sort(c_zeros.begin(), c_zeros.end()); std::vector pre_sort; for(std::vector::const_iterator i = c_zeros.begin(); i != c_zeros.end(); ++i) { pre_sort.push_back(i->second); } std::vector pre_sort_test(pre_sort); int sign = permutation_sign(pre_sort_test.begin(), pre_sort_test.end()); MathStructure result; result.clearMatrix(); result.resizeMatrix(SIZE, CHILD(0).size(), m_zero); size_t c = 0; for(std::vector::const_iterator i = pre_sort.begin(); i != pre_sort.end(); ++i,++c) { for(size_t r = 0; r < SIZE; ++r) result[r][c] = CHILD(r)[(*i)]; } mstruct.clear(); determinant_minor(result, mstruct, eo); if(sign != 1) { mstruct.calculateMultiply(sign, eo); } } mstruct.mergePrecision(*this); return mstruct; } MathStructure &MathStructure::permanent(MathStructure &mstruct, const EvaluationOptions &eo) const { if(!matrixIsSquare()) { CALCULATOR->error(true, _("The permanent can only be calculated for square matrices."), NULL); mstruct = m_undefined; return mstruct; } if(b_approx) mstruct.setApproximate(); mstruct.setPrecision(i_precision); if(SIZE == 1) { if(CHILD(0).size() >= 1) { mstruct == CHILD(0)[0]; } } else if(SIZE == 2) { mstruct = CHILD(0)[0]; if(IS_REAL(mstruct) && IS_REAL(CHILD(1)[1])) { mstruct.number() *= CHILD(1)[1].number(); } else { mstruct.calculateMultiply(CHILD(1)[1], eo); } if(IS_REAL(mstruct) && IS_REAL(CHILD(1)[0]) && IS_REAL(CHILD(0)[1])) { mstruct.number() += CHILD(1)[0].number() * CHILD(0)[1].number(); } else { MathStructure mtmp = CHILD(1)[0]; mtmp.calculateMultiply(CHILD(0)[1], eo); mstruct.calculateAdd(mtmp, eo); } } else { MathStructure mtrx; mtrx.clearMatrix(); mtrx.resizeMatrix(SIZE - 1, CHILD(0).size() - 1, m_undefined); for(size_t index_c = 0; index_c < CHILD(0).size(); index_c++) { for(size_t index_r2 = 1; index_r2 < SIZE; index_r2++) { for(size_t index_c2 = 0; index_c2 < CHILD(index_r2).size(); index_c2++) { if(index_c2 > index_c) { mtrx.setElement(CHILD(index_r2)[index_c2], index_r2, index_c2); } else if(index_c2 < index_c) { mtrx.setElement(CHILD(index_r2)[index_c2], index_r2, index_c2 + 1); } } } MathStructure mdet; mtrx.permanent(mdet, eo); if(IS_REAL(mdet) && IS_REAL(CHILD(0)[index_c])) { mdet.number() *= CHILD(0)[index_c].number(); } else { mdet.calculateMultiply(CHILD(0)[index_c], eo); } if(IS_REAL(mdet) && IS_REAL(mstruct)) { mstruct.number() += mdet.number(); } else { mstruct.calculateAdd(mdet, eo); } } } return mstruct; } void MathStructure::setToIdentityMatrix(size_t n) { clearMatrix(); resizeMatrix(n, n, m_zero); for(size_t i = 0; i < n; i++) { CHILD(i)[i] = m_one; } } MathStructure &MathStructure::getIdentityMatrix(MathStructure &mstruct) const { mstruct.setToIdentityMatrix(columns()); return mstruct; } //modified algorithm from eigenmath bool MathStructure::invertMatrix(const EvaluationOptions &eo) { if(!matrixIsSquare()) return false; if(isNumericMatrix()) { int d, i, j, n = SIZE; MathStructure idstruct; Number mtmp; idstruct.setToIdentityMatrix(n); MathStructure mtrx(*this); for(d = 0; d < n; d++) { if(mtrx[d][d].isZero()) { for (i = d + 1; i < n; i++) { if(!mtrx[i][d].isZero()) break; } if(i == n) { CALCULATOR->error(true, _("Inverse of singular matrix."), NULL); return false; } mtrx[i].ref(); mtrx[d].ref(); MathStructure *mptr = &mtrx[d]; mtrx.setChild_nocopy(&mtrx[i], d + 1); mtrx.setChild_nocopy(mptr, i + 1); idstruct[i].ref(); idstruct[d].ref(); mptr = &idstruct[d]; idstruct.setChild_nocopy(&idstruct[i], d + 1); idstruct.setChild_nocopy(mptr, i + 1); } mtmp = mtrx[d][d].number(); mtmp.recip(); for(j = 0; j < n; j++) { if(j > d) { mtrx[d][j].number() *= mtmp; } idstruct[d][j].number() *= mtmp; } for(i = 0; i < n; i++) { if(i == d) continue; mtmp = mtrx[i][d].number(); mtmp.negate(); for(j = 0; j < n; j++) { if(j > d) { mtrx[i][j].number() += mtrx[d][j].number() * mtmp; } idstruct[i][j].number() += idstruct[d][j].number() * mtmp; } } } set_nocopy(idstruct); MERGE_APPROX_AND_PREC(idstruct) } else { MathStructure *mstruct = new MathStructure(); determinant(*mstruct, eo); mstruct->calculateInverse(eo); adjointMatrix(eo); multiply_nocopy(mstruct, true); calculateMultiplyLast(eo); } return true; } bool MathStructure::adjointMatrix(const EvaluationOptions &eo) { if(!matrixIsSquare()) return false; MathStructure msave(*this); for(size_t index_r = 0; index_r < SIZE; index_r++) { for(size_t index_c = 0; index_c < CHILD(0).size(); index_c++) { msave.cofactor(index_r + 1, index_c + 1, CHILD(index_r)[index_c], eo); } } transposeMatrix(); return true; } bool MathStructure::transposeMatrix() { MathStructure msave(*this); resizeMatrix(CHILD(0).size(), SIZE, m_undefined); for(size_t index_r = 0; index_r < SIZE; index_r++) { for(size_t index_c = 0; index_c < CHILD(0).size(); index_c++) { CHILD(index_r)[index_c] = msave[index_c][index_r]; } } return true; } MathStructure &MathStructure::cofactor(size_t r, size_t c, MathStructure &mstruct, const EvaluationOptions &eo) const { if(r < 1) r = 1; if(c < 1) c = 1; if(r > SIZE || c > CHILD(0).size()) { mstruct = m_undefined; return mstruct; } r--; c--; mstruct.clearMatrix(); mstruct.resizeMatrix(SIZE - 1, CHILD(0).size() - 1, m_undefined); for(size_t index_r = 0; index_r < SIZE; index_r++) { if(index_r != r) { for(size_t index_c = 0; index_c < CHILD(0).size(); index_c++) { if(index_c > c) { if(index_r > r) { mstruct[index_r - 1][index_c - 1] = CHILD(index_r)[index_c]; } else { mstruct[index_r][index_c - 1] = CHILD(index_r)[index_c]; } } else if(index_c < c) { if(index_r > r) { mstruct[index_r - 1][index_c] = CHILD(index_r)[index_c]; } else { mstruct[index_r][index_c] = CHILD(index_r)[index_c]; } } } } } MathStructure mstruct2; mstruct = mstruct.determinant(mstruct2, eo); if((r + c) % 2 == 1) { mstruct.calculateNegate(eo); } return mstruct; } void gatherInformation(const MathStructure &mstruct, vector &base_units, vector &alias_units) { switch(mstruct.type()) { case STRUCT_UNIT: { switch(mstruct.unit()->subtype()) { case SUBTYPE_BASE_UNIT: { for(size_t i = 0; i < base_units.size(); i++) { if(base_units[i] == mstruct.unit()) { return; } } base_units.push_back(mstruct.unit()); break; } case SUBTYPE_ALIAS_UNIT: { for(size_t i = 0; i < alias_units.size(); i++) { if(alias_units[i] == mstruct.unit()) { return; } } alias_units.push_back((AliasUnit*) (mstruct.unit())); break; } case SUBTYPE_COMPOSITE_UNIT: { gatherInformation(((CompositeUnit*) (mstruct.unit()))->generateMathStructure(), base_units, alias_units); break; } } break; } case STRUCT_FUNCTION: { for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct.function()->getArgumentDefinition(i + 1) || mstruct.function()->getArgumentDefinition(i + 1)->type() != ARGUMENT_TYPE_ANGLE) { gatherInformation(mstruct[i], base_units, alias_units); } } } default: { for(size_t i = 0; i < mstruct.size(); i++) { gatherInformation(mstruct[i], base_units, alias_units); } break; } } } int MathStructure::isUnitCompatible(const MathStructure &mstruct) { int b1 = mstruct.containsRepresentativeOfType(STRUCT_UNIT, true, true); int b2 = containsRepresentativeOfType(STRUCT_UNIT, true, true); if(b1 < 0 || b2 < 0) return -1; if(b1 != b2) return false; if(!b1) return true; if(mstruct.isMultiplication()) { size_t i2 = 0; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsType(STRUCT_UNIT)) { bool b = false; for(; i2 < mstruct.size(); i2++) { if(mstruct[i2].containsType(STRUCT_UNIT)) { if(!CHILD(i).isUnitCompatible(mstruct[i2])) { return false; } i2++; b = true; break; } } if(!b) return false; } } for(; i2 < mstruct.size(); i2++) { if(mstruct[i2].containsType(STRUCT_UNIT)) { return false; } } } if(isUnit()) { return equals(mstruct); } else if(isPower()) { return equals(mstruct); } return true; } bool MathStructure::syncUnits(bool sync_complex_relations, bool *found_complex_relations, bool calculate_new_functions, const EvaluationOptions &feo) { vector base_units; vector alias_units; vector composite_units; gatherInformation(*this, base_units, alias_units); CompositeUnit *cu; bool b = false, do_erase = false; for(size_t i = 0; i < alias_units.size(); ) { do_erase = false; if(alias_units[i]->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { b = false; cu = (CompositeUnit*) alias_units[i]->baseUnit(); for(size_t i2 = 0; i2 < base_units.size(); i2++) { if(cu->containsRelativeTo(base_units[i2])) { for(size_t i3 = 0; i3 < composite_units.size(); i3++) { if(composite_units[i3] == cu) { b = true; break; } } if(!b) composite_units.push_back(cu); do_erase = true; break; } } for(size_t i2 = 0; !do_erase && i2 < alias_units.size(); i2++) { if(i != i2 && cu->containsRelativeTo(alias_units[i2])) { for(size_t i3 = 0; i3 < composite_units.size(); i3++) { if(composite_units[i3] == cu) { b = true; break; } } if(!b) composite_units.push_back(cu); do_erase = true; break; } } } if(do_erase) { alias_units.erase(alias_units.begin() + i); for(int i2 = 1; i2 <= (int) cu->countUnits(); i2++) { b = false; Unit *cub = cu->get(i2); switch(cub->subtype()) { case SUBTYPE_BASE_UNIT: { for(size_t i3 = 0; i3 < base_units.size(); i3++) { if(base_units[i3] == cub) { b = true; break; } } if(!b) base_units.push_back(cub); break; } case SUBTYPE_ALIAS_UNIT: { for(size_t i3 = 0; i3 < alias_units.size(); i3++) { if(alias_units[i3] == cub) { b = true; break; } } if(!b) alias_units.push_back((AliasUnit*) cub); break; } case SUBTYPE_COMPOSITE_UNIT: { gatherInformation(((CompositeUnit*) cub)->generateMathStructure(), base_units, alias_units); break; } } } i = 0; } else { i++; } } for(size_t i = 0; i < alias_units.size();) { do_erase = false; for(size_t i2 = 0; i2 < alias_units.size(); i2++) { if(i != i2 && alias_units[i]->baseUnit() == alias_units[i2]->baseUnit()) { if(alias_units[i2]->isParentOf(alias_units[i])) { do_erase = true; break; } else if(!alias_units[i]->isParentOf(alias_units[i2])) { b = false; for(size_t i3 = 0; i3 < base_units.size(); i3++) { if(base_units[i3] == alias_units[i2]->firstBaseUnit()) { b = true; break; } } if(!b) base_units.push_back((Unit*) alias_units[i]->baseUnit()); do_erase = true; break; } } } if(do_erase) { alias_units.erase(alias_units.begin() + i); i = 0; } else { i++; } } for(size_t i = 0; i < alias_units.size();) { do_erase = false; if(alias_units[i]->baseUnit()->subtype() == SUBTYPE_BASE_UNIT) { for(size_t i2 = 0; i2 < base_units.size(); i2++) { if(alias_units[i]->baseUnit() == base_units[i2]) { do_erase = true; break; } } } if(do_erase) { alias_units.erase(alias_units.begin() + i); i = 0; } else { i++; } } b = false; for(size_t i = 0; i < composite_units.size(); i++) { if(convert(composite_units[i], sync_complex_relations, found_complex_relations, calculate_new_functions, feo)) b = true; } if(dissolveAllCompositeUnits()) b = true; for(size_t i = 0; i < base_units.size(); i++) { if(convert(base_units[i], sync_complex_relations, found_complex_relations, calculate_new_functions, feo)) b = true; } for(size_t i = 0; i < alias_units.size(); i++) { if(convert(alias_units[i], sync_complex_relations, found_complex_relations, calculate_new_functions, feo)) b = true; } return b; } bool MathStructure::testDissolveCompositeUnit(Unit *u) { if(m_type == STRUCT_UNIT) { if(o_unit->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(((CompositeUnit*) o_unit)->containsRelativeTo(u)) { set(((CompositeUnit*) o_unit)->generateMathStructure()); return true; } } else if(o_unit->subtype() == SUBTYPE_ALIAS_UNIT && o_unit->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(((CompositeUnit*) (o_unit->baseUnit()))->containsRelativeTo(u)) { convert(o_unit->baseUnit()); convert(u); return true; } } } return false; } bool MathStructure::testCompositeUnit(Unit *u) { if(m_type == STRUCT_UNIT) { if(o_unit->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(((CompositeUnit*) o_unit)->containsRelativeTo(u)) { return true; } } else if(o_unit->subtype() == SUBTYPE_ALIAS_UNIT && o_unit->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(((CompositeUnit*) (o_unit->baseUnit()))->containsRelativeTo(u)) { return true; } } } return false; } bool MathStructure::dissolveAllCompositeUnits() { switch(m_type) { case STRUCT_UNIT: { if(o_unit->subtype() == SUBTYPE_COMPOSITE_UNIT) { set(((CompositeUnit*) o_unit)->generateMathStructure()); return true; } break; } default: { bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).dissolveAllCompositeUnits()) { CHILD_UPDATED(i); b = true; } } return b; } } return false; } bool MathStructure::convert(Unit *u, bool convert_complex_relations, bool *found_complex_relations, bool calculate_new_functions, const EvaluationOptions &feo) { bool b = false; if(m_type == STRUCT_UNIT && o_unit == u) return false; if(u->subtype() == SUBTYPE_COMPOSITE_UNIT && !(m_type == STRUCT_UNIT && o_unit->baseUnit() == u)) { return convert(((CompositeUnit*) u)->generateMathStructure(), convert_complex_relations, found_complex_relations, calculate_new_functions, feo); } if(m_type == STRUCT_UNIT) { if(!convert_complex_relations && u->hasComplexRelationTo(o_unit)) { if(found_complex_relations) *found_complex_relations = true; return false; } if(testDissolveCompositeUnit(u)) { convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo); return true; } MathStructure *exp = new MathStructure(1, 1); MathStructure *mstruct = new MathStructure(1, 1); ; if(u->convert(o_unit, *mstruct, *exp)) { o_unit = u; if(!exp->isOne()) { if(calculate_new_functions) exp->calculateFunctions(feo, true); raise_nocopy(exp); } else { exp->unref(); } if(!mstruct->isOne()) { if(calculate_new_functions) mstruct->calculateFunctions(feo, true); multiply_nocopy(mstruct); } else { mstruct->unref(); } return true; } else { exp->unref(); mstruct->unref(); return false; } } else { if(convert_complex_relations) { if(m_type == STRUCT_MULTIPLICATION) { int b_c = -1; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isUnit_exp()) { if((CHILD(i).isUnit() && u->hasComplexRelationTo(CHILD(i).unit())) || (CHILD(i).isPower() && u->hasComplexRelationTo(CHILD(i)[0].unit()))) { if(found_complex_relations) *found_complex_relations = true; if(b_c >= 0) { b_c = -1; break; } b_c = i; } } } if(b_c >= 0) { MathStructure mstruct(1, 1); if(SIZE == 2) { if(b_c == 0) mstruct = CHILD(1); else mstruct = CHILD(0); } else if(SIZE > 2) { mstruct = *this; mstruct.delChild(b_c + 1); } MathStructure exp(1, 1); Unit *u2; if(CHILD(b_c).isPower()) { if(CHILD(b_c)[0].testDissolveCompositeUnit(u)) { convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo); return true; } exp = CHILD(b_c)[1]; u2 = CHILD(b_c)[0].unit(); } else { if(CHILD(b_c).testDissolveCompositeUnit(u)) { convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo); return true; } u2 = CHILD(b_c).unit(); } size_t efc = 0, mfc = 0; if(calculate_new_functions) { efc = exp.countFunctions(); mfc = mstruct.countFunctions(); } if(u->convert(u2, mstruct, exp)) { set(u); if(!exp.isOne()) { if(calculate_new_functions && exp.countFunctions() > efc) exp.calculateFunctions(feo, true); raise(exp); } if(!mstruct.isOne()) { if(calculate_new_functions && mstruct.countFunctions() > mfc) mstruct.calculateFunctions(feo, true); multiply(mstruct); } return true; } return false; } } else if(m_type == STRUCT_POWER) { if(CHILD(0).isUnit() && u->hasComplexRelationTo(CHILD(0).unit())) { if(found_complex_relations) *found_complex_relations = true; if(CHILD(0).testDissolveCompositeUnit(u)) { convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo); return true; } MathStructure exp(CHILD(1)); MathStructure mstruct(1, 1); size_t efc = 0; if(calculate_new_functions) { efc = exp.countFunctions(); } if(u->convert(CHILD(0).unit(), mstruct, exp)) { set(u); if(!exp.isOne()) { if(calculate_new_functions && exp.countFunctions() > efc) exp.calculateFunctions(feo, true); raise(exp); } if(!mstruct.isOne()) { if(calculate_new_functions) mstruct.calculateFunctions(feo, true); multiply(mstruct); } return true; } return false; } } if(m_type == STRUCT_MULTIPLICATION || m_type == STRUCT_POWER) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).convert(u, false, found_complex_relations, calculate_new_functions, feo)) { CHILD_UPDATED(i); b = true; } } return b; } } if(m_type == STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { if((!o_function->getArgumentDefinition(i + 1) || o_function->getArgumentDefinition(i + 1)->type() != ARGUMENT_TYPE_ANGLE) && CHILD(i).convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo)) { CHILD_UPDATED(i); b = true; } } return b; } for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo)) { CHILD_UPDATED(i); b = true; } } return b; } return b; } bool MathStructure::convert(const MathStructure unit_mstruct, bool convert_complex_relations, bool *found_complex_relations, bool calculate_new_functions, const EvaluationOptions &feo) { bool b = false; if(unit_mstruct.type() == STRUCT_UNIT) { if(convert(unit_mstruct.unit(), convert_complex_relations, found_complex_relations, calculate_new_functions, feo)) b = true; } else { for(size_t i = 0; i < unit_mstruct.size(); i++) { if(convert(unit_mstruct[i], convert_complex_relations, found_complex_relations, calculate_new_functions, feo)) b = true; } } return b; } int MathStructure::contains(const MathStructure &mstruct, bool structural_only, bool check_variables, bool check_functions) const { if(equals(mstruct)) return 1; if(structural_only) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).contains(mstruct)) return 1; } } else { int ret = 0; if(m_type != STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { int retval = CHILD(i).contains(mstruct, structural_only, check_variables, check_functions); if(retval == 1) return 1; else if(retval < 0) ret = retval; } } if(m_type == STRUCT_VARIABLE && check_variables && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().contains(mstruct, structural_only, check_variables, check_functions); } else if(m_type == STRUCT_FUNCTION && check_functions) { if(function_value) { return function_value->contains(mstruct, structural_only, check_variables, check_functions); } return -1; } return ret; } return 0; } int MathStructure::containsRepresentativeOf(const MathStructure &mstruct, bool check_variables, bool check_functions) const { if(equals(mstruct)) return 1; int ret = 0; if(m_type != STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { int retval = CHILD(i).containsRepresentativeOf(mstruct, check_variables, check_functions); if(retval == 1) return 1; else if(retval < 0) ret = retval; } } if(m_type == STRUCT_VARIABLE && check_variables && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().containsRepresentativeOf(mstruct, check_variables, check_functions); } else if(m_type == STRUCT_FUNCTION && check_functions) { if(function_value) { return function_value->containsRepresentativeOf(mstruct, check_variables, check_functions); } return -1; } return ret; } int MathStructure::containsType(StructureType mtype, bool structural_only, bool check_variables, bool check_functions) const { if(m_type == mtype) return 1; if(structural_only) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsType(mtype, true, check_variables, check_functions)) return 1; } return 0; } else { int ret = 0; if(m_type != STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { int retval = CHILD(i).containsType(mtype, false, check_variables, check_functions); if(retval == 1) return 1; else if(retval < 0) ret = retval; } } if(check_variables && m_type == STRUCT_VARIABLE && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().containsType(mtype, false, check_variables, check_functions); } else if(check_functions && m_type == STRUCT_FUNCTION) { if(function_value) { return function_value->containsType(mtype, false, check_variables, check_functions); } return -1; } return ret; } } int MathStructure::containsRepresentativeOfType(StructureType mtype, bool check_variables, bool check_functions) const { if(m_type == mtype) return 1; int ret = 0; if(m_type != STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { int retval = CHILD(i).containsRepresentativeOfType(mtype, check_variables, check_functions); if(retval == 1) return 1; else if(retval < 0) ret = retval; } } if(check_variables && m_type == STRUCT_VARIABLE && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().containsRepresentativeOfType(mtype, check_variables, check_functions); } else if(check_functions && m_type == STRUCT_FUNCTION) { if(function_value) { return function_value->containsRepresentativeOfType(mtype, check_variables, check_functions); } } if(m_type == STRUCT_SYMBOLIC || m_type == STRUCT_VARIABLE || m_type == STRUCT_FUNCTION) { if(representsNumber(false)) { return m_type == STRUCT_NUMBER; } else { return -1; } } return ret; } bool MathStructure::containsUnknowns() const { if(m_type == STRUCT_SYMBOLIC || (m_type == STRUCT_VARIABLE && !o_variable->isKnown())) return true; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsUnknowns()) return true; } return false; } bool MathStructure::containsDivision() const { if(m_type == STRUCT_DIVISION || m_type == STRUCT_INVERSE || (m_type == STRUCT_POWER && CHILD(1).hasNegativeSign())) return true; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsDivision()) return true; } return false; } size_t MathStructure::countFunctions(bool count_subfunctions) const { size_t c = 0; if(isFunction()) { if(!count_subfunctions) return 1; c = 1; } for(size_t i = 0; i < SIZE; i++) { c += CHILD(i).countFunctions(); } return c; } void MathStructure::findAllUnknowns(MathStructure &unknowns_vector) { if(!unknowns_vector.isVector()) unknowns_vector.clearVector(); switch(m_type) { case STRUCT_VARIABLE: { if(o_variable->isKnown()) { break; } } case STRUCT_SYMBOLIC: { bool b = false; for(size_t i = 0; i < unknowns_vector.size(); i++) { if(equals(unknowns_vector[i])) { b = true; break; } } if(!b) unknowns_vector.addChild(*this); break; } default: { for(size_t i = 0; i < SIZE; i++) { CHILD(i).findAllUnknowns(unknowns_vector); } } } } bool MathStructure::replace(const MathStructure &mfrom, const MathStructure &mto) { if(b_protected) b_protected = false; if(equals(mfrom)) { set(mto); return true; } bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).replace(mfrom, mto)) { b = true; CHILD_UPDATED(i); } } return b; } bool MathStructure::calculateReplace(const MathStructure &mfrom, const MathStructure &mto, const EvaluationOptions &eo) { if(equals(mfrom)) { set(mto); return true; } bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).calculateReplace(mfrom, mto, eo)) { b = true; CHILD_UPDATED(i); } } if(b) { calculatesub(eo, eo, false); } return b; } bool MathStructure::replace(const MathStructure &mfrom1, const MathStructure &mto1, const MathStructure &mfrom2, const MathStructure &mto2) { if(equals(mfrom1)) { set(mto1); return true; } if(equals(mfrom2)) { set(mto2); return true; } bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).replace(mfrom1, mto1, mfrom2, mto2)) { b = true; CHILD_UPDATED(i); } } return b; } bool MathStructure::removeType(StructureType mtype) { if(m_type == mtype || (m_type == STRUCT_POWER && CHILD(0).type() == mtype)) { set(1); return true; } bool b = false; if(m_type == STRUCT_MULTIPLICATION) { for(int i = 0; i < (int) SIZE; i++) { if(CHILD(i).removeType(mtype)) { if(CHILD(i).isOne()) { ERASE(i); i--; } else { CHILD_UPDATED(i); } b = true; } } if(SIZE == 0) { set(1); } else if(SIZE == 1) { setToChild(1, true); } } else { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).removeType(mtype)) { b = true; CHILD_UPDATED(i); } } } return b; } MathStructure MathStructure::generateVector(MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector, const EvaluationOptions &eo) const { if(steps < 1) { steps = 1; } MathStructure x_value(min); MathStructure y_value; MathStructure y_vector; y_vector.clearVector(); MathStructure step(max); step.calculateSubtract(min, eo); step.calculateDivide(steps, eo); if(!step.isNumber() || step.number().isNegative()) { return y_vector; } for(int i = 0; i <= steps; i++) { if(x_vector) { x_vector->addChild(x_value); } y_value = *this; y_value.replace(x_mstruct, x_value); y_value.eval(eo); y_vector.addChild(y_value); x_value.calculateAdd(step, eo); } return y_vector; } MathStructure MathStructure::generateVector(MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector, const EvaluationOptions &eo) const { MathStructure x_value(min); MathStructure y_value; MathStructure y_vector; y_vector.clearVector(); if(min != max) { MathStructure mtest(max); mtest.calculateSubtract(min, eo); if(!min.isZero()) mtest.calculateDivide(min, eo); if(!mtest.isNumber() || mtest.number().isNegative()) { return y_vector; } } ComparisonResult cr = max.compare(x_value); while(COMPARISON_IS_EQUAL_OR_LESS(cr)) { if(x_vector) { x_vector->addChild(x_value); } y_value = *this; y_value.replace(x_mstruct, x_value); y_value.eval(eo); y_vector.addChild(y_value); x_value.calculateAdd(step, eo); if(cr == COMPARISON_RESULT_EQUAL) break; cr = max.compare(x_value); } return y_vector; } MathStructure MathStructure::generateVector(MathStructure x_mstruct, const MathStructure &x_vector, const EvaluationOptions &eo) const { MathStructure y_value; MathStructure y_vector; y_vector.clearVector(); for(size_t i = 1; i <= x_vector.countChildren(); i++) { y_value = *this; y_value.replace(x_mstruct, x_vector.getChild(i)); y_value.eval(eo); y_vector.addChild(y_value); } return y_vector; } bool MathStructure::differentiate(const MathStructure &x_var, const EvaluationOptions &eo) { if(equals(x_var)) { set(m_one); return true; } switch(m_type) { case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).differentiate(x_var, eo)) { CHILD_UPDATED(i); } } break; } case STRUCT_BITWISE_AND: {} case STRUCT_BITWISE_OR: {} case STRUCT_BITWISE_XOR: {} case STRUCT_LOGICAL_AND: {} case STRUCT_LOGICAL_OR: {} case STRUCT_LOGICAL_XOR: {} case STRUCT_COMPARISON: {} case STRUCT_UNIT: {} case STRUCT_NUMBER: { clear(true); break; } case STRUCT_POWER: { if(SIZE < 1) { clear(true); break; } else if(SIZE < 2) { setToChild(1, true); return differentiate(x_var, eo); } bool x_in_base = CHILD(0).containsRepresentativeOf(x_var, true, true) != 0; bool x_in_exp = CHILD(1).containsRepresentativeOf(x_var, true, true) != 0; if(x_in_base && !x_in_exp) { MathStructure exp_mstruct(CHILD(1)); MathStructure base_mstruct(CHILD(0)); CHILD(1) += m_minus_one; multiply(exp_mstruct); base_mstruct.differentiate(x_var, eo); multiply(base_mstruct); } else if(!x_in_base && x_in_exp) { MathStructure exp_mstruct(CHILD(1)); MathStructure mstruct(CALCULATOR->f_ln, &CHILD(0), NULL); multiply(mstruct); exp_mstruct.differentiate(x_var, eo); multiply(exp_mstruct); } else if(x_in_base && x_in_exp) { MathStructure exp_mstruct(CHILD(1)); MathStructure base_mstruct(CHILD(0)); exp_mstruct.differentiate(x_var, eo); base_mstruct.differentiate(x_var, eo); base_mstruct /= CHILD(0); base_mstruct *= CHILD(1); MathStructure mstruct(CALCULATOR->f_ln, &CHILD(0), NULL); mstruct *= exp_mstruct; mstruct += base_mstruct; multiply(mstruct); } else { clear(true); } break; } case STRUCT_FUNCTION: { if(o_function == CALCULATOR->f_ln && SIZE == 1) { MathStructure mstruct(CHILD(0)); setToChild(1, true); inverse(); mstruct.differentiate(x_var, eo); multiply(mstruct); } else if(o_function == CALCULATOR->f_lambert_w && SIZE == 1 && CHILD(0) == x_var) { MathStructure *mstruct = new MathStructure(*this); mstruct->add(m_one); mstruct->multiply(CHILD(0)); divide_nocopy(mstruct); } else if(o_function == CALCULATOR->f_sin && SIZE == 1) { o_function = CALCULATOR->f_cos; MathStructure mstruct(CHILD(0)); mstruct.differentiate(x_var, eo); multiply(mstruct); if(CALCULATOR->getRadUnit()) divide(CALCULATOR->getRadUnit()); } else if(o_function == CALCULATOR->f_cos && SIZE == 1) { o_function = CALCULATOR->f_sin; MathStructure mstruct(CHILD(0)); negate(); mstruct.differentiate(x_var, eo); multiply(mstruct, true); if(CALCULATOR->getRadUnit()) divide(CALCULATOR->getRadUnit()); } else if(o_function == CALCULATOR->f_integrate && SIZE == 2 && CHILD(1) == x_var) { setToChild(1, true); } else if(o_function == CALCULATOR->f_diff && SIZE == 3 && CHILD(1) == x_var) { CHILD(2) += m_one; } else if(o_function == CALCULATOR->f_diff && SIZE == 2 && CHILD(1) == x_var) { APPEND(MathStructure(2, 1)); } else if(o_function == CALCULATOR->f_diff && SIZE == 1 && x_var == (Variable*) CALCULATOR->v_x) { APPEND(x_var); APPEND(MathStructure(2, 1)); } else { if(!eo.calculate_functions || !calculateFunctions(eo)) { MathStructure mstruct(CALCULATOR->f_diff, this, &x_var, &m_one, NULL); set(mstruct); return false; } else { EvaluationOptions eo2 = eo; eo2.calculate_functions = false; return differentiate(x_var, eo2); } } break; } case STRUCT_MULTIPLICATION: { MathStructure mstruct, vstruct; size_t idiv = 0; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isPower() && CHILD(i)[1].isNumber() && CHILD(i)[1].number().isNegative()) { if(idiv == 0) { if(CHILD(i)[1].isMinusOne()) { vstruct = CHILD(i)[0]; } else { vstruct = CHILD(i); vstruct[1].number().negate(); } } else { if(CHILD(i)[1].isMinusOne()) { vstruct.multiply(CHILD(i)[0], true); } else { vstruct.multiply(CHILD(i), true); vstruct[vstruct.size() - 1][1].number().negate(); } } idiv++; } } if(idiv == SIZE) { set(-1, 1); MathStructure mdiv(vstruct); mdiv ^= MathStructure(2, 1); mdiv.inverse(); multiply(mdiv); MathStructure diff_u(vstruct); diff_u.differentiate(x_var, eo); multiply(diff_u, true); break; } else if(idiv > 0) { idiv = 0; for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).isPower() || !CHILD(i)[1].isNumber() || !CHILD(i)[1].number().isNegative()) { if(idiv == 0) { mstruct = CHILD(i); } else { mstruct.multiply(CHILD(i), true); } idiv++; } } MathStructure mdiv(vstruct); mdiv ^= MathStructure(2, 1); MathStructure diff_v(vstruct); diff_v.differentiate(x_var, eo); MathStructure diff_u(mstruct); diff_u.differentiate(x_var, eo); vstruct *= diff_u; mstruct *= diff_v; set_nocopy(vstruct, true); subtract(mstruct); divide(mdiv); break; } if(SIZE > 2) { mstruct.set(*this); mstruct.delChild(mstruct.size()); MathStructure mstruct2(LAST); MathStructure mstruct3(mstruct); mstruct.differentiate(x_var, eo); mstruct2.differentiate(x_var, eo); mstruct *= LAST; mstruct2 *= mstruct3; set(mstruct, true); add(mstruct2); } else { mstruct = CHILD(0); MathStructure mstruct2(CHILD(1)); mstruct.differentiate(x_var, eo); mstruct2.differentiate(x_var, eo); mstruct *= CHILD(1); mstruct2 *= CHILD(0); set(mstruct, true); add(mstruct2); } break; } case STRUCT_SYMBOLIC: { if(representsNumber()) { clear(true); } else { MathStructure mstruct(CALCULATOR->f_diff, this, &x_var, &m_one, NULL); set(mstruct); return false; } break; } case STRUCT_VARIABLE: { if(eo.calculate_variables && o_variable->isKnown()) { if(eo.approximation != APPROXIMATION_EXACT || !o_variable->isApproximate()) { set(((KnownVariable*) o_variable)->get(), true); return differentiate(x_var, eo); } else if(containsRepresentativeOf(x_var, true, true) != 0) { MathStructure mstruct(CALCULATOR->f_diff, this, &x_var, &m_one, NULL); set(mstruct); return false; } } if(representsNumber(true)) { clear(true); break; } } default: { MathStructure mstruct(CALCULATOR->f_diff, this, &x_var, &m_one, NULL); set(mstruct); return false; } } return true; } bool MathStructure::integrate(const MathStructure &x_var, const EvaluationOptions &eo) { if(equals(x_var)) { raise(2); multiply(MathStructure(1, 2)); return true; } if(containsRepresentativeOf(x_var, true, true) == 0) { multiply(x_var); return true; } switch(m_type) { case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).integrate(x_var, eo)) { CHILD_UPDATED(i); } } break; } case STRUCT_BITWISE_AND: {} case STRUCT_BITWISE_OR: {} case STRUCT_BITWISE_XOR: {} case STRUCT_LOGICAL_AND: {} case STRUCT_LOGICAL_OR: {} case STRUCT_LOGICAL_XOR: {} case STRUCT_COMPARISON: {} case STRUCT_UNIT: {} case STRUCT_NUMBER: { multiply(x_var); break; } case STRUCT_POWER: { if(CHILD(0).equals(x_var)) { if(CHILD(1).isNumber() && CHILD(1).number().isMinusOne()) { MathStructure mstruct(CALCULATOR->f_abs, &x_var, NULL); set(CALCULATOR->f_ln, &mstruct, NULL); break; } else if(CHILD(1).isNumber() || (CHILD(1).containsRepresentativeOf(x_var, true, true) == 0 && CHILD(1).representsNonNegative(false))) { CHILD(1) += m_one; MathStructure mstruct(CHILD(1)); divide(mstruct); break; } } else if(CHILD(0).type() == STRUCT_POWER) { this->simplify(eo); return integrate(x_var, eo); } else if(CHILD(0).isVariable() && CHILD(0).variable() == CALCULATOR->v_e) { if(CHILD(1).equals(x_var)) { break; } else if(CHILD(1).isMultiplication()) { bool b = false; size_t i = 0; for(; i < CHILD(1).size(); i++) { if(CHILD(1)[i].equals(x_var)) { b = true; break; } } if(b) { MathStructure mstruct; if(CHILD(1).size() == 2) { if(i == 0) { mstruct = CHILD(1)[1]; } else { mstruct = CHILD(1)[0]; } } else { mstruct = CHILD(1); mstruct.delChild(i + 1); } if(mstruct.representsNonZero(false) && mstruct.containsRepresentativeOf(x_var, true, true) == 0) { divide(mstruct); break; } } } } else if(CHILD(1).equals(x_var) && CHILD(0).containsRepresentativeOf(x_var, true, true) == 0 && CHILD(0).representsPositive(false)) { MathStructure mstruct(CALCULATOR->f_ln, &CHILD(0), NULL); CHILD(1) *= mstruct; CHILD(0) = CALCULATOR->v_e; CHILDREN_UPDATED; return integrate(x_var, eo); } MathStructure mstruct(CALCULATOR->f_integrate, this, &x_var, NULL); set(mstruct); return false; } case STRUCT_FUNCTION: { if(o_function == CALCULATOR->f_ln && SIZE == 1 && CHILD(0) == x_var) { multiply(x_var); subtract(x_var); } else if(o_function == CALCULATOR->f_lambert_w && SIZE == 1 && CHILD(0) == x_var) { MathStructure *mthis = new MathStructure(*this); subtract(m_one); mthis->inverse(); add_nocopy(mthis); multiply(x_var); } else if(o_function == CALCULATOR->f_sin && SIZE == 1 && CHILD(0).isMultiplication() && CHILD(0).size() == 2 && CHILD(0)[0] == x_var && CHILD(0)[1] == CALCULATOR->getRadUnit()) { o_function = CALCULATOR->f_cos; multiply(m_minus_one); } else if(o_function == CALCULATOR->f_cos && SIZE == 1 && CHILD(0).isMultiplication() && CHILD(0).size() == 2 && CHILD(0)[0] == x_var && CHILD(0)[1] == CALCULATOR->getRadUnit()) { o_function = CALCULATOR->f_sin; } else if(o_function == CALCULATOR->f_diff && SIZE == 3 && CHILD(1) == x_var) { if(CHILD(2).isOne()) { setToChild(1, true); } else { CHILD(2) += m_minus_one; } } else if(o_function == CALCULATOR->f_diff && SIZE == 2 && CHILD(1) == x_var) { setToChild(1, true); } else { if(!eo.calculate_functions || !calculateFunctions(eo)) { MathStructure mstruct(CALCULATOR->f_integrate, this, &x_var, NULL); set(mstruct); return false; } else { EvaluationOptions eo2 = eo; eo2.calculate_functions = false; return integrate(x_var, eo2); } } break; } case STRUCT_MULTIPLICATION: { MathStructure mstruct; bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsRepresentativeOf(x_var, true, true) == 0) { if(b) { mstruct *= CHILD(i); } else { mstruct = CHILD(i); b = true; } ERASE(i); } } if(b) { if(SIZE == 1) { setToChild(1, true); } else if(SIZE == 0) { set(mstruct, true); break; } integrate(x_var, eo); multiply(mstruct); } else { MathStructure mstruct(CALCULATOR->f_integrate, this, &x_var, NULL); set(mstruct); return false; } break; } case STRUCT_SYMBOLIC: { if(representsNumber()) { multiply(x_var); } else { MathStructure mstruct(CALCULATOR->f_integrate, this, &x_var, NULL); set(mstruct); return false; } break; } case STRUCT_VARIABLE: { if(eo.calculate_variables && o_variable->isKnown()) { if(eo.approximation != APPROXIMATION_EXACT || !o_variable->isApproximate()) { set(((KnownVariable*) o_variable)->get(), true); return integrate(x_var, eo); } else if(containsRepresentativeOf(x_var, true, true) != 0) { MathStructure mstruct3(1); MathStructure mstruct(CALCULATOR->f_integrate, this, &x_var, &mstruct3, NULL); set(mstruct); return false; } } if(representsNumber()) { multiply(x_var); break; } } default: { MathStructure mstruct(CALCULATOR->f_integrate, this, &x_var, NULL); set(mstruct); return false; } } return true; } const MathStructure &MathStructure::find_x_var() const { if(isSymbolic()) { return *this; } else if(isVariable()) { if(o_variable->isKnown()) return m_undefined; return *this; } const MathStructure *mstruct; const MathStructure *x_mstruct = &m_undefined; for(size_t i = 0; i < SIZE; i++) { mstruct = &CHILD(i).find_x_var(); if(mstruct->isVariable()) { if(mstruct->variable() == CALCULATOR->v_x) { return *mstruct; } else if(!x_mstruct->isVariable()) { x_mstruct = mstruct; } else if(mstruct->variable() == CALCULATOR->v_y) { x_mstruct = mstruct; } else if(mstruct->variable() == CALCULATOR->v_z && x_mstruct->variable() != CALCULATOR->v_y) { x_mstruct = mstruct; } } else if(mstruct->isSymbolic()) { if(!x_mstruct->isVariable() && !x_mstruct->isSymbolic()) { x_mstruct = mstruct; } } } return *x_mstruct; } bool test_comparisons(const MathStructure &msave, MathStructure &mthis, const MathStructure &x_var, const EvaluationOptions &eo, bool sub) { if(mthis.isComparison() && mthis[0] == x_var) { MathStructure mtest; EvaluationOptions eo2 = eo; eo2.calculate_functions = false; eo2.isolate_x = false; eo2.test_comparisons = true; if(eo2.approximation == APPROXIMATION_EXACT) eo2.approximation = APPROXIMATION_TRY_EXACT; mtest = mthis; mtest.eval(eo2); if(mtest.isComparison()) { mtest = msave; mtest.replace(x_var, mthis[1]); CALCULATOR->beginTemporaryStopMessages(); mtest.eval(eo2); if(CALCULATOR->endTemporaryStopMessages() == 0 && mtest.isNumber() && ((mthis.comparisonType() != COMPARISON_NOT_EQUALS && mtest.number().getBoolean() > 0) || (mthis.comparisonType() == COMPARISON_NOT_EQUALS && mtest.number().getBoolean() < 1))) { return true; } } if(!sub) mthis = msave; return false; } if(mthis.isLogicalOr() || mthis.isLogicalAnd()) { MathStructure mtest; EvaluationOptions eo2 = eo; eo2.calculate_functions = false; eo2.isolate_x = false; eo2.test_comparisons = true; if(eo2.approximation == APPROXIMATION_EXACT) eo2.approximation = APPROXIMATION_TRY_EXACT; for(size_t i = 0; i < mthis.size();) { if(!test_comparisons(msave, mthis[i], x_var, eo, true)) { if(mthis.isLogicalAnd()) { if(!sub) mthis = msave; return false; } mthis.delChild(i + 1); } else { i++; } } if(mthis.size() > 0) { if(mthis.size() == 1) mthis.setToChild(1); return true; } if(!sub) mthis = msave; return false; } return sub; } bool isx_deabsify(MathStructure &mstruct); bool isx_deabsify(MathStructure &mstruct) { switch(mstruct.type()) { case STRUCT_FUNCTION: { if(mstruct.function() == CALCULATOR->f_abs && mstruct.size() == 1 && mstruct[0].representsReal(true)) { mstruct.setToChild(1, true); return true; } break; } case STRUCT_POWER: { if(mstruct[1].isMinusOne()) { return isx_deabsify(mstruct[0]); } break; } case STRUCT_MULTIPLICATION: { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(isx_deabsify(mstruct[i])) b = true; } return b; } default: {} } return false; } bool MathStructure::isolate_x_sub(const EvaluationOptions &eo, EvaluationOptions &eo2, const MathStructure &x_var, MathStructure *morig) { if(!isComparison()) { printf("isolate_x_sub: not comparison\n"); return false; } if(CHILD(0) == x_var) return false; switch(CHILD(0).type()) { case STRUCT_ADDITION: { bool b = false; for(size_t i = 0; i < CHILD(0).size(); i++) { if(!CHILD(0)[i].contains(x_var)) { CHILD(0)[i].calculateNegate(eo2); CHILD(0)[i].ref(); CHILD(1).add_nocopy(&CHILD(0)[i], true); CHILD(1).calculateAddLast(eo2); CHILD(0).delChild(i + 1); b = true; } } if(b) { CHILD_UPDATED(0); CHILD_UPDATED(1); if(CHILD(0).size() == 1) { CHILD(0).setToChild(1, true); } else if(CHILD(0).size() == 0) { CHILD(0).clear(true); } isolate_x_sub(eo, eo2, x_var, morig); return true; } if(CHILD(0).size() == 2 && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { bool sqpow = false; bool nopow = false; MathStructure mstruct_a, mstruct_b; for(size_t i = 0; i < CHILD(0).size(); i++) { if(!sqpow && CHILD(0)[i].isPower() && CHILD(0)[i][0] == x_var && CHILD(0)[i][1].isNumber() && CHILD(0)[i][1].number() == 2) { sqpow = true; mstruct_a.set(m_one); } else if(!nopow && CHILD(0)[i] == x_var) { nopow = true; mstruct_b.set(m_one); } else if(CHILD(0)[i].isMultiplication()) { for(size_t i2 = 0; i2 < CHILD(0)[i].size(); i2++) { if(CHILD(0)[i][i2] == x_var) { if(nopow) break; nopow = true; mstruct_b = CHILD(0)[i]; mstruct_b.delChild(i2 + 1); if(mstruct_b.size() == 1) { mstruct_b.setToChild(1, true); } } else if(CHILD(0)[i][i2].isPower() && CHILD(0)[i][i2][0] == x_var && CHILD(0)[i][i2][1].isNumber() && CHILD(0)[i][i2][1].number() == 2) { if(sqpow) break; sqpow = true; mstruct_a = CHILD(0)[i]; mstruct_a.delChild(i2 + 1); if(mstruct_a.size() == 1) { mstruct_a.setToChild(1, true); } } else if(CHILD(0)[i][i2].contains(x_var)) { sqpow = false; nopow = false; break; } } } } if(sqpow && nopow && mstruct_a.representsNonZero(true)) { MathStructure b2(mstruct_b); b2.calculateRaise(MathStructure(2, 1), eo2); MathStructure ac(4, 1); ac.calculateMultiply(mstruct_a, eo2); ac.calculateMultiply(CHILD(1), eo2); b2.calculateAdd(ac, eo2); if(eo.allow_complex || b2.representsNonNegative()) { b2.calculateRaise(MathStructure(1, 2), eo2); mstruct_b.calculateNegate(eo2); MathStructure mstruct_1(mstruct_b); mstruct_1.calculateAdd(b2, eo2); MathStructure mstruct_2(mstruct_b); mstruct_2.calculateSubtract(b2, eo2); mstruct_a.calculateMultiply(MathStructure(2, 1), eo2); mstruct_a.calculateInverse(eo2); mstruct_1.calculateMultiply(mstruct_a, eo2); mstruct_2.calculateMultiply(mstruct_a, eo2); CHILD(0) = x_var; if(mstruct_1 != mstruct_2) { CHILD(1) = mstruct_1; MathStructure *mchild2 = new MathStructure(CHILD(0)); mchild2->transform(STRUCT_COMPARISON, mstruct_2); mchild2->setComparisonType(ct_comp); if(ct_comp == COMPARISON_NOT_EQUALS) { transform_nocopy(STRUCT_LOGICAL_AND, mchild2); } else { transform_nocopy(STRUCT_LOGICAL_OR, mchild2); } calculatesub(eo2, eo, false); } else { CHILD(1) = mstruct_1; } CHILDREN_UPDATED; return true; } } } /*if(!CHILD(1).representsNonZero(true)) { int index1 = -1; int index2 = -1; for(size_t i2 = 0; i2 < CHILD(0).size(); i2++) { if(index1 < 0 && CHILD(0)[i2].isMultiplication()) { for(size_t i = 0; i < CHILD(0)[i2].size(); i++) { if(CHILD(0)[i2][i].isPower() && CHILD(0)[i2][i][1].isNumber() && CHILD(0)[i2][i][1].number().isMinusOne() && CHILD(0)[i2][i][0].contains(x_var) && CHILD(0)[i2][i][0].representsNonZero(true)) { index1 = i2; index2 = i; break; } } } else if(!CHILD(0)[i2].representsNonZero(true)) { index1 = -1; break; } } if(index1 >= 0) { MathStructure msave(CHILD(0)[index1]); CHILD(0).delChild(index1 + 1); if(CHILD(0).size() == 0) { CHILD(0).clear(true); } else if(CHILD(0).size() == 1) { CHILD(0).setToChild(1, true); } CHILD(0).calculateSubtract(CHILD(1), eo2); CHILD(1).clear(); CHILD(0).calculateMultiply(msave[index2][0], eo2); msave.delChild(index2 + 1); if(msave.size() == 1) { msave.setToChild(1, true); } CHILD(0).calculateAdd(msave, eo2); CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); return true; } }*/ if(!eo2.expand) break; MathStructure mtest(*this); if(!CHILD(1).isZero()) { mtest[0].calculateSubtract(CHILD(1), eo2); mtest[1].clear(); mtest.childrenUpdated(); } if(!morig || !equals(morig)) { if(mtest[0].factorize(eo2) && !(mtest[0].isMultiplication() && mtest[0].size() == 2 && (mtest[0][0].isNumber() || mtest[0][0] == CHILD(1) || mtest[0][1] == CHILD(1)))) { mtest.childUpdated(1); if(mtest.isolate_x_sub(eo, eo2, x_var, this)) { set_nocopy(mtest); return true; } } if(!CHILD(1).isZero()) { mtest.set(*this); if(mtest[0].factorize(eo2) && !(mtest[0].isMultiplication() && mtest[0].size() == 2 && (mtest[0][0].isNumber() || mtest[0][0] == CHILD(1) || mtest[0][1] == CHILD(1)))) { mtest.childUpdated(1); if(mtest.isolate_x_sub(eo, eo2, x_var, this)) { set_nocopy(mtest); return true; } } } } break; } case STRUCT_MULTIPLICATION: { if(!representsNonMatrix()) return false; bool b = false; int zero1; if(CHILD(1).isZero()) zero1 = 1; else if(CHILD(1).representsNonZero(true)) zero1 = 0; else zero1 = 2; MathStructure *mcheckmulti = NULL, *mtryzero = NULL, *mchecknegative = NULL, *mchecknonzeropow = NULL; MathStructure mchild2(CHILD(1)); ComparisonType ct_orig = ct_comp; for(size_t i = 0; i < CHILD(0).size(); i++) { if(!CHILD(0)[i].contains(x_var)) { bool nonzero = false; if(CHILD(0)[i].isPower() && !CHILD(0)[i][1].representsNonNegative(true) && !CHILD(0)[i][0].representsNonZero(true)) { MathStructure *mcheck = new MathStructure(CHILD(0)[i][0]); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck->add(m_zero, OPERATION_EQUALS); else mcheck->add(m_zero, OPERATION_NOT_EQUALS); mcheck->isolate_x(eo2, eo); if(CHILD(0)[i][1].representsNegative(true)) { nonzero = true; } else { MathStructure *mcheckor = new MathStructure(CHILD(0)[i][1]); if(ct_comp == COMPARISON_NOT_EQUALS) mcheckor->add(m_zero, OPERATION_EQUALS_LESS); else mcheckor->add(m_zero, OPERATION_EQUALS_GREATER); mcheckor->isolate_x(eo2, eo); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck->add_nocopy(mcheckor, OPERATION_LOGICAL_AND); else mcheck->add_nocopy(mcheckor, OPERATION_LOGICAL_OR); mcheck->calculatesub(eo2, eo, false); } if(mchecknonzeropow) { if(ct_comp == COMPARISON_NOT_EQUALS) mchecknonzeropow->add_nocopy(mcheck, OPERATION_LOGICAL_OR); else mchecknonzeropow->add_nocopy(mcheck, OPERATION_LOGICAL_AND); } else { mchecknonzeropow = mcheck; } } if(!nonzero && !CHILD(0)[i].representsNonZero(true)) { if(zero1 != 1 && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { MathStructure *mcheck = new MathStructure(CHILD(0)[i]); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck->add(m_zero, OPERATION_EQUALS); else mcheck->add(m_zero, OPERATION_NOT_EQUALS); mcheck->isolate_x(eo2, eo); if(mcheckmulti) { if(ct_comp == COMPARISON_NOT_EQUALS) mcheckmulti->add_nocopy(mcheck, OPERATION_LOGICAL_OR); else mcheckmulti->add_nocopy(mcheck, OPERATION_LOGICAL_AND); } else { mcheckmulti = mcheck; } } if(ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) { if(!mtryzero) { mtryzero = new MathStructure(CHILD(0)[i]); mtryzero->add(m_zero, OPERATION_EQUALS); mtryzero->isolate_x(eo2, eo); MathStructure *mcheck = new MathStructure(mchild2); switch(ct_orig) { case COMPARISON_LESS: {mcheck->add(m_zero, OPERATION_GREATER); break;} case COMPARISON_GREATER: {mcheck->add(m_zero, OPERATION_LESS); break;} case COMPARISON_EQUALS_LESS: {mcheck->add(m_zero, OPERATION_EQUALS_GREATER); break;} case COMPARISON_EQUALS_GREATER: {mcheck->add(m_zero, OPERATION_EQUALS_LESS); break;} default: {} } mcheck->isolate_x(eo2, eo); mtryzero->add_nocopy(mcheck, OPERATION_LOGICAL_AND); } else { MathStructure *mcheck = new MathStructure(CHILD(0)[i]); mcheck->add(m_zero, OPERATION_EQUALS); mcheck->isolate_x(eo2, eo); (*mtryzero)[0].add_nocopy(mcheck, OPERATION_LOGICAL_OR); mtryzero[0].calculateLogicalOrLast(eo2); } } else if(zero1 > 0) { MathStructure *mcheck = new MathStructure(CHILD(0)[i]); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck->add(m_zero, OPERATION_NOT_EQUALS); else mcheck->add(m_zero, OPERATION_EQUALS); mcheck->isolate_x(eo2, eo); if(zero1 == 2) { MathStructure *mcheck2 = new MathStructure(mchild2); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck2->add(m_zero, OPERATION_NOT_EQUALS); else mcheck2->add(m_zero, OPERATION_EQUALS); mcheck2->isolate_x(eo2, eo); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck2->add_nocopy(mcheck, OPERATION_LOGICAL_OR); else mcheck2->add_nocopy(mcheck, OPERATION_LOGICAL_AND); mcheck2->calculatesub(eo2, eo, false); mcheck = mcheck2; } if(mtryzero) { if(ct_comp == COMPARISON_NOT_EQUALS) mtryzero->add_nocopy(mcheck, OPERATION_LOGICAL_AND); else mtryzero->add_nocopy(mcheck, OPERATION_LOGICAL_OR); } else { mtryzero = mcheck; } } } if(ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) { if(CHILD(0)[i].representsNegative()) { switch(ct_comp) { case COMPARISON_LESS: {ct_comp = COMPARISON_GREATER; break;} case COMPARISON_GREATER: {ct_comp = COMPARISON_LESS; break;} case COMPARISON_EQUALS_LESS: {ct_comp = COMPARISON_EQUALS_GREATER; break;} case COMPARISON_EQUALS_GREATER: {ct_comp = COMPARISON_EQUALS_LESS; break;} default: {} } } else if(!CHILD(0)[i].representsNonNegative()) { if(mchecknegative) { mchecknegative->multiply(CHILD(0)[i]); } else { mchecknegative = new MathStructure(CHILD(0)[i]); } } } if(zero1 != 1) { CHILD(1).calculateDivide(CHILD(0)[i], eo2); CHILD_UPDATED(1); } CHILD(0).delChild(i + 1); b = true; } } if(!b && ct_comp == COMPARISON_EQUALS && eo2.approximation != APPROXIMATION_EXACT && CHILD(1).isNumber() && CHILD(0).size() <= 3 && CHILD(0).size() >= 2) { //Check for x*e^x and solve with Lambert W function size_t e_index = CHILD(0).size(); bool e_power = false; bool had_x_var = false; bool pow_num = false; bool multi_num = false; const MathStructure *x_struct = NULL; for(size_t i = 0; i < CHILD(0).size(); i++) { if(x_struct && CHILD(0)[i] == *x_struct) { if(had_x_var) { had_x_var = false; break; } had_x_var = true; } else if(CHILD(0)[i].isPower()) { if(!x_struct && CHILD(0)[i][0] == x_var) { x_struct = &CHILD(0)[i]; if(had_x_var) { had_x_var = false; break; } had_x_var = true; } else { if(e_index < CHILD(0).size()) { e_index = CHILD(0).size(); break; } if((CHILD(0)[i][0].isVariable() && CHILD(0)[i][0].variable() == CALCULATOR->v_e) || (CHILD(0)[i][0].isNumber() && CHILD(0)[i][0].number().isPositive())) { if(x_struct && CHILD(0)[i][1] == *x_struct) { e_index = i; e_power = CHILD(0)[i][0].isVariable(); } else if(!x_struct && (CHILD(0)[i][1] == x_var || (CHILD(0)[i][1].isPower() && CHILD(0)[i][1][0] == x_var))) { x_struct = &CHILD(0)[i][1]; e_index = i; e_power = CHILD(0)[i][0].isVariable(); } else if(CHILD(0)[i][1].isMultiplication() && CHILD(0)[i][1].size() == 2 && CHILD(0)[i][1][0].isNumber() && !CHILD(0)[i][1][0].isZero()) { if(x_struct && CHILD(0)[i][1][1] == *x_struct) { e_index = i; e_power = CHILD(0)[i][0].isVariable(); pow_num = true; } else if(!x_struct && (CHILD(0)[i][1][1] == x_var || (CHILD(0)[i][1][1].isPower() && CHILD(0)[i][1][1][0] == x_var))) { x_struct = &CHILD(0)[i][1][1]; e_index = i; e_power = CHILD(0)[i][0].isVariable(); pow_num = true; } else { break; } } else { break; } } else { break; } } } else if(!x_struct && CHILD(0)[i] == x_var) { if(had_x_var) { had_x_var = false; break; } x_struct = &x_var; had_x_var = true; } else if(CHILD(0)[i].isNumber() && !CHILD(0)[i].isZero() && i == 0) { multi_num = true; } else { had_x_var = false; break; } } if(had_x_var && e_index < CHILD(0).size()) { Number num(CHILD(1).number()); Number nr_pow(1, 1); if(pow_num) nr_pow = CHILD(0)[e_index][1][0].number(); if(!e_power) { Number n_ln(CHILD(0)[e_index][0].number()); n_ln.ln(); nr_pow *= n_ln; pow_num = true; } if(multi_num) num /= CHILD(0)[0].number(); if(pow_num) num *= nr_pow; if(num.lambertW()) { CHILD(1) = num; if(e_power) { CHILD(0)[e_index].setToChild(2, true); CHILD(0).setToChild(e_index + 1, true); } else { MathStructure x_struct_new(*x_struct); CHILD(0).set(x_struct_new); CHILD(0).calculateMultiply(nr_pow, eo2); } CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); return true; } } } if(b) { if(CHILD(0).size() == 1) { CHILD(0).setToChild(1); } if((ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) && CHILD(1).contains(x_var)) { CHILD(0).calculateSubtract(CHILD(1), eo2); CHILD(1).clear(); } if(mchecknegative) { MathStructure *mneg = new MathStructure(*this); switch(ct_comp) { case COMPARISON_LESS: {mneg->setComparisonType(COMPARISON_GREATER); break;} case COMPARISON_GREATER: {mneg->setComparisonType(COMPARISON_LESS); break;} case COMPARISON_EQUALS_LESS: {mneg->setComparisonType(COMPARISON_EQUALS_GREATER); break;} case COMPARISON_EQUALS_GREATER: {mneg->setComparisonType(COMPARISON_EQUALS_LESS); break;} default: {} } isolate_x_sub(eo, eo2, x_var, morig); mneg->isolate_x_sub(eo, eo2, x_var); mchecknegative->add(m_zero, OPERATION_GREATER); add(*mchecknegative, OPERATION_LOGICAL_AND, true); SWAP_CHILDREN(0, SIZE - 1) calculatesub(eo2, eo, false); LAST.isolate_x(eo2, eo); mchecknegative->setComparisonType(COMPARISON_LESS); mchecknegative->isolate_x(eo2, eo); mneg->add_nocopy(mchecknegative, OPERATION_LOGICAL_AND, true); mneg->calculatesub(eo2, eo, false); add_nocopy(mneg, OPERATION_LOGICAL_OR, true); calculatesub(eo2, eo, false); } else { isolate_x_sub(eo, eo2, x_var, morig); } if(mcheckmulti) { mcheckmulti->calculatesub(eo2, eo, false); if(ct_comp == COMPARISON_NOT_EQUALS) { add_nocopy(mcheckmulti, OPERATION_LOGICAL_OR, true); } else { add_nocopy(mcheckmulti, OPERATION_LOGICAL_AND, true); SWAP_CHILDREN(0, SIZE - 1) } calculatesub(eo2, eo, false); } if(mchecknonzeropow) { mchecknonzeropow->calculatesub(eo2, eo, false); if(ct_comp == COMPARISON_NOT_EQUALS) { add_nocopy(mchecknonzeropow, OPERATION_LOGICAL_OR, true); } else { add_nocopy(mchecknonzeropow, OPERATION_LOGICAL_AND, true); SWAP_CHILDREN(0, SIZE - 1) } calculatesub(eo2, eo, false); } if(mtryzero) { mtryzero->calculatesub(eo2, eo, false); if(ct_comp == COMPARISON_NOT_EQUALS) { add_nocopy(mtryzero, OPERATION_LOGICAL_AND, true); SWAP_CHILDREN(0, SIZE - 1) } else { add_nocopy(mtryzero, OPERATION_LOGICAL_OR, true); } calculatesub(eo2, eo, false); } return true; } else if(CHILD(1).isZero()) { if(ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) { vector checktype; bool bdoit = false; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isPower() && !CHILD(0)[i][1].representsNonNegative()) { if(CHILD(0)[i][1].representsNegative()) { checktype.push_back(1); } else { checktype.push_back(2); bdoit = true; } } else { checktype.push_back(0); bdoit = true; } } if(!bdoit) break; MathStructure *mcheckpowers = NULL; ComparisonType ct = ct_comp; setToChild(1); if(ct == COMPARISON_NOT_EQUALS) { setType(STRUCT_LOGICAL_AND); } else { setType(STRUCT_LOGICAL_OR); } for(size_t i = 0; i < SIZE;) { if(checktype[i] > 0) { MathStructure *mcheck = new MathStructure(CHILD(i)[0]); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck->add(m_zero, OPERATION_EQUALS); else mcheck->add(m_zero, OPERATION_NOT_EQUALS); mcheck->isolate_x_sub(eo, eo2, x_var); if(checktype[i] == 2) { MathStructure *mexpcheck = new MathStructure(CHILD(i)[1]); if(ct_comp == COMPARISON_NOT_EQUALS) mexpcheck->add(m_zero, OPERATION_LESS); else mexpcheck->add(m_zero, OPERATION_EQUALS_GREATER); mexpcheck->isolate_x_sub(eo, eo2, x_var); if(ct_comp == COMPARISON_NOT_EQUALS) mexpcheck->add_nocopy(mcheck, OPERATION_LOGICAL_AND, true); else mexpcheck->add_nocopy(mcheck, OPERATION_LOGICAL_OR, true); mexpcheck->calculatesub(eo2, eo, false); mcheck = mexpcheck; } if(mcheckpowers) { if(ct_comp == COMPARISON_NOT_EQUALS) mcheckpowers->add_nocopy(mcheck, OPERATION_LOGICAL_OR, true); else mcheckpowers->add_nocopy(mcheck, OPERATION_LOGICAL_AND, true); } else { mcheckpowers = mcheck; } } if(checktype[i] == 1) { ERASE(i) checktype.erase(checktype.begin() + i); } else { CHILD(i).transform(STRUCT_COMPARISON, m_zero); CHILD(i).setComparisonType(ct); CHILD(i).isolate_x_sub(eo, eo2, x_var); i++; } } if(SIZE == 1) setToChild(1); else if(SIZE == 0) clear(true); else calculatesub(eo2, eo, false); if(mcheckpowers) { mcheckpowers->calculatesub(eo2, eo, false); if(ct_comp == COMPARISON_NOT_EQUALS) add_nocopy(mcheckpowers, OPERATION_LOGICAL_OR, true); else add_nocopy(mcheckpowers, OPERATION_LOGICAL_AND, true); SWAP_CHILDREN(0, SIZE - 1) calculatesub(eo2, eo, false); } return true; } else if(CHILD(0).size() >= 2) { MathStructure mless1(CHILD(0)[0]); MathStructure mless2; if(CHILD(0).size() == 2) { mless2 = CHILD(0)[1]; } else { mless2 = CHILD(0); mless2.delChild(1); } int checktype1 = 0, checktype2 = 0; MathStructure *mcheck1 = NULL, *mcheck2 = NULL; if(mless1.isPower() && !mless1[1].representsNonNegative()) { if(mless1[1].representsNegative()) { checktype1 = 1; } else if(ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER) { checktype1 = 2; mcheck1 = new MathStructure(mless1[1]); mcheck1->add(m_zero, OPERATION_EQUALS_GREATER); mcheck1->isolate_x_sub(eo, eo2, x_var); MathStructure *mcheck = new MathStructure(mless1[0]); mcheck->add(m_zero, OPERATION_NOT_EQUALS); mcheck1->isolate_x_sub(eo, eo2, x_var); mcheck1->add_nocopy(mcheck, OPERATION_LOGICAL_OR); mcheck1->calculatesub(eo2, eo, false); } } if(mless2.isPower() && !mless2[1].representsNonNegative()) { if(mless2[1].representsNegative()) { checktype2 = 1; } else if(ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER) { checktype2 = 2; mcheck2 = new MathStructure(mless2[1]); mcheck2->add(m_zero, OPERATION_EQUALS_GREATER); mcheck2->isolate_x_sub(eo, eo2, x_var); MathStructure *mcheck = new MathStructure(mless2[0]); mcheck->add(m_zero, OPERATION_NOT_EQUALS); mcheck2->isolate_x_sub(eo, eo2, x_var); mcheck2->add_nocopy(mcheck, OPERATION_LOGICAL_OR); mcheck2->calculatesub(eo2, eo, false); } } mless1.transform(STRUCT_COMPARISON, m_zero); if(checktype1 != 1 && (ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER)) { mless1.setComparisonType(COMPARISON_EQUALS_LESS); } else { mless1.setComparisonType(COMPARISON_LESS); } mless1.isolate_x_sub(eo, eo2, x_var); mless2.transform(STRUCT_COMPARISON, m_zero); mless2.setComparisonType(COMPARISON_LESS); if(checktype2 != 1 && (ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER)) { mless2.setComparisonType(COMPARISON_EQUALS_LESS); } else { mless2.setComparisonType(COMPARISON_LESS); } mless2.isolate_x_sub(eo, eo2, x_var); MathStructure mgreater1(CHILD(0)[0]); mgreater1.transform(STRUCT_COMPARISON, m_zero); if(checktype1 != 1 && (ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER)) { mgreater1.setComparisonType(COMPARISON_EQUALS_GREATER); } else { mgreater1.setComparisonType(COMPARISON_GREATER); } mgreater1.isolate_x_sub(eo, eo2, x_var); MathStructure mgreater2; if(CHILD(0).size() == 2) { mgreater2 = CHILD(0)[1]; } else { mgreater2 = CHILD(0); mgreater2.delChild(1); } mgreater2.transform(STRUCT_COMPARISON, m_zero); if(checktype2 != 1 && (ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER)) { mgreater2.setComparisonType(COMPARISON_EQUALS_GREATER); } else { mgreater2.setComparisonType(COMPARISON_GREATER); } mgreater2.isolate_x_sub(eo, eo2, x_var); clear(); if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { set(mless1); transform(STRUCT_LOGICAL_AND, mgreater2); calculatesub(eo2, eo, false); transform(STRUCT_LOGICAL_OR, mless2); CHILD(1).transform(STRUCT_LOGICAL_AND, mgreater1); CHILD(1).calculatesub(eo2, eo, false); CHILD_UPDATED(1) calculatesub(eo2, eo, false); } else { set(mless1); transform(STRUCT_LOGICAL_AND, mless2); calculatesub(eo2, eo, false); transform(STRUCT_LOGICAL_OR, mgreater1); CHILD(1).transform(STRUCT_LOGICAL_AND, mgreater2); CHILD(1).calculatesub(eo2, eo, false); CHILD_UPDATED(1) calculatesub(eo2, eo, false); } if(checktype1 == 2) { add_nocopy(mcheck1, OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); } if(checktype2 == 2) { add_nocopy(mcheck2, OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); } return true; } } if(!eo2.expand) break; if(!CHILD(1).isZero() && (!morig || !equals(*morig))) { MathStructure mtest(*this); mtest[0].calculateSubtract(CHILD(1), eo2); mtest[1].clear(); mtest.childrenUpdated(); if(mtest[0].factorize(eo2) && !(mtest[0].isMultiplication() && mtest[0].size() == 2 && (mtest[0][0].isNumber() || mtest[0][0] == CHILD(1) || mtest[0][1] == CHILD(1)))) { mtest.childUpdated(1); if(mtest.isolate_x_sub(eo, eo2, x_var, this)) { set_nocopy(mtest); return true; } } } break; } case STRUCT_POWER: { if(CHILD(0)[0].contains(x_var)) { if(ct_comp == COMPARISON_EQUALS && eo2.approximation != APPROXIMATION_EXACT && CHILD(1).isNumber() && CHILD(1).number().isPositive() && CHILD(0)[1] == x_var && CHILD(0)[0] == x_var) { Number n_ln_z(CHILD(1).number()); if(n_ln_z.ln()) { Number n_ln_z_w(n_ln_z); if(n_ln_z_w.lambertW()) { CHILD(1).number() = n_ln_z; CHILD(1).number() /= n_ln_z_w; CHILD(0) = x_var; CHILDREN_UPDATED return true; } } } else if(!CHILD(0)[1].contains(x_var)) { MathStructure *mbasecheck = NULL, *mcheckeven = NULL, *malternative = NULL, *malternative2 = NULL, *mcheck1 = NULL; bool b_zero = CHILD(1).isZero(); bool b_posexp = CHILD(0)[1].representsNonNegative(true); bool b_negexp = !b_posexp && CHILD(0)[1].representsNegative(); bool b_nonzero = !b_zero && CHILD(1).representsNonZero(true); if(b_zero && (b_negexp || CHILD(0)[1].isZero()) && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { if(ct_comp == COMPARISON_EQUALS) { clear(true); } else if(ct_comp == COMPARISON_NOT_EQUALS) { set(1, 1, 0, true); } return true; } bool b_pos1 = true; bool b_neg1 = false; if(ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) { if(!b_negexp && !b_posexp) { return false; } b_pos1 = b_zero || CHILD(1).representsNonNegative(true); b_neg1 = !b_pos1 && CHILD(1).representsNegative(true); } bool pow_even = false; if(CHILD(0)[1].isNumber()) { if(!CHILD(0)[1].number().isRational()) { if(!b_pos1) { return false; } } else { pow_even = CHILD(0)[1].number().numeratorIsEven(); } } else { pow_even = CHILD(0)[1].representsEven(); if(!pow_even && !CHILD(0)[1].representsOdd()) { pow_even = true; MathStructure mnum(CALCULATOR->f_numerator, &CHILD(0)[1], NULL); if(b_neg1) mcheckeven = new MathStructure(CALCULATOR->f_odd, &mnum, NULL); else mcheckeven = new MathStructure(CALCULATOR->f_even, &mnum, NULL); mcheckeven->calculateFunctions(eo); if(mcheckeven->isOne()) { delete mcheckeven; mcheckeven = NULL; if(b_neg1) pow_even = false; } else if(mcheckeven->isZero()) { delete mcheckeven; mcheckeven = NULL; if(!b_neg1) pow_even = false; } else if(ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) { return false; } else if(!CHILD(0)[1].representsRational()) { delete mcheckeven; mcheckeven = NULL; pow_even = false; } } } if(pow_even && b_neg1) { if(ct_comp == COMPARISON_LESS) { clear(true); return true; } else if(ct_comp == COMPARISON_EQUALS_LESS) { ct_comp = COMPARISON_EQUALS; b_pos1 = false; b_neg1 = false; } else if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) { ct_comp = COMPARISON_EQUALS_GREATER; CHILD(1).clear(true); CHILD_UPDATED(1) b_pos1 = true; b_neg1 = false; b_zero = true; b_nonzero = false; } } if(!b_posexp && !b_nonzero && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { if(!b_zero) { mbasecheck = new MathStructure(CHILD(0)[0]); if(ct_comp == COMPARISON_NOT_EQUALS) mbasecheck->add(m_zero, OPERATION_EQUALS); else mbasecheck->add(m_zero, OPERATION_NOT_EQUALS); mbasecheck->isolate_x_sub(eo, eo2, x_var); } if(!b_negexp) { MathStructure *mexpcheck = new MathStructure(CHILD(0)[1]); if(ct_comp == COMPARISON_NOT_EQUALS) mexpcheck->add(m_zero, OPERATION_LESS); else mexpcheck->add(m_zero, OPERATION_EQUALS_GREATER); mexpcheck->isolate_x(eo2, eo); if(!b_zero) { if(ct_comp == COMPARISON_NOT_EQUALS) mexpcheck->add_nocopy(mbasecheck, OPERATION_LOGICAL_AND, true); else mexpcheck->add_nocopy(mbasecheck, OPERATION_LOGICAL_OR, true); mexpcheck->calculatesub(eo2, eo, false); } mbasecheck = mexpcheck; } else if(b_zero) { if(ct_comp == COMPARISON_EQUALS) { clear(true); } else if(ct_comp == COMPARISON_NOT_EQUALS) { set(1, 1, 0, true); } if(mcheckeven) delete mcheckeven; return true; } } else if(b_negexp && ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) { if(!b_zero && !b_nonzero) { mbasecheck = new MathStructure(CHILD(1)); mbasecheck->add(m_zero, OPERATION_NOT_EQUALS); mbasecheck->isolate_x(eo2, eo); malternative2 = new MathStructure(CHILD(1)); malternative2->add(m_zero, OPERATION_EQUALS); malternative2->isolate_x(eo2, eo); MathStructure *mcheck = new MathStructure(CHILD(0)[0]); if(ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_LESS) { mcheck->add(m_zero, OPERATION_LESS); } else if(ct_comp == COMPARISON_EQUALS_GREATER || ct_comp == COMPARISON_GREATER) { mcheck->add(m_zero, OPERATION_GREATER); } mcheck->isolate_x_sub(eo, eo2, x_var); malternative2->add_nocopy(mcheck, OPERATION_LOGICAL_AND, true); malternative2->calculatesub(eo2, eo, false); } if(b_zero && (ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER)) { if(ct_comp == COMPARISON_EQUALS_LESS) { ct_comp = COMPARISON_LESS; } else if(ct_comp == COMPARISON_EQUALS_GREATER) { ct_comp = COMPARISON_GREATER; } } else if((b_pos1 || b_neg1) && !b_zero) { if((b_pos1 && (ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS)) || (b_neg1 && (ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER))) { malternative = new MathStructure(CHILD(0)[0]); if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) malternative->add(m_zero, OPERATION_LESS); else malternative->add(m_zero, OPERATION_GREATER); malternative->isolate_x_sub(eo, eo2, x_var); if(mbasecheck) { malternative->add(*mbasecheck, OPERATION_LOGICAL_AND, true); malternative->childToFront(malternative->size()); malternative->calculatesub(eo2, eo, false); } if(ct_comp == COMPARISON_LESS) ct_comp = COMPARISON_GREATER; else if(ct_comp == COMPARISON_EQUALS_LESS) ct_comp = COMPARISON_EQUALS_GREATER; else if(ct_comp == COMPARISON_GREATER) ct_comp = COMPARISON_LESS; else ct_comp = COMPARISON_EQUALS_LESS; } else { if(ct_comp == COMPARISON_LESS) ct_comp = COMPARISON_GREATER; else if(ct_comp == COMPARISON_EQUALS_LESS) ct_comp = COMPARISON_EQUALS_GREATER; else if(ct_comp == COMPARISON_GREATER) ct_comp = COMPARISON_LESS; else ct_comp = COMPARISON_EQUALS_LESS; mcheck1 = new MathStructure(CHILD(0)[0]); if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) mcheck1->add(m_zero, OPERATION_LESS); else mcheck1->add(m_zero, OPERATION_GREATER); mcheck1->isolate_x_sub(eo, eo2, x_var); } } else if(!b_zero) { malternative = new MathStructure(CHILD(1)); if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { if(b_nonzero) malternative->add(m_zero, OPERATION_GREATER); else malternative->add(m_zero, OPERATION_EQUALS_GREATER); } else { if(b_nonzero) malternative->add(m_zero, OPERATION_LESS); else malternative->add(m_zero, OPERATION_EQUALS_LESS); } malternative->isolate_x(eo2, eo); MathStructure *malt2 = new MathStructure(CHILD(0)[0]); if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { malt2->add(m_zero, OPERATION_LESS); } else { malt2->add(m_zero, OPERATION_GREATER); } malt2->isolate_x_sub(eo, eo2, x_var); malternative->add_nocopy(malt2, OPERATION_LOGICAL_AND, true); if(mbasecheck) { malternative->add(*mbasecheck, OPERATION_LOGICAL_AND, true); malternative->childToFront(malternative->size()); } malternative->calculatesub(eo2, eo, false); if(ct_comp == COMPARISON_LESS) ct_comp = COMPARISON_GREATER; else if(ct_comp == COMPARISON_EQUALS_LESS) ct_comp = COMPARISON_EQUALS_GREATER; else if(ct_comp == COMPARISON_GREATER) ct_comp = COMPARISON_LESS; else ct_comp = COMPARISON_EQUALS_LESS; mcheck1 = new MathStructure(CHILD(1)); if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { mcheck1->add(m_zero, OPERATION_LESS); } else { mcheck1->add(m_zero, OPERATION_GREATER); } mcheck1->isolate_x(eo2, eo); MathStructure *mcheck = new MathStructure(CHILD(0)[0]); if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { mcheck->add(m_zero, OPERATION_GREATER); } else { mcheck->add(m_zero, OPERATION_LESS); } mcheck->isolate_x_sub(eo, eo2, x_var); mcheck1->add_nocopy(mcheck, OPERATION_LOGICAL_OR, true); mcheck1->calculatesub(eo2, eo, false); } } if(!b_zero) { MathStructure exp(1, 1); exp.calculateDivide(CHILD(0)[1], eo2); CHILD(1).calculateRaise(exp, eo2); } CHILD(0).setToChild(1); CHILDREN_UPDATED if(pow_even && !b_neg1) { MathStructure *mcheck = NULL, *malt1 = NULL; if(!b_pos1) { malt1 = NULL; if(ct_comp == COMPARISON_EQUALS_LESS) { malt1 = new MathStructure(*this); malt1->setComparisonType(COMPARISON_EQUALS); } else if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) { malt1 = new MathStructure(*this); malt1->setComparisonType(COMPARISON_EQUALS_GREATER); (*malt1)[1].clear(true); } if(malt1) { malt1->isolate_x_sub(eo, eo2, x_var); mcheck = new MathStructure(CHILD(1)); mcheck->add(m_zero, OPERATION_LESS); mcheck->isolate_x(eo2, eo); malt1->add_nocopy(mcheck, OPERATION_LOGICAL_AND); malt1->swapChildren(2, 1); malt1->calculatesub(eo2, eo, false); } mcheck = new MathStructure(CHILD(1)); mcheck->add(m_zero, OPERATION_EQUALS_GREATER); mcheck->isolate_x(eo2, eo); } if(!mcheckeven) isx_deabsify(CHILD(1)); MathStructure *mchild2 = new MathStructure(*this); isolate_x_sub(eo, eo2, x_var, morig); (*mchild2)[0].calculateNegate(eo2); mchild2->childUpdated(1); mchild2->isolate_x_sub(eo, eo2, x_var); if(mcheckeven) { mchild2->add_nocopy(mcheckeven, OPERATION_LOGICAL_AND, true); mchild2->calculatesub(eo2, eo, false); } if(ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { transform_nocopy(STRUCT_LOGICAL_AND, mchild2); } else { transform_nocopy(STRUCT_LOGICAL_OR, mchild2); } calculatesub(eo2, eo, false); if(mcheck) { add_nocopy(mcheck, OPERATION_LOGICAL_AND); SWAP_CHILDREN(1, 0) calculatesub(eo2, eo, false); } if(malt1) { add_nocopy(malt1, OPERATION_LOGICAL_OR); calculatesub(eo2, eo, false); } } else if(b_neg1 && pow_even && mcheckeven) { MathStructure *malt1 = NULL; if(ct_comp == COMPARISON_EQUALS_LESS) { malt1 = new MathStructure(*this); malt1->setComparisonType(COMPARISON_EQUALS); } else if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) { malt1 = new MathStructure(*this); malt1->setComparisonType(COMPARISON_EQUALS_GREATER); (*malt1)[1].clear(true); } isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(mcheckeven, OPERATION_LOGICAL_AND); {SWAP_CHILDREN(1, 0)} calculatesub(eo2, eo, false); if(malt1) { malt1->isolate_x_sub(eo, eo2, x_var); add_nocopy(malt1, OPERATION_LOGICAL_OR); {SWAP_CHILDREN(1, 0)} calculatesub(eo2, eo, false); } } else { isolate_x_sub(eo, eo2, x_var, morig); } if(mbasecheck) { if(ct_comp == COMPARISON_NOT_EQUALS) add_nocopy(mbasecheck, OPERATION_LOGICAL_OR); else add_nocopy(mbasecheck, OPERATION_LOGICAL_AND); SWAP_CHILDREN(1, 0) calculatesub(eo2, eo, false); } if(mcheck1) { if(ct_comp == COMPARISON_NOT_EQUALS) add_nocopy(mcheck1, OPERATION_LOGICAL_OR); else add_nocopy(mcheck1, OPERATION_LOGICAL_AND); SWAP_CHILDREN(1, 0) calculatesub(eo2, eo, false); } if(malternative) { add_nocopy(malternative, OPERATION_LOGICAL_OR); if(!malternative2) calculatesub(eo2, eo, false); } if(malternative2) { add_nocopy(malternative2, OPERATION_LOGICAL_OR); calculatesub(eo2, eo, false); } return true; } } else if(CHILD(0)[1].contains(x_var)) { if(CHILD(1).isOne()) { if(!CHILD(0)[0].representsUndefined(true, true)) { CHILD(0).setToChild(2, true); CHILD(1).clear(true); isolate_x_sub(eo, eo2, x_var, morig); return true; } } if(ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) { if(CHILD(0)[0].isNumber() && CHILD(0)[0].number().isReal() && CHILD(0)[0].number().isPositive()) { if(CHILD(1).representsNegative()) { if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) { set(1, 1, 0, true); } else { clear(true); } return true; } if(CHILD(0)[0].number().isFraction()) { switch(ct_comp) { case COMPARISON_LESS: {ct_comp = COMPARISON_GREATER; break;} case COMPARISON_GREATER: {ct_comp = COMPARISON_LESS; break;} case COMPARISON_EQUALS_LESS: {ct_comp = COMPARISON_EQUALS_GREATER; break;} case COMPARISON_EQUALS_GREATER: {ct_comp = COMPARISON_EQUALS_LESS; break;} default: {} } } } else { return false; } } MathStructure msave(CHILD(1)); CHILD(1).set(CALCULATOR->f_logn, &msave, &CHILD(0)[0], NULL); bool b = CHILD(1).calculateFunctions(eo); CHILD(1).unformat(eo); if(b) CHILD(1).calculatesub(eo2, eo, true); CHILD(0).setToChild(2, true); CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); return true; } break; } case STRUCT_FUNCTION: { if(CHILD(0).function() == CALCULATOR->f_ln && CHILD(0).size() == 1) { if(CHILD(0)[0].contains(x_var)) { MathStructure msave(CHILD(1)); CHILD(1).set(CALCULATOR->v_e); CHILD(1).calculateRaise(msave, eo2); CHILD(0).setToChild(1, true); CHILDREN_UPDATED; if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { MathStructure *mand = new MathStructure(CHILD(0)); mand->add(m_zero, OPERATION_GREATER); mand->isolate_x_sub(eo, eo2, x_var); isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(mand, OPERATION_LOGICAL_AND); SWAP_CHILDREN(0, 1); calculatesub(eo2, eo, false); } else { isolate_x_sub(eo, eo2, x_var, morig); } return true; } } else if(CHILD(0).function() == CALCULATOR->f_lambert_w && CHILD(0).size() == 1 && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { if(CHILD(0)[0].contains(x_var)) { MathStructure msave(CHILD(1)); CHILD(1).set(CALCULATOR->v_e); CHILD(1).calculateRaise(msave, eo2); CHILD(1).calculateMultiply(msave, eo2); CHILD(0).setToChild(1, true); CHILDREN_UPDATED; if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { MathStructure *mand = new MathStructure(CHILD(0)); mand->add(m_zero, OPERATION_GREATER); mand->isolate_x_sub(eo, eo2, x_var); isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(mand, OPERATION_LOGICAL_AND); SWAP_CHILDREN(0, 1); calculatesub(eo2, eo, false); } else { isolate_x_sub(eo, eo2, x_var, morig); } return true; } } else if(CHILD(0).function() == CALCULATOR->f_logn && CHILD(0).size() == 2) { if(CHILD(0)[0].contains(x_var)) { MathStructure msave(CHILD(1)); CHILD(1) = CHILD(0)[1]; CHILD(1).calculateRaise(msave, eo2); CHILD(0).setToChild(1, true); CHILDREN_UPDATED; if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { MathStructure *mand = new MathStructure(CHILD(0)); mand->add(m_zero, OPERATION_GREATER); mand->isolate_x_sub(eo, eo2, x_var); isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(mand, OPERATION_LOGICAL_AND); SWAP_CHILDREN(0, 1); calculatesub(eo2, eo, false); } else { isolate_x_sub(eo, eo2, x_var, morig); } return true; } } else if(CHILD(0).function() == CALCULATOR->f_abs && CHILD(0).size() == 1) { if(CHILD(0)[0].contains(x_var)) { bool b_and = ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS; CHILD(0).setToChild(1); CHILD_UPDATED(0) MathStructure *mchild2 = new MathStructure(*this); isolate_x_sub(eo, eo2, x_var, morig); (*mchild2)[0].calculateNegate(eo2); mchild2->childUpdated(1); mchild2->isolate_x_sub(eo, eo2, x_var); if(b_and) { add_nocopy(mchild2, OPERATION_LOGICAL_AND); } else { add_nocopy(mchild2, OPERATION_LOGICAL_OR); } calculatesub(eo2, eo, false); return true; } } break; } default: {} } return false; } bool MathStructure::isolate_x(const EvaluationOptions &eo, const MathStructure &x_varp, bool check_result) { return isolate_x(eo, eo, x_varp, check_result); } bool MathStructure::isolate_x(const EvaluationOptions &eo, const EvaluationOptions &feo, const MathStructure &x_varp, bool check_result) { if(isProtected()) return false; if(!isComparison()) { bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isolate_x(eo, feo, x_varp, check_result)) { CHILD_UPDATED(i); b = true; } } return b; } MathStructure x_var(x_varp); if(x_var.isUndefined()) { const MathStructure *x_var2; if(eo.isolate_var && contains(*eo.isolate_var)) x_var2 = eo.isolate_var; else x_var2 = &find_x_var(); if(x_var2->isUndefined()) return false; x_var = *x_var2; } if(CHILD(0) == x_var && !CHILD(1).contains(x_var)) return true; if(!CHILD(1).isZero()) { CHILD(0).calculateSubtract(CHILD(1), eo); CHILD(1).clear(true); CHILDREN_UPDATED } EvaluationOptions eo2 = eo; eo2.calculate_functions = false; eo2.test_comparisons = false; eo2.isolate_x = false; if(!check_result) { return isolate_x_sub(feo, eo2, x_var); } if(CHILD(1).isZero() && CHILD(0).isAddition()) { bool found_1x = false; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i] == x_var) { found_1x = true; } else if(CHILD(0)[i].contains(x_var)) { found_1x = false; break; } } if(found_1x) return isolate_x_sub(feo, eo2, x_var); } MathStructure msave(*this); if(isolate_x_sub(feo, eo2, x_var)) { return test_comparisons(msave, *this, x_var, eo); } return false; } bool MathStructure::isRationalPolynomial() const { switch(m_type) { case STRUCT_NUMBER: { return o_number.isRational() && !o_number.isZero(); } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isAddition() || CHILD(i).isMultiplication() || !CHILD(i).isRationalPolynomial()) { return false; } } return true; } case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isAddition() || !CHILD(i).isRationalPolynomial()) { return false; } } return true; } case STRUCT_POWER: { return CHILD(1).isInteger() && CHILD(1).number().isNonNegative() && !CHILD(0).isMultiplication() && !CHILD(0).isAddition() && !CHILD(0).isPower() && CHILD(0).isRationalPolynomial(); } case STRUCT_FUNCTION: {} case STRUCT_UNIT: {} case STRUCT_VARIABLE: {} case STRUCT_SYMBOLIC: { return representsNonMatrix() && !representsUndefined(true, true); } default: {} } return false; } const Number &MathStructure::overallCoefficient() const { switch(m_type) { case STRUCT_NUMBER: { return o_number; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isNumber()) { return CHILD(i).number(); } } return nr_one; } case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isNumber()) { return CHILD(i).number(); } } return nr_zero; } case STRUCT_POWER: { return nr_zero; } default: {} } return nr_zero; } libqalculate-0.9.7/libqalculate/Function.cc0000644000175100017510000016227311305546372015673 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #include "support.h" #include "Function.h" #include "util.h" #include "Calculator.h" #include "MathStructure.h" #include "Variable.h" #include "Number.h" #include "Unit.h" MathFunction::MathFunction(string name_, int argc_, int max_argc_, string cat_, string title_, string descr_, bool is_active) : ExpressionItem(cat_, name_, title_, descr_, false, true, is_active) { argc = argc_; if(max_argc_ < 0 || argc < 0) { if(argc < 0) argc = 0; max_argc = -1; } else if(max_argc_ < argc) { max_argc = argc; } else { max_argc = max_argc_; for(int i = 0; i < max_argc - argc; i++) { default_values.push_back("0"); } } last_argdef_index = 0; } MathFunction::MathFunction(const MathFunction *function) { set(function); } MathFunction::MathFunction() { argc = 0; max_argc = 0; last_argdef_index = 0; } MathFunction::~MathFunction() { clearArgumentDefinitions(); } void MathFunction::set(const ExpressionItem *item) { if(item->type() == TYPE_FUNCTION) { MathFunction *f = (MathFunction*) item; argc = f->minargs(); max_argc = f->maxargs(); default_values.clear(); for(int i = argc + 1; i <= max_argc; i++) { setDefaultValue(i, f->getDefaultValue(i)); } last_argdef_index = f->lastArgumentDefinitionIndex(); scondition = f->condition(); clearArgumentDefinitions(); for(size_t i = 1; i <= f->lastArgumentDefinitionIndex(); i++) { if(f->getArgumentDefinition(i)) { setArgumentDefinition(i, f->getArgumentDefinition(i)->copy()); } } } ExpressionItem::set(item); } int MathFunction::type() const { return TYPE_FUNCTION; } int MathFunction::subtype() const { return SUBTYPE_FUNCTION; } /*int MathFunction::countArgOccurence(size_t arg_) { if((int) arg_ > argc && max_argc < 0) { arg_ = argc + 1; } if(argoccs.find(arg_) != argoccs.end()) { return argoccs[arg_]; } return 1; }*/ int MathFunction::args() const { return max_argc; } int MathFunction::minargs() const { return argc; } int MathFunction::maxargs() const { return max_argc; } string MathFunction::condition() const { return scondition; } void MathFunction::setCondition(string expression) { scondition = expression; remove_blank_ends(scondition); } bool MathFunction::testCondition(const MathStructure &vargs) { if(scondition.empty()) { return true; } UserFunction test_function("", "CONDITION_TEST_FUNCTION", scondition, false, argc, "", "", max_argc); MathStructure vargs2(vargs); MathStructure mstruct(test_function.MathFunction::calculate(vargs2)); EvaluationOptions eo; eo.approximation = APPROXIMATION_APPROXIMATE; mstruct.eval(eo); if(!mstruct.isNumber() || !mstruct.number().isPositive()) { if(CALCULATOR->showArgumentErrors()) { CALCULATOR->error(true, _("%s() requires that %s"), name().c_str(), printCondition().c_str(), NULL); } return false; } return true; } string MathFunction::printCondition() { if(scondition.empty() || last_argdef_index == 0) return scondition; string str = scondition; string svar, argstr; Argument *arg; int i_args = maxargs(); if(i_args < 0) { i_args = minargs() + 2; } for(int i = 0; i < i_args; i++) { svar = '\\'; if(maxargs() < 0 && i >= minargs()) { svar += (char) ('v' + i - minargs()); } else { if('x' + i > 'z') { svar += (char) ('a' + i - 3); } else { svar += 'x' + i; } } size_t i2 = 0; while(true) { if((i2 = str.find(svar, i2)) != string::npos) { if(maxargs() < 0 && i > minargs()) { arg = getArgumentDefinition(i); } else { arg = getArgumentDefinition(i + 1); } argstr = "\""; if(!arg || arg->name().empty()) { argstr += _("argument"); argstr += " "; if(maxargs() < 0 && i > minargs()) { argstr += i2s(i); } else { argstr += i2s(i + 1); } } else { argstr += arg->name(); } argstr += "\""; str.replace(i2, 2, argstr); } else { break; } } } return str; } int MathFunction::args(const string &argstr, MathStructure &vargs, const ParseOptions &parseoptions) { ParseOptions po = parseoptions; MathStructure *unended_function = po.unended_function; po.unended_function = NULL; vargs.clearVector(); int start_pos = 0; bool in_cit1 = false, in_cit2 = false; int pars = 0; int itmp = 0; string str = argstr, stmp; remove_blank_ends(str); Argument *arg; bool last_is_vctr = false, vctr_started = false; if(maxargs() > 0) { arg = getArgumentDefinition(maxargs()); last_is_vctr = arg && arg->type() == ARGUMENT_TYPE_VECTOR; } for(size_t str_index = 0; str_index < str.length(); str_index++) { switch(str[str_index]) { case LEFT_VECTOR_WRAP_CH: {} case LEFT_PARENTHESIS_CH: { if(!in_cit1 && !in_cit2) { pars++; } break; } case RIGHT_VECTOR_WRAP_CH: {} case RIGHT_PARENTHESIS_CH: { if(!in_cit1 && !in_cit2 && pars > 0) { pars--; } break; } case '\"': { if(in_cit1) { in_cit1 = false; } else if(!in_cit2) { in_cit1 = true; } break; } case '\'': { if(in_cit2) { in_cit2 = false; } else if(!in_cit1) { in_cit1 = true; } break; } case COMMA_CH: { if(pars == 0 && !in_cit1 && !in_cit2) { itmp++; if(itmp <= maxargs() || args() < 0) { stmp = str.substr(start_pos, str_index - start_pos); remove_blank_ends(stmp); arg = getArgumentDefinition(itmp); if(!arg && itmp > argc && args() < 0 && itmp > (int) last_argdef_index && last_argdef_index > 0) { arg = argdefs[last_argdef_index]; } if(stmp.empty()) { if(arg) { MathStructure *mstruct = new MathStructure(); arg->parse(mstruct, getDefaultValue(itmp), po); vargs.addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, getDefaultValue(itmp)); vargs.addChild_nocopy(mstruct); } } else { if(arg) { MathStructure *mstruct = new MathStructure(); arg->parse(mstruct, stmp, po); vargs.addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, stmp, po); vargs.addChild_nocopy(mstruct); } } } else if(last_is_vctr) { if(!vctr_started) { vargs[vargs.size() - 1].transform(STRUCT_VECTOR); vctr_started = true; } stmp = str.substr(start_pos, str_index - start_pos); remove_blank_ends(stmp); if(stmp.empty()) { MathStructure *mstruct = new MathStructure(); getArgumentDefinition(maxargs())->parse(mstruct, getDefaultValue(itmp)); vargs[vargs.size() - 1].addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); getArgumentDefinition(maxargs())->parse(mstruct, stmp, po); vargs[vargs.size() - 1].addChild_nocopy(mstruct); } vargs.childUpdated(vargs.size()); } else { CALCULATOR->error(false, _("Additional arguments for function %s() was ignored. Function can only use %s argument(s)."), name().c_str(), i2s(maxargs()).c_str(), NULL); } start_pos = str_index + 1; } break; } } } if(!str.empty()) { itmp++; po.unended_function = unended_function; if(itmp <= maxargs() || args() < 0) { stmp = str.substr(start_pos, str.length() - start_pos); remove_blank_ends(stmp); arg = getArgumentDefinition(itmp); if(!arg && itmp > argc && args() < 0 && itmp > (int) last_argdef_index && last_argdef_index > 0) { arg = argdefs[last_argdef_index]; } if(stmp.empty()) { if(arg) { MathStructure *mstruct = new MathStructure(); arg->parse(mstruct, getDefaultValue(itmp)); vargs.addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, getDefaultValue(itmp)); vargs.addChild_nocopy(mstruct); } } else { if(arg) { MathStructure *mstruct = new MathStructure(); arg->parse(mstruct, stmp, po); vargs.addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, stmp, po); vargs.addChild_nocopy(mstruct); } } } else if(last_is_vctr) { if(!vctr_started) { vargs[vargs.size() - 1].transform(STRUCT_VECTOR); vctr_started = true; } stmp = str.substr(start_pos, str.length() - start_pos); remove_blank_ends(stmp); if(stmp.empty()) { MathStructure *mstruct = new MathStructure(); getArgumentDefinition(maxargs())->parse(mstruct, getDefaultValue(itmp)); vargs[vargs.size() - 1].addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); getArgumentDefinition(maxargs())->parse(mstruct, stmp, po); vargs[vargs.size() - 1].addChild_nocopy(mstruct); } vargs.childUpdated(vargs.size()); } else { CALCULATOR->error(false, _("Additional arguments for function %s() was ignored. Function can only use %s argument(s)."), name().c_str(), i2s(maxargs()).c_str(), NULL); } } if(unended_function && !unended_function->isFunction()) { unended_function->set(vargs); unended_function->setType(STRUCT_FUNCTION); unended_function->setFunction(this); while((int) unended_function->size() < itmp) { unended_function->addChild(m_undefined); } } if(itmp < maxargs() && itmp >= minargs()) { int itmp2 = itmp; while(itmp2 < maxargs()) { arg = getArgumentDefinition(itmp2 + 1); if(arg) { MathStructure *mstruct = new MathStructure(); arg->parse(mstruct, default_values[itmp2 - minargs()]); vargs.addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, default_values[itmp2 - minargs()]); vargs.addChild_nocopy(mstruct); } itmp2++; } } return itmp; } size_t MathFunction::lastArgumentDefinitionIndex() const { return last_argdef_index; } Argument *MathFunction::getArgumentDefinition(size_t index) { if(argdefs.find(index) != argdefs.end()) { return argdefs[index]; } return NULL; } void MathFunction::clearArgumentDefinitions() { for(Sgi::hash_map::iterator it = argdefs.begin(); it != argdefs.end(); ++it) { delete it->second; } argdefs.clear(); last_argdef_index = 0; setChanged(true); } void MathFunction::setArgumentDefinition(size_t index, Argument *argdef) { if(argdefs.find(index) != argdefs.end()) { delete argdefs[index]; } argdefs[index] = argdef; if(index > last_argdef_index) { last_argdef_index = index; } setChanged(true); } bool MathFunction::testArgumentCount(int itmp) { if(itmp >= minargs()) { if(itmp > maxargs() && maxargs() >= 0) { CALCULATOR->error(false, _("Additional arguments for function %s() was ignored. Function can only use %s argument(s)."), name().c_str(), i2s(maxargs()).c_str(), NULL); } return true; } string str; Argument *arg; bool b = false; for(int i = 1; i <= minargs(); i++) { arg = getArgumentDefinition(i); if(i > 1) { str += CALCULATOR->getComma(); str += " "; } if(arg && !arg->name().empty()) { str += arg->name(); b = true; } else { str += "?"; } } if(b) { CALCULATOR->error(true, _("You need at least %s argument(s) (%s) in function %s()."), i2s(minargs()).c_str(), str.c_str(), name().c_str(), NULL); } else { CALCULATOR->error(true, _("You need at least %s argument(s) in function %s()."), i2s(minargs()).c_str(), name().c_str(), NULL); } return false; } MathStructure MathFunction::createFunctionMathStructureFromVArgs(const MathStructure &vargs) { MathStructure mstruct(this, NULL); for(size_t i = 0; i < vargs.size(); i++) { mstruct.addChild(vargs[i]); } return mstruct; } MathStructure MathFunction::createFunctionMathStructureFromSVArgs(vector &svargs) { MathStructure mstruct(this, NULL); for(size_t i = 0; i < svargs.size(); i++) { mstruct.addChild(svargs[i]); } return mstruct; } MathStructure MathFunction::calculate(const string &argv, const EvaluationOptions &eo) { /* MathStructure vargs; args(argv, vargs, eo.parse_options); return calculate(vargs, eo);*/ MathStructure fmstruct(parse(argv, eo.parse_options)); fmstruct.calculateFunctions(eo); return fmstruct; } MathStructure MathFunction::parse(const string &argv, const ParseOptions &po) { MathStructure vargs; args(argv, vargs, po); vargs.setType(STRUCT_FUNCTION); vargs.setFunction(this); return vargs; //return createFunctionMathStructureFromVArgs(vargs); } int MathFunction::parse(MathStructure &mstruct, const string &argv, const ParseOptions &po) { int n = args(argv, mstruct, po); mstruct.setType(STRUCT_FUNCTION); mstruct.setFunction(this); return n; } bool MathFunction::testArguments(MathStructure &vargs) { size_t last = 0; for(Sgi::hash_map::iterator it = argdefs.begin(); it != argdefs.end(); ++it) { if(it->first > last) { last = it->first; } if(it->second && it->first > 0 && it->first <= vargs.size() && !it->second->test(vargs[it->first - 1], it->first, this)) { return false; } } if(max_argc < 0 && (int) last > argc && argdefs.find(last) != argdefs.end()) { for(size_t i = last + 1; i <= vargs.size(); i++) { if(!argdefs[last]->test(vargs[i - 1], i, this)) { return false; } } } return testCondition(vargs); } MathStructure MathFunction::calculate(MathStructure &vargs, const EvaluationOptions &eo) { int itmp = vargs.size(); if(testArgumentCount(itmp)) { appendDefaultValues(vargs); MathStructure mstruct; int ret = 0; if(!testArguments(vargs) || (ret = calculate(mstruct, vargs, eo)) < 1) { if(ret < 0) { ret = -ret; if(maxargs() > 0 && ret > maxargs()) { if(mstruct.isVector()) { for(size_t arg_i = 0; arg_i < vargs.size() && arg_i < mstruct.size(); arg_i++) { vargs.setChild(mstruct[arg_i], arg_i + 1); } } } else if(ret <= (int) vargs.size()) { vargs.setChild(mstruct, ret); } } return createFunctionMathStructureFromVArgs(vargs); } if(precision() > 0 && precision() < mstruct.precision()) mstruct.setPrecision(precision()); if(isApproximate()) mstruct.setApproximate(); return mstruct; } else { return createFunctionMathStructureFromVArgs(vargs); } } int MathFunction::calculate(MathStructure&, const MathStructure&, const EvaluationOptions&) { //mstruct = createFunctionMathStructureFromVArgs(vargs); return 0; } void MathFunction::setDefaultValue(size_t arg_, string value_) { if((int) arg_ > argc && (int) arg_ <= max_argc && (int) default_values.size() >= (int) arg_ - argc) { default_values[arg_ - argc - 1] = value_; } } const string &MathFunction::getDefaultValue(size_t arg_) const { if((int) arg_ > argc && (int) arg_ <= max_argc && (int) default_values.size() >= (int) arg_ - argc) { return default_values[arg_ - argc - 1]; } return empty_string; } void MathFunction::appendDefaultValues(MathStructure &vargs) { if((int) vargs.size() < minargs()) return; while((int) vargs.size() < maxargs()) { Argument *arg = getArgumentDefinition(vargs.size() + 1); if(arg) { MathStructure *mstruct = new MathStructure(); arg->parse(mstruct, default_values[vargs.size() - minargs()]); vargs.addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, default_values[vargs.size() - minargs()]); vargs.addChild_nocopy(mstruct); } } } int MathFunction::stringArgs(const string &argstr, vector &svargs) { svargs.clear(); int start_pos = 0; bool in_cit1 = false, in_cit2 = false; int pars = 0; int itmp = 0; string str = argstr, stmp; remove_blank_ends(str); for(size_t str_index = 0; str_index < str.length(); str_index++) { switch(str[str_index]) { case LEFT_PARENTHESIS_CH: { if(!in_cit1 && !in_cit2) { pars++; } break; } case RIGHT_PARENTHESIS_CH: { if(!in_cit1 && !in_cit2 && pars > 0) { pars--; } break; } case '\"': { if(in_cit1) { in_cit1 = false; } else if(!in_cit2) { in_cit1 = true; } break; } case '\'': { if(in_cit2) { in_cit2 = false; } else if(!in_cit1) { in_cit1 = true; } break; } case COMMA_CH: { if(pars == 0 && !in_cit1 && !in_cit2) { itmp++; if(itmp <= maxargs() || args() < 0) { stmp = str.substr(start_pos, str_index - start_pos); remove_blank_ends(stmp); remove_parenthesis(stmp); remove_blank_ends(stmp); if(stmp.empty()) { stmp = getDefaultValue(itmp); } svargs.push_back(stmp); } start_pos = str_index + 1; } break; } } } if(!str.empty()) { itmp++; if(itmp <= maxargs() || args() < 0) { stmp = str.substr(start_pos, str.length() - start_pos); remove_blank_ends(stmp); remove_parenthesis(stmp); remove_blank_ends(stmp); if(stmp.empty()) { stmp = getDefaultValue(itmp); } svargs.push_back(stmp); } } if(itmp < maxargs() && itmp >= minargs()) { int itmp2 = itmp; while(itmp2 < maxargs()) { svargs.push_back(default_values[itmp2 - minargs()]); itmp2++; } } return itmp; } MathStructure MathFunction::produceVector(const MathStructure &vargs, int begin, int end) { if(begin < 1) { begin = minargs() + 1; if(begin < 1) begin = 1; } if(end < 1 || end >= (int) vargs.size()) { end = vargs.size(); } if(begin == 1 && vargs.size() == 1) { if(vargs[0].isVector()) { return vargs[0]; } else { return vargs; } } MathStructure mstruct; vargs.getRange(begin, end, mstruct); MathStructure mstruct2; return mstruct.flattenVector(mstruct2); } MathStructure MathFunction::produceArgumentsVector(const MathStructure &vargs, int begin, int end) { if(begin < 1) { begin = minargs() + 1; if(begin < 1) begin = 1; } if(end < 1 || end >= (int) vargs.size()) { end = vargs.size(); } if(begin == 1 && vargs.size() == 1) { return vargs; } MathStructure mstruct; return vargs.getRange(begin, end, mstruct); } bool MathFunction::representsPositive(const MathStructure&, bool) const {return false;} bool MathFunction::representsNegative(const MathStructure&, bool) const {return false;} bool MathFunction::representsNonNegative(const MathStructure &vargs, bool allow_units) const {return representsPositive(vargs, allow_units);} bool MathFunction::representsNonPositive(const MathStructure &vargs, bool allow_units) const {return representsNegative(vargs, allow_units);} bool MathFunction::representsInteger(const MathStructure &vargs, bool allow_units) const {return representsBoolean(vargs) || representsEven(vargs, allow_units) || representsOdd(vargs, allow_units);} bool MathFunction::representsNumber(const MathStructure &vargs, bool allow_units) const {return representsReal(vargs, allow_units) || representsComplex(vargs, allow_units);} bool MathFunction::representsRational(const MathStructure &vargs, bool allow_units) const {return representsInteger(vargs, allow_units);} bool MathFunction::representsReal(const MathStructure &vargs, bool allow_units) const {return representsRational(vargs, allow_units);} bool MathFunction::representsComplex(const MathStructure&, bool) const {return false;} bool MathFunction::representsNonZero(const MathStructure &vargs, bool allow_units) const {return representsPositive(vargs, allow_units) || representsNegative(vargs, allow_units);} bool MathFunction::representsEven(const MathStructure&, bool) const {return false;} bool MathFunction::representsOdd(const MathStructure&, bool) const {return false;} bool MathFunction::representsUndefined(const MathStructure&) const {return false;} bool MathFunction::representsBoolean(const MathStructure&) const {return false;} bool MathFunction::representsNonMatrix(const MathStructure &vargs) const {return representsNumber(vargs, true);} UserFunction::UserFunction(string cat_, string name_, string formula_, bool is_local, int argc_, string title_, string descr_, int max_argc_, bool is_active) : MathFunction(name_, argc_, max_argc_, cat_, title_, descr_, is_active) { b_local = is_local; b_builtin = false; setFormula(formula_, argc_, max_argc_); setChanged(false); } UserFunction::UserFunction(const UserFunction *function) { set(function); } string UserFunction::formula() const { return sformula; } string UserFunction::internalFormula() const { return sformula_calc; } ExpressionItem *UserFunction::copy() const { return new UserFunction(this); } void UserFunction::set(const ExpressionItem *item) { if(item->type() == TYPE_FUNCTION && item->subtype() == SUBTYPE_USER_FUNCTION) { sformula = ((UserFunction*) item)->formula(); sformula_calc = ((UserFunction*) item)->internalFormula(); v_subs.clear(); v_precalculate.clear(); for(size_t i = 1; i <= ((UserFunction*) item)->countSubfunctions(); i++) { v_subs.push_back(((UserFunction*) item)->getSubfunction(i)); v_precalculate.push_back(((UserFunction*) item)->subfunctionPrecalculated(i)); } } MathFunction::set(item); } int UserFunction::subtype() const { return SUBTYPE_USER_FUNCTION; } int UserFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { ParseOptions po; if(args() != 0) { string stmp = sformula_calc; string svar; string v_str, w_str; vector v_strs; vector v_id; size_t i2 = 0; int i_args = maxargs(); if(i_args < 0) { i_args = minargs(); } for(int i = 0; i < i_args; i++) { v_id.push_back(CALCULATOR->addId(new MathStructure(vargs[i]), true)); v_strs.push_back(LEFT_PARENTHESIS ID_WRAP_LEFT); v_strs[i] += i2s(v_id[i]); v_strs[i] += ID_WRAP_RIGHT RIGHT_PARENTHESIS; } if(maxargs() < 0) { if(stmp.find("\\v") != string::npos) { v_id.push_back(CALCULATOR->addId(new MathStructure(produceVector(vargs)), true)); v_str = LEFT_PARENTHESIS ID_WRAP_LEFT; v_str += i2s(v_id[v_id.size() - 1]); v_str += ID_WRAP_RIGHT RIGHT_PARENTHESIS; } if(stmp.find("\\w") != string::npos) { v_id.push_back(CALCULATOR->addId(new MathStructure(produceArgumentsVector(vargs)), true)); w_str = LEFT_PARENTHESIS ID_WRAP_LEFT; w_str += i2s(v_id[v_id.size() - 1]); w_str += ID_WRAP_RIGHT RIGHT_PARENTHESIS; } } for(size_t i = 0; i < v_subs.size(); i++) { if(subfunctionPrecalculated(i + 1)) { string str = v_subs[i]; for(int i3 = 0; i3 < i_args; i3++) { svar = '\\'; if('x' + i3 > 'z') { svar += (char) ('a' + i3 - 3); } else { svar += 'x' + i3; } i2 = 0; while(true) { if((i2 = str.find(svar, i2)) != string::npos) { if(i2 != 0 && str[i2 - 1] == '\\') { i2 += 2; } else { str.replace(i2, 2, v_strs[i3]); } } else { break; } } } if(maxargs() < 0) { i2 = 0; while(true) { if((i2 = str.find("\\v")) != string::npos) { if(i2 != 0 && str[i2 - 1] == '\\') { i2 += 2; } else { str.replace(i2, 2, v_str); } } else { break; } } i2 = 0; while(true) { if((i2 = str.find("\\w")) != string::npos) { if(i2 != 0 && str[i2 - 1] == '\\') { i2 += 2; } else { str.replace(i2, 2, w_str); } } else { break; } } } MathStructure *v_mstruct = new MathStructure(); CALCULATOR->parse(v_mstruct, str, po); v_mstruct->eval(eo); v_id.push_back(CALCULATOR->addId(v_mstruct, true)); str = LEFT_PARENTHESIS ID_WRAP_LEFT; str += i2s(v_id[v_id.size() - 1]); str += ID_WRAP_RIGHT RIGHT_PARENTHESIS; i2 = 0; svar = '\\'; svar += i2s(i + 1); while(true) { if((i2 = stmp.find(svar, i2)) != string::npos) { if(i2 != 0 && stmp[i2 - 1] == '\\') { i2 += 2; } else { stmp.replace(i2, 2, str); } } else { break; } } } else { i2 = 0; svar = '\\'; svar += i2s(i + 1); while(true) { if((i2 = stmp.find(svar, i2)) != string::npos) { if(i2 != 0 && stmp[i2 - 1] == '\\') { i2 += svar.size(); } else { stmp.replace(i2, svar.size(), v_subs[i]); } } else { break; } } } } for(int i = 0; i < i_args; i++) { svar = '\\'; if('x' + i > 'z') { svar += (char) ('a' + i - 3); } else { svar += 'x' + i; } i2 = 0; while(true) { if((i2 = stmp.find(svar, i2)) != string::npos) { if(i2 != 0 && stmp[i2 - 1] == '\\') { i2 += 2; } else { stmp.replace(i2, 2, v_strs[i]); } } else { break; } } } if(maxargs() < 0) { i2 = 0; while(true) { if((i2 = stmp.find("\\v")) != string::npos) { if(i2 != 0 && stmp[i2 - 1] == '\\') { i2 += 2; } else { stmp.replace(i2, 2, v_str); } } else { break; } } i2 = 0; while(true) { if((i2 = stmp.find("\\w")) != string::npos) { if(i2 != 0 && stmp[i2 - 1] == '\\') { i2 += 2; } else { stmp.replace(i2, 2, w_str); } } else { break; } } } while(true) { if((i2 = stmp.find("\\\\")) != string::npos) { stmp.replace(i2, 2, "\\"); } else { break; } } CALCULATOR->parse(&mstruct, stmp, po); for(size_t i = 0; i < v_id.size(); i++) { CALCULATOR->delId(v_id[i]); } if(precision() > 0) mstruct.setPrecision(precision()); if(isApproximate()) mstruct.setApproximate(); } else { CALCULATOR->parse(&mstruct, sformula_calc, po); if(precision() > 0) mstruct.setPrecision(precision()); if(isApproximate()) mstruct.setApproximate(); } return 1; } void UserFunction::setFormula(string new_formula, int argc_, int max_argc_) { setChanged(true); sformula = new_formula; default_values.clear(); if(sformula.empty() && v_subs.empty()) { sformula_calc = new_formula; argc = 0; max_argc = 0; return; } if(argc_ < 0) { argc_ = 0, max_argc_ = 0; string svar, svar_o, svar_v; bool optionals = false, b; size_t i3 = 0, i4 = 0, i5 = 0; size_t i2 = 0; for(int i = 0; i < 26; i++) { begin_loop_in_set_formula: i4 = 0; i5 = 0; svar = '\\'; svar_o = '\\'; if('x' + i > 'z') svar += (char) ('a' + i - 3); else svar += 'x' + i; if('X' + i > 'Z') svar_o += (char) ('A' + i - 3); else svar_o += 'X' + i; before_find_in_set_formula: if(i < 24 && (i2 = new_formula.find(svar_o, i4)) != string::npos) { if(i2 > 0 && new_formula[i2 - 1] == '\\') { i4 = i2 + 2; goto before_find_in_set_formula; } i3 = 0; if(new_formula.length() > i2 + 2 && new_formula[i2 + 2] == ID_WRAP_LEFT_CH) { if((i3 = new_formula.find(ID_WRAP_RIGHT_CH, i2 + 2)) != string::npos) { svar_v = new_formula.substr(i2 + 3, i3 - (i2 + 3)); i3 -= i2 + 1; } else i3 = 0; } if(i3) { default_values.push_back(svar_v); } else { default_values.push_back("0"); } new_formula.replace(i2, 2 + i3, svar); while((i2 = new_formula.find(svar_o, i2 + 1)) != string::npos) { if(i2 > 0 && new_formula[i2 - 1] == '\\') { i2++; } else { new_formula.replace(i2, 2, svar); } } for(size_t sub_i = 0; sub_i < v_subs.size(); sub_i++) { i2 = 0; while((i2 = v_subs[sub_i].find(svar_o, i2 + 1)) != string::npos) { if(i2 > 0 && v_subs[sub_i][i2 - 1] == '\\') { i2++; } else { v_subs[sub_i].replace(i2, 2, svar); } } } optionals = true; } else if((i2 = new_formula.find(svar, i5)) != string::npos) { if(i2 > 0 && new_formula[i2 - 1] == '\\') { i5 = i2 + 2; goto before_find_in_set_formula; } } else { b = false; for(size_t sub_i = 0; sub_i < v_subs.size(); sub_i++) { before_find_in_vsubs_set_formula: if(i < 24 && (i2 = v_subs[sub_i].find(svar_o, i4)) != string::npos) { if(i2 > 0 && v_subs[sub_i][i2 - 1] == '\\') { i4 = i2 + 2; goto before_find_in_vsubs_set_formula; } i3 = 0; if(v_subs[sub_i].length() > i2 + 2 && v_subs[sub_i][i2 + 2] == ID_WRAP_LEFT_CH) { if((i3 = v_subs[sub_i].find(ID_WRAP_RIGHT_CH, i2 + 2)) != string::npos) { svar_v = v_subs[sub_i].substr(i2 + 3, i3 - (i2 + 3)); i3 -= i2 + 1; } else i3 = 0; } if(i3) { default_values.push_back(svar_v); } else { default_values.push_back("0"); } v_subs[sub_i].replace(i2, 2 + i3, svar); while((i2 = v_subs[sub_i].find(svar_o, i2 + 1)) != string::npos) { if(i2 > 0 && v_subs[sub_i][i2 - 1] == '\\') { i2++; } else { v_subs[sub_i].replace(i2, 2, svar); } } optionals = true; b = true; } else if((i2 = v_subs[sub_i].find(svar, i5)) != string::npos) { if(i2 > 0 && v_subs[sub_i][i2 - 1] == '\\') { i5 = i2 + 2; goto before_find_in_vsubs_set_formula; } b = true; } } if(!b) { if(i < 24 && !optionals) { i = 24; goto begin_loop_in_set_formula; } break; } } if(i >= 24) { max_argc_ = -1; } else { if(optionals) { max_argc_++; } else { max_argc_++; argc_++; } } } } if(argc_ > 24) { argc_ = 24; } if(max_argc_ > 24) { max_argc_ = 24; } if(max_argc_ < 0 || argc_ < 0) { max_argc_ = -1; if(argc_ < 0) argc_ = 0; } else if(max_argc_ < argc_) { max_argc_ = argc_; } while((int) default_values.size() < max_argc_ - argc_) { default_values.push_back("0"); } if(max_argc_ > 0) default_values.resize(max_argc_ - argc_); sformula_calc = new_formula; argc = argc_; max_argc = max_argc_; } void UserFunction::addSubfunction(string subfunction, bool precalculate) { setChanged(true); v_subs.push_back(subfunction); v_precalculate.push_back(precalculate); } void UserFunction::setSubfunction(size_t index, string subfunction) { if(index > 0 && index <= v_subs.size()) { setChanged(true); v_subs[index - 1] = subfunction; } } void UserFunction::delSubfunction(size_t index) { if(index > 0 && index <= v_subs.size()) { setChanged(true); v_subs.erase(v_subs.begin() + (index - 1)); } if(index > 0 && index <= v_precalculate.size()) { setChanged(true); v_precalculate.erase(v_precalculate.begin() + (index - 1)); } } void UserFunction::clearSubfunctions() { setChanged(true); v_subs.clear(); v_precalculate.clear(); } void UserFunction::setSubfunctionPrecalculated(size_t index, bool precalculate) { if(index > 0 && index <= v_precalculate.size()) { setChanged(true); v_precalculate[index - 1] = precalculate; } } size_t UserFunction::countSubfunctions() const { return v_subs.size(); } const string &UserFunction::getSubfunction(size_t index) const { if(index > 0 && index <= v_subs.size()) { return v_subs[index - 1]; } return empty_string; } bool UserFunction::subfunctionPrecalculated(size_t index) const { if(index > 0 && index <= v_precalculate.size()) { return v_precalculate[index - 1]; } return false; } Argument::Argument(string name_, bool does_test, bool does_error) { sname = name_; remove_blank_ends(sname); scondition = ""; b_zero = true; b_test = does_test; b_matrix = false; b_text = false; b_error = does_error; b_rational = false; } Argument::Argument(const Argument *arg) { b_text = false; set(arg); } Argument::~Argument() {} Argument *Argument::copy() const { return new Argument(this); } string Argument::print() const {return "";} string Argument::subprintlong() const {return _("a free value");} string Argument::printlong() const { string str = subprintlong(); if(!b_zero) { str += " "; str += _("that is nonzero"); } if(b_rational) { if(!b_zero) { str += " "; str += _("and"); } str += " "; str += _("that is rational (polynomial)"); } if(!scondition.empty()) { if(!b_zero || b_rational) { str += " "; str += _("and"); } str += " "; str += _("that fulfills the condition:"); str += " \""; string str2 = scondition; if(name().empty()) gsub("\\x", _("Argument"), str2); else gsub("\\x", name(), str2); str += str2; str += "\""; } return str; } void Argument::set(const Argument *arg) { sname = arg->name(); scondition = arg->getCustomCondition(); b_zero = !arg->zeroForbidden(); b_test = arg->tests(); b_matrix = arg->matrixAllowed(); b_rational = arg->rationalPolynomial(); } bool Argument::test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo) const { if(!b_test) { return true; } bool evaled = false; bool b = subtest(value, eo); if(b && !b_zero) { if(!value.isNumber() && !value.representsNonZero()) { value.eval(eo); evaled = true; } b = value.representsNonZero(); } if(b && b_rational) { if(!evaled) { value.eval(eo); evaled = true; } b = value.isRationalPolynomial(); } if(!b && b_matrix) { if(!evaled && !value.isMatrix()) { value.eval(eo); evaled = true; } b = value.isMatrix(); } if(b && !scondition.empty()) { string expression = scondition; int id = CALCULATOR->addId(new MathStructure(value), true); string ids = LEFT_PARENTHESIS ID_WRAP_LEFT; ids += i2s(id); ids += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\x", ids, expression); b = CALCULATOR->testCondition(expression); CALCULATOR->delId(id); } if(!b) { if(b_error) { if(sname.empty()) { CALCULATOR->error(true, _("Argument %s in %s() must be %s."), i2s(index).c_str(), f->name().c_str(), printlong().c_str(), NULL); } else { CALCULATOR->error(true, _("Argument %s, %s, in %s() must be %s."), i2s(index).c_str(), sname.c_str(), f->name().c_str(), printlong().c_str(), NULL); } } return false; } return true; } MathStructure Argument::parse(const string &str, const ParseOptions &po) const { MathStructure mstruct; parse(&mstruct, str, po); return mstruct; } void Argument::parse(MathStructure *mstruct, const string &str, const ParseOptions &po) const { if(b_text) { size_t pars = 0; while(true) { size_t pars2 = 1; size_t i = pars; if(str.length() >= 2 + pars * 2 && str[pars] == LEFT_PARENTHESIS_CH && str[str.length() - 1 - pars] == RIGHT_PARENTHESIS_CH) { while(true) { i = str.find_first_of(LEFT_PARENTHESIS RIGHT_PARENTHESIS, i + 1); if(i == string::npos || i >= str.length() - 1 - pars) { break; } else if(str[i] == LEFT_PARENTHESIS_CH) { pars2++; } else if(str[i] == RIGHT_PARENTHESIS_CH) { pars2--; if(pars2 == 0) { break; } } } if(pars2 > 0) { pars++; } } else { break; } if(pars2 == 0) break; } if(str.length() >= 2 + pars * 2) { if(str[pars] == ID_WRAP_LEFT_CH && str[str.length() - 1 - pars] == ID_WRAP_RIGHT_CH && str.find(ID_WRAP_RIGHT, pars + 1) == str.length() - 1 - pars) { CALCULATOR->parse(mstruct, str.substr(pars, str.length() - pars * 2), po); return; } if(str[pars] == '\\' && str[str.length() - 1 - pars] == '\\') { CALCULATOR->parse(mstruct, str.substr(1 + pars, str.length() - 2 - pars * 2), po); return; } if((str[pars] == '\"' && str[str.length() - 1 - pars] == '\"') || (str[pars] == '\'' && str[str.length() - 1 - pars] == '\'')) { size_t i = pars + 1, cits = 0; while(i < str.length() - 1 - pars) { i = str.find(str[pars], i); if(i >= str.length() - 1 - pars) { break; } cits++; i++; } if((cits / 2) % 2 == 0) { i = str.find(ID_WRAP_LEFT, 1 + pars); if(i == string::npos || i >= str.length() - (1 + pars)) { mstruct->set(str.substr(1 + pars, str.length() - 2 - pars * 2)); return; } string str2 = str.substr(1 + pars, str.length() - 2 - pars * 2); string str3; i = 0; size_t i2 = 0; int id = 0; while((i = str2.find(ID_WRAP_LEFT, i)) != string::npos) { i2 = str2.find(ID_WRAP_RIGHT, i + 1); if(i2 == string::npos) break; id = s2i(str2.substr(i + 1, i2 - (i + 1))); MathStructure *m_temp = CALCULATOR->getId((size_t) id); str3 = "("; if(!m_temp) { CALCULATOR->error(true, _("Internal id %s does not exist."), i2s(id).c_str(), NULL); str3 += CALCULATOR->v_undef->preferredInputName(true, false, false, true).name; } else { str3 += m_temp->print(CALCULATOR->save_printoptions).c_str(); m_temp->unref(); } str3 += ")"; str2.replace(i, i2 - i + 1, str3); i += str3.length(); } mstruct->set(str2); return; } } } size_t i = str.find(ID_WRAP_LEFT, pars); if(i == string::npos || i >= str.length() - pars) { mstruct->set(str.substr(pars, str.length() - pars * 2)); return; } string str2 = str.substr(pars, str.length() - pars * 2); string str3; i = 0; size_t i2 = 0; int id = 0; while((i = str2.find(ID_WRAP_LEFT, i)) != string::npos) { i2 = str2.find(ID_WRAP_RIGHT, i + 1); if(i2 == string::npos) break; id = s2i(str2.substr(i + 1, i2 - (i + 1))); MathStructure *m_temp = CALCULATOR->getId((size_t) id); str3 = "("; if(!m_temp) { CALCULATOR->error(true, _("Internal id %s does not exist."), i2s(id).c_str(), NULL); str3 += CALCULATOR->v_undef->preferredInputName(true, false, false, true).name; } else { str3 += m_temp->print(CALCULATOR->save_printoptions).c_str(); m_temp->unref(); } str3 += ")"; str2.replace(i, i2 - i + 1, str3); i += str3.length(); } mstruct->set(str2); return; } else { CALCULATOR->parse(mstruct, str, po); } } bool Argument::subtest(MathStructure&, const EvaluationOptions&) const { return true; } string Argument::name() const { return sname; } void Argument::setName(string name_) { sname = name_; remove_blank_ends(sname); } void Argument::setCustomCondition(string condition) { scondition = condition; remove_blank_ends(scondition); } string Argument::getCustomCondition() const { return scondition; } bool Argument::zeroForbidden() const { return !b_zero; } void Argument::setZeroForbidden(bool forbid_zero) { b_zero = !forbid_zero; } bool Argument::tests() const { return b_test; } void Argument::setTests(bool does_test) { b_test = does_test; } bool Argument::alerts() const { return b_error; } void Argument::setAlerts(bool does_error) { b_error = does_error; } bool Argument::suggestsQuotes() const {return false;} int Argument::type() const { return ARGUMENT_TYPE_FREE; } bool Argument::matrixAllowed() const {return b_matrix;} void Argument::setMatrixAllowed(bool allow_matrix) {b_matrix = allow_matrix;} bool Argument::rationalPolynomial() const {return b_rational;} void Argument::setRationalPolynomial(bool rational_polynomial) {b_rational = rational_polynomial;} NumberArgument::NumberArgument(string name_, ArgumentMinMaxPreDefinition minmax, bool does_test, bool does_error) : Argument(name_, does_test, does_error) { fmin = NULL; fmax = NULL; b_incl_min = true; b_incl_max = true; b_complex = true; b_rational_number = false; switch(minmax) { case ARGUMENT_MIN_MAX_POSITIVE: { fmin = new Number(); b_incl_min = false; break; } case ARGUMENT_MIN_MAX_NEGATIVE: { fmax = new Number(); b_incl_max = false; break; } case ARGUMENT_MIN_MAX_NONNEGATIVE: { fmin = new Number(); break; } case ARGUMENT_MIN_MAX_NONZERO: { setZeroForbidden(true); break; } default: {} } } NumberArgument::NumberArgument(const NumberArgument *arg) { fmin = NULL; fmax = NULL; set(arg); } NumberArgument::~NumberArgument() { if(fmin) { delete fmin; } if(fmax) { delete fmax; } } void NumberArgument::setMin(const Number *nmin) { if(!nmin) { if(fmin) { delete fmin; } return; } if(!fmin) { fmin = new Number(*nmin); } else { fmin->set(*nmin); } } void NumberArgument::setIncludeEqualsMin(bool include_equals) { b_incl_min = include_equals; } bool NumberArgument::includeEqualsMin() const { return b_incl_min; } const Number *NumberArgument::min() const { return fmin; } void NumberArgument::setMax(const Number *nmax) { if(!nmax) { if(fmax) { delete fmax; } return; } if(!fmax) { fmax = new Number(*nmax); } else { fmax->set(*nmax); } } void NumberArgument::setIncludeEqualsMax(bool include_equals) { b_incl_max = include_equals; } bool NumberArgument::includeEqualsMax() const { return b_incl_max; } const Number *NumberArgument::max() const { return fmax; } bool NumberArgument::complexAllowed() const { return b_complex; } void NumberArgument::setComplexAllowed(bool allow_complex) { b_complex = allow_complex; } bool NumberArgument::rationalNumber() const { return b_rational_number; } void NumberArgument::setRationalNumber(bool rational_number) { b_rational_number = rational_number; } bool NumberArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isNumber()) { value.eval(eo); } if(!value.isNumber() || (b_rational_number && !value.number().isRational()) || (!b_complex && value.number().isComplex())) { return false; } if(fmin) { ComparisonResult cmpr = fmin->compare(value.number()); if(!(cmpr == COMPARISON_RESULT_GREATER || (b_incl_min && COMPARISON_IS_EQUAL_OR_GREATER(cmpr)))) { return false; } } if(fmax) { ComparisonResult cmpr = fmax->compare(value.number()); if(!(cmpr == COMPARISON_RESULT_LESS || (b_incl_max && COMPARISON_IS_EQUAL_OR_LESS(cmpr)))) { return false; } } return true; } int NumberArgument::type() const { return ARGUMENT_TYPE_NUMBER; } Argument *NumberArgument::copy() const { return new NumberArgument(this); } void NumberArgument::set(const Argument *arg) { if(arg->type() == ARGUMENT_TYPE_NUMBER) { const NumberArgument *farg = (const NumberArgument*) arg; b_incl_min = farg->includeEqualsMin(); b_incl_max = farg->includeEqualsMax(); b_complex = farg->complexAllowed(); b_rational_number = farg->rationalNumber(); if(fmin) { delete fmin; fmin = NULL; } if(fmax) { delete fmax; fmax = NULL; } if(farg->min()) { fmin = new Number(*farg->min()); } if(farg->max()) { fmax = new Number(*farg->max()); } } Argument::set(arg); } string NumberArgument::print() const { return _("number"); } string NumberArgument::subprintlong() const { string str; if(b_rational_number) { str += _("a rational number"); } else if(b_complex) { str += _("a number"); } else { str += _("a real number"); } if(fmin) { str += " "; if(b_incl_min) { str += _(">="); } else { str += _(">"); } str += " "; str += fmin->print(); } if(fmax) { if(fmin) { str += " "; str += _("and"); } str += " "; if(b_incl_max) { str += _("<="); } else { str += _("<"); } str += " "; str += fmax->print(); } return str; } IntegerArgument::IntegerArgument(string name_, ArgumentMinMaxPreDefinition minmax, bool does_test, bool does_error) : Argument(name_, does_test, does_error) { imin = NULL; imax = NULL; switch(minmax) { case ARGUMENT_MIN_MAX_POSITIVE: { imin = new Number(1, 1); break; } case ARGUMENT_MIN_MAX_NEGATIVE: { imax = new Number(-1, 1); break; } case ARGUMENT_MIN_MAX_NONNEGATIVE: { imin = new Number(); break; } case ARGUMENT_MIN_MAX_NONZERO: { setZeroForbidden(true); break; } default: {} } } IntegerArgument::IntegerArgument(const IntegerArgument *arg) { imin = NULL; imax = NULL; set(arg); } IntegerArgument::~IntegerArgument() { if(imin) { delete imin; } if(imax) { delete imax; } } void IntegerArgument::setMin(const Number *nmin) { if(!nmin) { if(imin) { delete imin; } return; } if(!imin) { imin = new Number(*nmin); } else { imin->set(*nmin); } } const Number *IntegerArgument::min() const { return imin; } void IntegerArgument::setMax(const Number *nmax) { if(!nmax) { if(imax) { delete imax; } return; } if(!imax) { imax = new Number(*nmax); } else { imax->set(*nmax); } } const Number *IntegerArgument::max() const { return imax; } bool IntegerArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isNumber()) { value.eval(eo); } if(!value.isNumber() || !value.number().isInteger()) { return false; } if(imin) { ComparisonResult cmpr = imin->compare(value.number()); if(!(COMPARISON_IS_EQUAL_OR_GREATER(cmpr))) { return false; } } if(imax) { ComparisonResult cmpr = imax->compare(value.number()); if(!(COMPARISON_IS_EQUAL_OR_LESS(cmpr))) { return false; } } return true; } int IntegerArgument::type() const { return ARGUMENT_TYPE_INTEGER; } Argument *IntegerArgument::copy() const { return new IntegerArgument(this); } void IntegerArgument::set(const Argument *arg) { if(arg->type() == ARGUMENT_TYPE_INTEGER) { const IntegerArgument *iarg = (const IntegerArgument*) arg; if(imin) { delete imin; imin = NULL; } if(imax) { delete imax; imax = NULL; } if(iarg->min()) { imin = new Number(*iarg->min()); } if(iarg->max()) { imax = new Number(*iarg->max()); } } Argument::set(arg); } string IntegerArgument::print() const { return _("integer"); } string IntegerArgument::subprintlong() const { string str = _("an integer"); if(imin) { str += " "; str += _(">="); str += " "; str += imin->print(); } if(imax) { if(imin) { str += " "; str += _("and"); } str += " "; str += _("<="); str += " "; str += imax->print(); } return str; } SymbolicArgument::SymbolicArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {} SymbolicArgument::SymbolicArgument(const SymbolicArgument *arg) {set(arg);} SymbolicArgument::~SymbolicArgument() {} bool SymbolicArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic() && (!value.isVariable() || value.variable()->isKnown())) { value.eval(eo); } return value.isSymbolic() || value.isVariable(); } int SymbolicArgument::type() const {return ARGUMENT_TYPE_SYMBOLIC;} Argument *SymbolicArgument::copy() const {return new SymbolicArgument(this);} string SymbolicArgument::print() const {return _("symbol");} string SymbolicArgument::subprintlong() const {return _("an unknown variable/symbol");} TextArgument::TextArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {b_text = true;} TextArgument::TextArgument(const TextArgument *arg) {set(arg); b_text = true;} TextArgument::~TextArgument() {} bool TextArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic(); } int TextArgument::type() const {return ARGUMENT_TYPE_TEXT;} Argument *TextArgument::copy() const {return new TextArgument(this);} string TextArgument::print() const {return _("text");} string TextArgument::subprintlong() const {return _("a text string");} bool TextArgument::suggestsQuotes() const {return false;} DateArgument::DateArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {b_text = true;} DateArgument::DateArgument(const DateArgument *arg) {set(arg); b_text = true;} DateArgument::~DateArgument() {} bool DateArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } int day = 0, year = 0, month = 0; return value.isSymbolic() && s2date(value.symbol(), day, year, month); } int DateArgument::type() const {return ARGUMENT_TYPE_DATE;} Argument *DateArgument::copy() const {return new DateArgument(this);} string DateArgument::print() const {return _("date");} string DateArgument::subprintlong() const {return _("a date");} VectorArgument::VectorArgument(string name_, bool does_test, bool allow_matrix, bool does_error) : Argument(name_, does_test, does_error) { setMatrixAllowed(allow_matrix); b_argloop = true; } VectorArgument::VectorArgument(const VectorArgument *arg) { set(arg); b_argloop = arg->reoccuringArguments(); size_t i = 1; while(true) { if(!arg->getArgument(i)) break; subargs.push_back(arg->getArgument(i)->copy()); i++; } } VectorArgument::~VectorArgument() { for(size_t i = 0; i < subargs.size(); i++) { delete subargs[i]; } } bool VectorArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { //if(!value.isVector()) { value.eval(eo); //} if(!value.isVector()) return false; if(b_argloop && subargs.size() > 0) { for(size_t i = 0; i < value.countChildren(); i++) { if(!subargs[i % subargs.size()]->test(value[i], 1, NULL, eo)) { return false; } } } else { for(size_t i = 0; i < subargs.size() && i < value.countChildren(); i++) { if(!subargs[i]->test(value[i], 1, NULL, eo)) { return false; } } } return true; } int VectorArgument::type() const {return ARGUMENT_TYPE_VECTOR;} Argument *VectorArgument::copy() const {return new VectorArgument(this);} string VectorArgument::print() const {return _("vector");} string VectorArgument::subprintlong() const { if(subargs.size() > 0) { string str = _("a vector with "); for(size_t i = 0; i < subargs.size(); i++) { if(i > 0) { str += ", "; } str += subargs[i]->printlong(); } if(b_argloop) { str += ", ..."; } return str; } else { return _("a vector"); } } bool VectorArgument::reoccuringArguments() const { return b_argloop; } void VectorArgument::setReoccuringArguments(bool reocc) { b_argloop = reocc; } void VectorArgument::addArgument(Argument *arg) { arg->setAlerts(false); subargs.push_back(arg); } void VectorArgument::delArgument(size_t index) { if(index > 0 && index <= subargs.size()) { subargs.erase(subargs.begin() + (index - 1)); } } size_t VectorArgument::countArguments() const { return subargs.size(); } Argument *VectorArgument::getArgument(size_t index) const { if(index > 0 && index <= subargs.size()) { return subargs[index - 1]; } return NULL; } MatrixArgument::MatrixArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) { b_square = false; } MatrixArgument::MatrixArgument(const MatrixArgument *arg) { set(arg); b_square = arg->squareDemanded(); } MatrixArgument::~MatrixArgument() {} bool MatrixArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { //if(!value.isMatrix()) { value.eval(eo); //} return value.isMatrix() && (!b_square || value.matrixIsSquare()); } bool MatrixArgument::squareDemanded() const {return b_square;} void MatrixArgument::setSquareDemanded(bool square) {b_square = square;} int MatrixArgument::type() const {return ARGUMENT_TYPE_MATRIX;} Argument *MatrixArgument::copy() const {return new MatrixArgument(this);} string MatrixArgument::print() const {return _("matrix");} string MatrixArgument::subprintlong() const { if(b_square) { return _("a square matrix"); } else { return _("a matrix"); } } ExpressionItemArgument::ExpressionItemArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {b_text = true;} ExpressionItemArgument::ExpressionItemArgument(const ExpressionItemArgument *arg) {set(arg); b_text = true;} ExpressionItemArgument::~ExpressionItemArgument() {} bool ExpressionItemArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic() && CALCULATOR->getExpressionItem(value.symbol()); } int ExpressionItemArgument::type() const {return ARGUMENT_TYPE_EXPRESSION_ITEM;} Argument *ExpressionItemArgument::copy() const {return new ExpressionItemArgument(this);} string ExpressionItemArgument::print() const {return _("object");} string ExpressionItemArgument::subprintlong() const {return _("a valid function, unit or variable name");} FunctionArgument::FunctionArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {b_text = true;} FunctionArgument::FunctionArgument(const FunctionArgument *arg) {set(arg); b_text = true;} FunctionArgument::~FunctionArgument() {} bool FunctionArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic() && CALCULATOR->getActiveFunction(value.symbol()); } int FunctionArgument::type() const {return ARGUMENT_TYPE_FUNCTION;} Argument *FunctionArgument::copy() const {return new FunctionArgument(this);} string FunctionArgument::print() const {return _("function");} string FunctionArgument::subprintlong() const {return _("a valid function name");} UnitArgument::UnitArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {b_text = true;} UnitArgument::UnitArgument(const UnitArgument *arg) {set(arg); b_text = true;} UnitArgument::~UnitArgument() {} bool UnitArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic() && CALCULATOR->getActiveUnit(value.symbol()); } int UnitArgument::type() const {return ARGUMENT_TYPE_UNIT;} Argument *UnitArgument::copy() const {return new UnitArgument(this);} string UnitArgument::print() const {return _("unit");} string UnitArgument::subprintlong() const {return _("a valid unit name");} VariableArgument::VariableArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {b_text = true;} VariableArgument::VariableArgument(const VariableArgument *arg) {set(arg); b_text = true;} VariableArgument::~VariableArgument() {} bool VariableArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic() && CALCULATOR->getActiveVariable(value.symbol()); } int VariableArgument::type() const {return ARGUMENT_TYPE_VARIABLE;} Argument *VariableArgument::copy() const {return new VariableArgument(this);} string VariableArgument::print() const {return _("variable");} string VariableArgument::subprintlong() const {return _("a valid variable name");} FileArgument::FileArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {b_text = true;} FileArgument::FileArgument(const FileArgument *arg) {set(arg); b_text = true;} FileArgument::~FileArgument() {} bool FileArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic(); } int FileArgument::type() const {return ARGUMENT_TYPE_FILE;} Argument *FileArgument::copy() const {return new FileArgument(this);} string FileArgument::print() const {return _("file");} string FileArgument::subprintlong() const {return _("a valid file name");} BooleanArgument::BooleanArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {} BooleanArgument::BooleanArgument(const BooleanArgument *arg) {set(arg);} BooleanArgument::~BooleanArgument() {} bool BooleanArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isNumber()) { value.eval(eo); } return value.isZero() || value.isOne(); } int BooleanArgument::type() const {return ARGUMENT_TYPE_BOOLEAN;} Argument *BooleanArgument::copy() const {return new BooleanArgument(this);} string BooleanArgument::print() const {return _("boolean");} string BooleanArgument::subprintlong() const {return _("a boolean (0 or 1)");} AngleArgument::AngleArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {} AngleArgument::AngleArgument(const AngleArgument *arg) {set(arg);} AngleArgument::~AngleArgument() {} bool AngleArgument::subtest(MathStructure&, const EvaluationOptions&) const { return true; } int AngleArgument::type() const {return ARGUMENT_TYPE_ANGLE;} Argument *AngleArgument::copy() const {return new AngleArgument(this);} string AngleArgument::print() const {return _("angle");} string AngleArgument::subprintlong() const {return _("an angle or a number (using the default angle unit)");} void AngleArgument::parse(MathStructure *mstruct, const string &str, const ParseOptions &po) const { CALCULATOR->parse(mstruct, str, po); switch(po.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct->multiply(CALCULATOR->getDegUnit()); break; } case ANGLE_UNIT_GRADIANS: { mstruct->multiply(CALCULATOR->getGraUnit()); break; } case ANGLE_UNIT_RADIANS: { mstruct->multiply(CALCULATOR->getRadUnit()); break; } default: {} } } ArgumentSet::ArgumentSet(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) { } ArgumentSet::ArgumentSet(const ArgumentSet *arg) { set(arg); size_t i = 1; while(true) { if(!arg->getArgument(i)) break; subargs.push_back(arg->getArgument(i)->copy()); i++; } } ArgumentSet::~ArgumentSet() { for(size_t i = 0; i < subargs.size(); i++) { delete subargs[i]; } } bool ArgumentSet::subtest(MathStructure &value, const EvaluationOptions &eo) const { for(size_t i = 0; i < subargs.size(); i++) { if(subargs[i]->test(value, 1, NULL, eo)) { return true; } } return false; } int ArgumentSet::type() const {return ARGUMENT_TYPE_SET;} Argument *ArgumentSet::copy() const {return new ArgumentSet(this);} string ArgumentSet::print() const { string str = ""; for(size_t i = 0; i < subargs.size(); i++) { if(i > 0) { if(i == subargs.size() - 1) { str += " "; str += _("or"); str += " "; } else { str += ", "; } } str += subargs[i]->print(); } return str; } string ArgumentSet::subprintlong() const { string str = ""; for(size_t i = 0; i < subargs.size(); i++) { if(i > 0) { if(i == subargs.size() - 1) { str += " "; str += _("or"); str += " "; } else { str += ", "; } } str += subargs[i]->printlong(); } return str; } void ArgumentSet::addArgument(Argument *arg) { arg->setAlerts(false); subargs.push_back(arg); } void ArgumentSet::delArgument(size_t index) { if(index > 0 && index <= subargs.size()) { subargs.erase(subargs.begin() + (index - 1)); } } size_t ArgumentSet::countArguments() const { return subargs.size(); } Argument *ArgumentSet::getArgument(size_t index) const { if(index > 0 && index <= subargs.size()) { return subargs[index - 1]; } return NULL; } libqalculate-0.9.7/libqalculate/Number.h0000644000175100017510000002654611305546373015203 00000000000000/* Qalculate Copyright (C) 2004-2007 Niklas Knutsson (nq@altern.org) 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. */ #ifndef NUMBER_H #define NUMBER_H #include #include /** @file */ #define EQUALS_PRECISION_DEFAULT -1 #define EQUALS_PRECISION_LOWEST -2 #define EQUALS_PRECISION_HIGHEST -3 /// A number. /** * Can be rational, floating point, complex or infinite. * Has arbitrary precision (uses Calculator::precision()) and infinitely large rational numbers. * Implimented using CLN numbers. */ class Number { private: protected: void removeFloatZeroPart(); void testApproximate(); void testInteger(); void setPrecisionAndApproximateFrom(const Number &o); cln::cl_N value; bool b_inf, b_pinf, b_minf; bool b_approx; int i_precision; public: /** * Constructs a number initialized as zero. */ Number(); /** * Constructs a number parsing a text string. * * @param number Text string to read number from. * @param po Options for parsing the text string. */ Number(string number, const ParseOptions &po = default_parse_options); /** * Constructs a rational number. * * @param numerator * @param denominator * @param exp_10 */ Number(int numerator, int denominator = 1, int exp_10 = 0); /** * Constructs a copy of a number. */ Number(const Number &o); virtual ~Number(); void set(string number, const ParseOptions &po = default_parse_options); void set(int numerator, int denominator = 1, int exp_10 = 0); void setInfinity(); void setPlusInfinity(); void setMinusInfinity(); void setFloat(double d_value); void setInternal(const cln::cl_N &cln_value); void setImaginaryPart(const Number &o); void setImaginaryPart(int numerator, int denominator = 1, int exp_10 = 0); void set(const Number &o); void clear(); const cln::cl_N &internalNumber() const; double floatValue() const; /** * Converts a number to an integer. If the number does not represent an integer it will rounded using round(). * * @param[out] overflow If overflow is non-null it will be set to true if the number was to large to fit in an int. * @return Resulting integer. */ int intValue(bool *overflow = NULL) const; /** Returns true if the number is approximate. * * @return true if the number is approximate. */ bool isApproximate() const; /** Returns true if the number has an approximate representation/is of approximate type -- if it is a floating point number. Numbers of approximate type are always approximate, but the reversed relation is not always true. * * @return true if the number has an approximate representation. */ bool isApproximateType() const; /** Defines the number as approximate or exact. If a number of approximate type is set as exact, it will be converted to a rational number. * * @param is_approximate If the number shall be regarded as approximate. */ void setApproximate(bool is_approximate = true); /** Returns the.precision of the number. * * @return Precision of the number or -1 if the number is exact or the precision has not been set. */ int precision() const; void setPrecision(int prec); bool isUndefined() const; /** Returns true if the number is infinity, plus infinity or minus infinity. * * @return true if the number is infinite. */ bool isInfinite() const; /** Returns true if the number is infinity, if the number is plus or minus infinity (which is not known). * * @return true if the number is infinity. */ bool isInfinity() const; /** Returns true if the number is plus infinity. * * @return true if the number is plus infinity. */ bool isPlusInfinity() const; /** Returns true if the number is minus infinity. * * @return true if the number is minus infinity. */ bool isMinusInfinity() const; /** Returns the real part of the number if it is complex, or a copy if it is real. * * @return true if the real part of a complex number. */ Number realPart() const; /** Returns the imaginary part as real number of the number if it is complex, or zero if it is real. * * @return true if the imaginary part of a complex number. */ Number imaginaryPart() const; Number numerator() const; Number denominator() const; Number complexNumerator() const; Number complexDenominator() const; void operator = (const Number &o); void operator -- (int); void operator ++ (int); Number operator - () const; Number operator * (const Number &o) const; Number operator / (const Number &o) const; Number operator + (const Number &o) const; Number operator - (const Number &o) const; Number operator ^ (const Number &o) const; Number operator && (const Number &o) const; Number operator || (const Number &o) const; Number operator ! () const; void operator *= (const Number &o); void operator /= (const Number &o); void operator += (const Number &o); void operator -= (const Number &o); void operator ^= (const Number &o); bool operator == (const Number &o) const; bool operator != (const Number &o) const; bool bitAnd(const Number &o); bool bitOr(const Number &o); bool bitXor(const Number &o); bool bitNot(); bool bitEqv(const Number &o); bool shiftLeft(const Number &o); bool shiftRight(const Number &o); bool shift(const Number &o); bool hasRealPart() const; bool hasImaginaryPart() const; bool isComplex() const; bool isInteger() const; Number integer() const; bool isRational() const; bool isReal() const; bool isFraction() const; bool isZero() const; bool isOne() const; bool isTwo() const; bool isI() const; bool isMinusI() const; bool isMinusOne() const; bool isNegative() const; bool isNonNegative() const; bool isPositive() const; bool isNonPositive() const; bool realPartIsNegative() const; bool realPartIsPositive() const; bool imaginaryPartIsNegative() const; bool imaginaryPartIsPositive() const; bool hasNegativeSign() const; bool hasPositiveSign() const; bool equalsZero() const; bool equals(const Number &o) const; bool equalsApproximately(const Number &o, int prec) const; ComparisonResult compare(const Number &o) const; ComparisonResult compareApproximately(const Number &o, int prec = EQUALS_PRECISION_LOWEST) const; ComparisonResult compareImaginaryParts(const Number &o) const; ComparisonResult compareRealParts(const Number &o) const; bool isGreaterThan(const Number &o) const; bool isLessThan(const Number &o) const; bool isGreaterThanOrEqualTo(const Number &o) const; bool isLessThanOrEqualTo(const Number &o) const; bool isEven() const; bool denominatorIsEven() const; bool denominatorIsTwo() const; bool numeratorIsEven() const; bool numeratorIsOne() const; bool numeratorIsMinusOne() const; bool isOdd() const; int integerLength() const; /** Add to the number (x+o). * * @param o Number to add. * @return true if the operation was successful. */ bool add(const Number &o); /** Subtracts from to the number (x-o). * * @param o Number to subtract. * @return true if the operation was successful. */ bool subtract(const Number &o); /** Multiply the number (x*o). * * @param o Number to multiply with. * @return true if the operation was successful. */ bool multiply(const Number &o); /** Divide the number (x/o). * * @param o Number to divide by. * @return true if the operation was successful. */ bool divide(const Number &o); /** Invert the number (1/x). * * @return true if the operation was successful. */ bool recip(); /** Raise the number (x^o). * * @param o Number to raise to. * @param try_exact If an exact solution should be tried first (might be slow). * @return true if the operation was successful. */ bool raise(const Number &o, bool try_exact = true); /** Multiply the number with a power of ten (x*10^o). * * @param o Number to raise 10 by. * @return true if the operation was successful. */ bool exp10(const Number &o); /** Multiply the number with a power of two (x*2^o). * * @param o Number to raise 2 by. * @return true if the operation was successful. */ bool exp2(const Number &o); /** Set the number to ten raised by the number (10^x). * * @return true if the operation was successful. */ bool exp10(); /** Set the number to two raised by the number (2^x). * * @return true if the operation was successful. */ bool exp2(); /** Raise the number by two (x^2). * * @return true if the operation was successful. */ bool square(); /** Negate the number (-x). * * @return true if the operation was successful. */ bool negate(); void setNegative(bool is_negative); bool abs(); bool signum(); bool round(const Number &o); bool floor(const Number &o); bool ceil(const Number &o); bool trunc(const Number &o); bool mod(const Number &o); bool isqrt(); bool round(); bool floor(); bool ceil(); bool trunc(); bool frac(); bool rem(const Number &o); bool smod(const Number &o); bool irem(const Number &o); bool irem(const Number &o, Number &q); bool iquo(const Number &o); bool iquo(const Number &o, Number &r); int getBoolean() const; void toBoolean(); void setTrue(bool is_true = true); void setFalse(); void setLogicalNot(); /** Set the number to e, the base of natural logarithm, calculated with the current default precision. */ void e(); /** Set the number to pi, Archimede's constant, calculated with the current default precision. */ void pi(); /** Set the number to Catalan's constant, calculated with the current default precision. */ void catalan(); /** Set the number to Euler's constant, calculated with the current default precision. */ void euler(); /** Set the number to Riemann's zeta with the number as integral point. The number must be an integer greater than one. * * @return true if the calculation was successful. */ bool zeta(); bool sin(); bool asin(); bool sinh(); bool asinh(); bool cos(); bool acos(); bool cosh(); bool acosh(); bool tan(); bool atan(); bool tanh(); bool atanh(); bool ln(); bool log(const Number &o); bool exp(); bool lambertW(); bool gcd(const Number &o); bool lcm(const Number &o); bool factorial(); bool multiFactorial(const Number &o); bool doubleFactorial(); bool binomial(const Number &m, const Number &k); bool factorize(vector &factors); bool add(const Number &o, MathOperation op); string printNumerator(int base = 10, bool display_sign = true, BaseDisplay base_display = BASE_DISPLAY_NORMAL, bool lower_case = false) const; string printDenominator(int base = 10, bool display_sign = true, BaseDisplay base_display = BASE_DISPLAY_NORMAL, bool lower_case = false) const; string printImaginaryNumerator(int base = 10, bool display_sign = true, BaseDisplay base_display = BASE_DISPLAY_NORMAL, bool lower_case = false) const; string printImaginaryDenominator(int base = 10, bool display_sign = true, BaseDisplay base_display = BASE_DISPLAY_NORMAL, bool lower_case = false) const; string print(const PrintOptions &po = default_print_options, const InternalPrintStruct &ips = top_ips) const; }; #endif libqalculate-0.9.7/libqalculate/Variable.h0000644000175100017510000003070411305546373015467 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #ifndef VARIABLE_H #define VARIABLE_H #include #include /** @file */ #define DECLARE_BUILTIN_VARIABLE(x) class x : public DynamicVariable { \ private: \ void calculate() const; \ public: \ x(); \ x(const x *variable) {set(variable);} \ ExpressionItem *copy() const {return new x(this);} \ }; /// Type assumption. /** * Each type is a subset of the type above. */ typedef enum { ASSUMPTION_TYPE_NONE = 0, /// Multiplication is NOT commutative ASSUMPTION_TYPE_NONMATRIX = 1, ASSUMPTION_TYPE_NUMBER = 2, /// im(x) != 0 ASSUMPTION_TYPE_COMPLEX = 3, ASSUMPTION_TYPE_REAL = 4, ASSUMPTION_TYPE_RATIONAL = 5, ASSUMPTION_TYPE_INTEGER = 6 } AssumptionType; /// Signedness assumption. typedef enum { /// x = ? ASSUMPTION_SIGN_UNKNOWN, /// x > 0 ASSUMPTION_SIGN_POSITIVE, /// x >= 0 ASSUMPTION_SIGN_NONNEGATIVE, /// x < 0 ASSUMPTION_SIGN_NEGATIVE, /// x <= 0 ASSUMPTION_SIGN_NONPOSITIVE, /// x != 0 ASSUMPTION_SIGN_NONZERO } AssumptionSign; /// Type of variable typedef enum { /// class Variable SUBTYPE_VARIABLE, /// class UnknownVariable SUBTYPE_UNKNOWN_VARIABLE, /// class KnownVariable SUBTYPE_KNOWN_VARIABLE } VariableSubtype; /// An assumption about an unknown mathematical value. /** Assumptions have a type and a sign. The type describes the type of the value -- if it represents a number or something else, and what type of number is represented. * The sign restricts the signedness of a number. The sign generally only applies the assumptions representing a number. * The assumption class also includes max and min values, which however are not used anywhere yet. */ class Assumptions { protected: AssumptionType i_type; AssumptionSign i_sign; Number *fmin, *fmax; bool b_incl_min, b_incl_max; public: Assumptions(); ~Assumptions(); bool isPositive(); bool isNegative(); bool isNonNegative(); bool isNonPositive(); bool isInteger(); bool isNumber(); bool isRational(); bool isReal(); bool isComplex(); bool isNonZero(); bool isNonMatrix(); AssumptionType type(); AssumptionSign sign(); void setType(AssumptionType ant); void setSign(AssumptionSign as); void setMin(const Number *nmin); void setIncludeEqualsMin(bool include_equals); bool includeEqualsMin() const; const Number *min() const; void setMax(const Number *nmax); void setIncludeEqualsMax(bool include_equals); bool includeEqualsMax() const; const Number *max() const; }; /// Abstract base class for variables. /** A variable is an alpha-numerical representation of a known or unknown value. */ class Variable : public ExpressionItem { public: Variable(string cat_, string name_, string title_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); Variable(); Variable(const Variable *variable); virtual ~Variable(); virtual ExpressionItem *copy() const = 0; virtual void set(const ExpressionItem *item); virtual int type() const {return TYPE_VARIABLE;} /** Returns the subtype of the variable, corresponding to which subsubclass the object belongs to. * * @returns ::VariableSubtype. */ virtual int subtype() const {return SUBTYPE_VARIABLE;} /** Returns if the variable has a known value (as oppossed to assumptions). * * @returns true if the variable is of class KnownVariable, false if UnknownVariable. */ virtual bool isKnown() const = 0; /** Returns if the variable represents a positive value. */ virtual bool representsPositive(bool = false) {return false;} virtual bool representsNegative(bool = false) {return false;} virtual bool representsNonNegative(bool = false) {return false;} virtual bool representsNonPositive(bool = false) {return false;} virtual bool representsInteger(bool = false) {return false;} virtual bool representsNumber(bool = false) {return false;} virtual bool representsRational(bool = false) {return false;} virtual bool representsReal(bool = false) {return false;} virtual bool representsComplex(bool = false) {return false;} virtual bool representsNonZero(bool = false) {return false;} virtual bool representsEven(bool = false) {return false;} virtual bool representsOdd(bool = false) {return false;} virtual bool representsUndefined(bool = false, bool = false, bool = false) {return false;} virtual bool representsBoolean() {return false;} virtual bool representsNonMatrix() {return false;} }; /// A variable with unknown value. /** Unknown variables have an associated assumption object. */ class UnknownVariable : public Variable { protected: Assumptions *o_assumption; public: /** Create an unknown. * * @param cat_ Category that the variable belongs to. * @param name_ Initial name of the variable. * @param title_ Descriptive name. * @param is_local If the variable is local/user-defined or global. * @param is_builtin If the variable is builtin and not modifiable. * @param is_active If the variable is active and can be used in expressions. */ UnknownVariable(string cat_, string name_, string title_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); /** Create an empty unknown variable. */ UnknownVariable(); /** Create a copy of an unknown variable. * * @param variable Unknown variable to copy. */ UnknownVariable(const UnknownVariable *variable); virtual ~UnknownVariable(); virtual ExpressionItem *copy() const; virtual void set(const ExpressionItem *item); bool isKnown() const {return false;} /** Sets the assumptions of the unknown variable. * * @param ass Assumptions. */ void setAssumptions(Assumptions *ass); /** Returns the assumptions of the unknown variable. * * @returns Assumptions of the unknown variable. */ Assumptions *assumptions(); int subtype() const {return SUBTYPE_UNKNOWN_VARIABLE;} virtual bool representsPositive(bool = false); virtual bool representsNegative(bool = false); virtual bool representsNonNegative(bool = false); virtual bool representsNonPositive(bool = false); virtual bool representsInteger(bool = false); virtual bool representsNumber(bool = false); virtual bool representsRational(bool = false); virtual bool representsReal(bool = false); virtual bool representsComplex(bool = false); virtual bool representsNonZero(bool = false); virtual bool representsNonMatrix(); }; /// A variable with a known value. /** Known variables have an associated value. The value can be a simple number or a full mathematical expression. The known variable class is used both for variable values and constants. * * The value can be provided as an expression in the form of a text string or as a mathematical value in the form of an object of the MathStructure class. * The text string is parsed when needed, which saves time when loading many variable definitions which might not be used, at least not immediately. */ class KnownVariable : public Variable { protected: MathStructure *mstruct; bool b_expression; int calculated_precision; string sexpression; public: /** Create a known variable with a value. * * @param cat_ Category that the variable belongs to. * @param name_ Initial name of the variable. * @param o Value. * @param title_ Descriptive name. * @param is_local If the variable is local/user-defined or global. * @param is_builtin If the variable is builtin and not modifiable. * @param is_active If the variable is active and can be used in expressions. */ KnownVariable(string cat_, string name_, const MathStructure &o, string title_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); /** Create a known variable with an text string expression. * * @param cat_ Category that the variable belongs to. * @param name_ Initial name of the variable. * @param expression_ Expression. * @param title_ Descriptive name. * @param is_local If the variable is local/user-defined or global. * @param is_builtin If the variable is builtin and not modifiable. * @param is_active If the variable is active and can be used in expressions. */ KnownVariable(string cat_, string name_, string expression_, string title_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); /** Create an empty known variable. Primarily for internal use. */ KnownVariable(); /** Create a copy of a known variable. * * @param variable Known variable to copy. */ KnownVariable(const KnownVariable *variable); virtual ~KnownVariable(); virtual ExpressionItem *copy() const; virtual void set(const ExpressionItem *item); bool isKnown() const {return true;} /** Returns if the variable has an text string expression instead of a value. * * @returns True if the variable has an expression instead of a value. */ virtual bool isExpression() const; /** Returns the variable's string expression or an empty string if it has not got an expression. * * @returns The variable's expression. */ virtual string expression() const; int subtype() const {return SUBTYPE_KNOWN_VARIABLE;} /** Sets the value of the variable. If expression is set, it is cleared. * * @param o Value. */ virtual void set(const MathStructure &o); /** Sets the text string expression of the variable. The value is cleared. * * @param expression_ Expression. */ virtual void set(string expression_); /** Returns the value of the variable. If no value is set or parsed and an expression is set, the expression is parsed and resulting value returned. * * @returns The value of the variable.. */ virtual const MathStructure &get(); virtual bool representsPositive(bool = false); virtual bool representsNegative(bool = false); virtual bool representsNonNegative(bool = false); virtual bool representsNonPositive(bool = false); virtual bool representsInteger(bool = false); virtual bool representsNumber(bool = false); virtual bool representsRational(bool = false); virtual bool representsReal(bool = false); virtual bool representsComplex(bool = false); virtual bool representsNonZero(bool = false); virtual bool representsEven(bool = false); virtual bool representsOdd(bool = false); virtual bool representsUndefined(bool = false, bool = false, bool = false); virtual bool representsBoolean(); virtual bool representsNonMatrix(); }; /// Abstract base class for variables with a value which is recalculated when the precision has changed. /** */ class DynamicVariable : public KnownVariable { protected: virtual void calculate() const = 0; public: DynamicVariable(string cat_, string name_, string title_ = "", bool is_local = false, bool is_builtin = true, bool is_active = true); DynamicVariable(const DynamicVariable *variable); DynamicVariable(); virtual ~DynamicVariable(); ExpressionItem *copy() const = 0; void set(const ExpressionItem *item); const MathStructure &get(); void set(const MathStructure &o); void set(string expression_); /** Returns the precision of the calculated value. * * @returns Precision of the calculated value or zero if the value has not yet been calculated. */ int calculatedPrecision() const; virtual bool representsPositive(bool = false) {return true;} virtual bool representsNegative(bool = false) {return false;} virtual bool representsNonNegative(bool = false) {return true;} virtual bool representsNonPositive(bool = false) {return false;} virtual bool representsInteger(bool = false) {return false;} virtual bool representsNumber(bool = false) {return true;} virtual bool representsRational(bool = false) {return false;} virtual bool representsReal(bool = false) {return true;} virtual bool representsComplex(bool = false) {return false;} virtual bool representsNonZero(bool = false) {return true;} virtual bool representsEven(bool = false) {return false;} virtual bool representsOdd(bool = false) {return false;} virtual bool representsUndefined(bool = false, bool = false, bool = false) {return false;} virtual bool representsBoolean() {return false;} virtual bool representsNonMatrix() {return true;} }; /// Dynamic variable for Pi DECLARE_BUILTIN_VARIABLE(PiVariable) /// Dynamic variable for e, the base of natural logarithms DECLARE_BUILTIN_VARIABLE(EVariable) /// Dynamic variable for Euler's constant DECLARE_BUILTIN_VARIABLE(EulerVariable) /// Dynamic variable for Catalan's constant DECLARE_BUILTIN_VARIABLE(CatalanVariable) #endif libqalculate-0.9.7/libqalculate/BuiltinFunctions.cc0000644000175100017510000041653411320653617017405 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #include "support.h" #include "BuiltinFunctions.h" #include "util.h" #include "MathStructure.h" #include "Number.h" #include "Calculator.h" #include "Variable.h" #include #include #include #define FR_FUNCTION(FUNC) Number nr(vargs[0].number()); if(!nr.FUNC() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate()) || (!eo.allow_complex && nr.isComplex() && !vargs[0].number().isComplex()) || (!eo.allow_infinite && nr.isInfinite() && !vargs[0].number().isInfinite())) {return 0;} else {mstruct.set(nr); return 1;} #define FR_FUNCTION_2(FUNC) Number nr(vargs[0].number()); if(!nr.FUNC(vargs[1].number()) || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate()) || (!eo.allow_complex && nr.isComplex() && !vargs[0].number().isComplex() && !vargs[1].number().isComplex()) || (!eo.allow_infinite && nr.isInfinite() && !vargs[0].number().isInfinite() && !vargs[1].number().isInfinite())) {return 0;} else {mstruct.set(nr); return 1;} #define REPRESENTS_FUNCTION(x, y) x::x() : MathFunction(#y, 1) {} int x::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) {mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.y()) {mstruct.clear(); mstruct.number().setTrue();} else {mstruct.clear(); mstruct.number().setFalse();} return 1;} #define IS_NUMBER_FUNCTION(x, y) x::x() : MathFunction(#y, 1) {} int x::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) {mstruct = vargs[0]; if(!mstruct.isNumber()) mstruct.eval(eo); if(mstruct.isNumber() && mstruct.number().y()) {mstruct.number().setTrue();} else {mstruct.clear(); mstruct.number().setFalse();} return 1;} #define NON_COMPLEX_NUMBER_ARGUMENT(i) NumberArgument *arg_non_complex##i = new NumberArgument(); arg_non_complex##i->setComplexAllowed(false); setArgumentDefinition(i, arg_non_complex##i); #define NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(i) NumberArgument *arg_non_complex##i = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false); arg_non_complex##i->setComplexAllowed(false); setArgumentDefinition(i, arg_non_complex##i); #define NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR_NONZERO(i) NumberArgument *arg_non_complex##i = new NumberArgument("", ARGUMENT_MIN_MAX_NONZERO, true, false); arg_non_complex##i->setComplexAllowed(false); setArgumentDefinition(i, arg_non_complex##i); #define RATIONAL_NUMBER_ARGUMENT_NO_ERROR(i) NumberArgument *arg_rational##i = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false); arg_rational##i->setRationalNumber(true); setArgumentDefinition(i, arg_rational##i); #define RATIONAL_POLYNOMIAL_ARGUMENT(i) Argument *arg_poly##i = new Argument(); arg_poly##i->setRationalPolynomial(true); setArgumentDefinition(i, arg_poly##i); VectorFunction::VectorFunction() : MathFunction("vector", -1) { } int VectorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs; mstruct.setType(STRUCT_VECTOR); return 1; } MatrixFunction::MatrixFunction() : MathFunction("matrix", 3) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); setArgumentDefinition(3, new VectorArgument()); } int MatrixFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { size_t rows = (size_t) vargs[0].number().intValue(); size_t columns = (size_t) vargs[1].number().intValue(); mstruct.clearMatrix(); mstruct.resizeMatrix(rows, columns, m_zero); size_t r = 1, c = 1; for(size_t i = 0; i < vargs[2].size(); i++) { if(r > rows || c > columns) { CALCULATOR->error(false, _("Too many elements (%s) for the dimensions (%sx%s) of the matrix."), i2s(vargs[2].size()).c_str(), i2s(rows).c_str(), i2s(columns).c_str(), NULL); break; } mstruct[r - 1][c - 1] = vargs[2][i]; if(c == columns) { c = 1; r++; } else { c++; } } return 1; } RankFunction::RankFunction() : MathFunction("rank", 1, 2) { setArgumentDefinition(1, new VectorArgument("")); setArgumentDefinition(2, new BooleanArgument("")); setDefaultValue(2, "1"); } int RankFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; return mstruct.rankVector(vargs[1].number().getBoolean()); } SortFunction::SortFunction() : MathFunction("sort", 1, 2) { setArgumentDefinition(1, new VectorArgument("")); setArgumentDefinition(2, new BooleanArgument("")); setDefaultValue(2, "1"); } int SortFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; return mstruct.sortVector(vargs[1].number().getBoolean()); } MergeVectorsFunction::MergeVectorsFunction() : MathFunction("mergevectors", 1, -1) { setArgumentDefinition(1, new VectorArgument("")); setArgumentDefinition(2, new VectorArgument("")); } int MergeVectorsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct.clearVector(); for(size_t i = 0; i < vargs.size(); i++) { if(vargs[i].isVector()) { for(size_t i2 = 0; i2 < vargs[i].size(); i2++) { mstruct.addChild(vargs[i][i2]); } } else { mstruct.addChild(vargs[i]); } } return 1; } MatrixToVectorFunction::MatrixToVectorFunction() : MathFunction("matrix2vector", 1) { setArgumentDefinition(1, new MatrixArgument()); } int MatrixToVectorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { vargs[0].matrixToVector(mstruct); return 1; } RowFunction::RowFunction() : MathFunction("row", 2) { setArgumentDefinition(1, new MatrixArgument()); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); } int RowFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { size_t row = (size_t) vargs[1].number().intValue(); if(row > vargs[0].rows()) { CALCULATOR->error(true, _("Row %s does not exist in matrix."), vargs[1].print().c_str(), NULL); return 0; } vargs[0].rowToVector(row, mstruct); return 1; } ColumnFunction::ColumnFunction() : MathFunction("column", 2) { setArgumentDefinition(1, new MatrixArgument()); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); } int ColumnFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { size_t col = (size_t) vargs[1].number().intValue(); if(col > vargs[0].columns()) { CALCULATOR->error(true, _("Column %s does not exist in matrix."), vargs[1].print().c_str(), NULL); return 0; } vargs[0].columnToVector(col, mstruct); return 1; } RowsFunction::RowsFunction() : MathFunction("rows", 1) { setArgumentDefinition(1, new MatrixArgument("")); } int RowsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = (int) vargs[0].rows(); return 1; } ColumnsFunction::ColumnsFunction() : MathFunction("columns", 1) { setArgumentDefinition(1, new MatrixArgument("")); } int ColumnsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = (int) vargs[0].columns(); return 1; } ElementsFunction::ElementsFunction() : MathFunction("elements", 1) { setArgumentDefinition(1, new VectorArgument("")); } int ElementsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(vargs[0].isMatrix()) { mstruct = (int) (vargs[0].rows() * vargs[0].columns()); } else { mstruct = (int) vargs[0].countChildren(); } return 1; } ElementFunction::ElementFunction() : MathFunction("element", 2, 3) { setArgumentDefinition(1, new VectorArgument("")); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); setArgumentDefinition(3, new IntegerArgument("")); setDefaultValue(3, "0"); } int ElementFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(vargs[2].number().isPositive() && vargs[0].isMatrix()) { size_t row = (size_t) vargs[1].number().intValue(); size_t col = (size_t) vargs[2].number().intValue(); bool b = true; if(col > vargs[0].columns()) { CALCULATOR->error(true, _("Column %s does not exist in matrix."), vargs[2].print().c_str(), NULL); b = false; } if(row > vargs[0].rows()) { CALCULATOR->error(true, _("Row %s does not exist in matrix."), vargs[1].print().c_str(), NULL); b = false; } if(b) { const MathStructure *em = vargs[0].getElement(row, col); if(em) mstruct = *em; else b = false; } return b; } else { if(vargs[2].number().isGreaterThan(1)) { CALCULATOR->error(false, _("Argument 3, %s, is ignored for vectors."), getArgumentDefinition(3)->name().c_str(), NULL); } size_t row = (size_t) vargs[1].number().intValue(); if(row > vargs[0].countChildren()) { CALCULATOR->error(true, _("Element %s does not exist in vector."), vargs[1].print().c_str(), NULL); return 0; } mstruct = *vargs[0].getChild(row); return 1; } } DimensionFunction::DimensionFunction() : MathFunction("dimension", 1) { setArgumentDefinition(1, new VectorArgument("")); } int DimensionFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = (int) vargs[0].countChildren(); return 1; } ComponentFunction::ComponentFunction() : MathFunction("component", 2) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); setArgumentDefinition(2, new VectorArgument("")); } int ComponentFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { size_t i = (size_t) vargs[0].number().intValue(); if(i > vargs[1].countChildren()) { CALCULATOR->error(true, _("Element %s does not exist in vector."), vargs[0].print().c_str(), NULL); return 0; } mstruct = *vargs[1].getChild(i); return 1; } LimitsFunction::LimitsFunction() : MathFunction("limits", 3) { setArgumentDefinition(1, new VectorArgument("")); setArgumentDefinition(2, new IntegerArgument("")); setArgumentDefinition(3, new IntegerArgument("")); } int LimitsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { vargs[0].getRange(vargs[1].number().intValue(), vargs[2].number().intValue(), mstruct); return 1; } AreaFunction::AreaFunction() : MathFunction("area", 5) { setArgumentDefinition(1, new MatrixArgument("")); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); setArgumentDefinition(3, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); setArgumentDefinition(4, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); setArgumentDefinition(5, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); } int AreaFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { vargs[0].getArea(vargs[1].number().intValue(), vargs[2].number().intValue(), vargs[3].number().intValue(), vargs[4].number().intValue(), mstruct); return 1; } TransposeFunction::TransposeFunction() : MathFunction("transpose", 1) { setArgumentDefinition(1, new MatrixArgument()); } int TransposeFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; return mstruct.transposeMatrix(); } IdentityFunction::IdentityFunction() : MathFunction("identity", 1) { ArgumentSet *arg = new ArgumentSet(); arg->addArgument(new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); MatrixArgument *marg = new MatrixArgument(); marg->setSquareDemanded(true); arg->addArgument(marg); setArgumentDefinition(1, arg); } int IdentityFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(vargs[0].isMatrix()) { if(vargs[0].rows() != vargs[0].columns()) { return 0; } mstruct.setToIdentityMatrix(vargs[0].size()); } else { mstruct.setToIdentityMatrix((size_t) vargs[0].number().intValue()); } return 1; } DeterminantFunction::DeterminantFunction() : MathFunction("det", 1) { MatrixArgument *marg = new MatrixArgument(); marg->setSquareDemanded(true); setArgumentDefinition(1, marg); } int DeterminantFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { vargs[0].determinant(mstruct, eo); return !mstruct.isUndefined(); } PermanentFunction::PermanentFunction() : MathFunction("permanent", 1) { MatrixArgument *marg = new MatrixArgument(); marg->setSquareDemanded(true); setArgumentDefinition(1, marg); } int PermanentFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { vargs[0].permanent(mstruct, eo); return !mstruct.isUndefined(); } CofactorFunction::CofactorFunction() : MathFunction("cofactor", 3) { setArgumentDefinition(1, new MatrixArgument()); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); setArgumentDefinition(3, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); } int CofactorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { vargs[0].cofactor((size_t) vargs[1].number().intValue(), (size_t) vargs[2].number().intValue(), mstruct, eo); return !mstruct.isUndefined(); } AdjointFunction::AdjointFunction() : MathFunction("adj", 1) { MatrixArgument *marg = new MatrixArgument(); marg->setSquareDemanded(true); setArgumentDefinition(1, marg); } int AdjointFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.adjointMatrix(eo); return !mstruct.isUndefined(); } InverseFunction::InverseFunction() : MathFunction("inverse", 1) { MatrixArgument *marg = new MatrixArgument(); marg->setSquareDemanded(true); setArgumentDefinition(1, marg); } int InverseFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; return mstruct.invertMatrix(eo); } ZetaFunction::ZetaFunction() : MathFunction("zeta", 1, 1, SIGN_ZETA) { IntegerArgument *arg = new IntegerArgument(); arg->setMin(new Number(1 ,1)); Number *nr = new Number(); nr->setInternal(long(INT_MAX)); arg->setMax(nr); setArgumentDefinition(1, arg); } int ZetaFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].number() == 2) { mstruct.set(CALCULATOR->v_pi); mstruct.raise(2); mstruct.divide(6); mstruct.mergePrecision(vargs[0]); return 1; } else if(vargs[0].number() == 4) { mstruct.set(CALCULATOR->v_pi); mstruct.raise(4); mstruct.divide(90); mstruct.mergePrecision(vargs[0]); return 1; } else if(vargs[0].number() == 6) { mstruct.set(CALCULATOR->v_pi); mstruct.raise(6); mstruct.divide(945); mstruct.mergePrecision(vargs[0]); return 1; } else if(vargs[0].number() == 8) { mstruct.set(CALCULATOR->v_pi); mstruct.raise(8); mstruct.divide(9450); mstruct.mergePrecision(vargs[0]); return 1; } else if(vargs[0].number() == 10) { mstruct.set(CALCULATOR->v_pi); mstruct.raise(10); mstruct.divide(9355); mstruct.mergePrecision(vargs[0]); return 1; } FR_FUNCTION(zeta) } GammaFunction::GammaFunction() : MathFunction("gamma", 1, 1, SIGN_CAPITAL_GAMMA) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false)); } int GammaFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(vargs[0].number().isRational()) { if(vargs[0].number().isInteger()) { mstruct.set(CALCULATOR->f_factorial, &vargs[0], NULL); mstruct[0] -= 1; return 1; } else if(vargs[0].number().denominatorIsTwo()) { Number nr(vargs[0].number()); nr.floor(); if(nr.isZero()) { MathStructure mtmp(CALCULATOR->v_pi); mstruct.set(CALCULATOR->f_sqrt, &mtmp, NULL); return 1; } else if(nr.isPositive()) { Number nr2(nr); nr2 *= 2; nr2 -= 1; nr2.doubleFactorial(); Number nr3(2, 1); nr3 ^= nr; nr2 /= nr3; mstruct = nr2; MathStructure mtmp1(CALCULATOR->v_pi); MathStructure mtmp2(CALCULATOR->f_sqrt, &mtmp1, NULL); mstruct *= mtmp2; return 1; } else { nr.negate(); Number nr2(nr); nr2 *= 2; nr2 -= 1; nr2.doubleFactorial(); Number nr3(2, 1); nr3 ^= nr; if(nr.isOdd()) nr3.negate(); nr3 /= nr2; mstruct = nr3; MathStructure mtmp1(CALCULATOR->v_pi); MathStructure mtmp2(CALCULATOR->f_sqrt, &mtmp1, NULL); mstruct *= mtmp2; return 1; } } } CALCULATOR->error(false, _("%s() does at the moment only support integers and fractions of two."), preferredDisplayName().name.c_str(), NULL); return 0; } BetaFunction::BetaFunction() : MathFunction("beta", 2, 2, SIGN_CAPITAL_BETA) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, false)); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, false)); } int BetaFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; mstruct.set(CALCULATOR->f_gamma, &vargs[0], NULL); MathStructure mstruct2(CALCULATOR->f_gamma, &vargs[1], NULL); mstruct *= mstruct2; mstruct2[0] += vargs[0]; mstruct /= mstruct2; return 1; } FactorialFunction::FactorialFunction() : MathFunction("factorial", 1) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, false)); } int FactorialFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(factorial) } bool FactorialFunction::representsPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsNegative(const MathStructure&, bool) const {return false;} bool FactorialFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsNonPositive(const MathStructure&, bool) const {return false;} bool FactorialFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsComplex(const MathStructure&, bool) const {return false;} bool FactorialFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsEven(const MathStructure&, bool) const {return false;} bool FactorialFunction::representsOdd(const MathStructure&, bool) const {return false;} bool FactorialFunction::representsUndefined(const MathStructure&) const {return false;} DoubleFactorialFunction::DoubleFactorialFunction() : MathFunction("factorial2", 1) { IntegerArgument *arg = new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true); Number nr(-1, 1); arg->setMin(&nr); setArgumentDefinition(1, arg); } int DoubleFactorialFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(doubleFactorial) } bool DoubleFactorialFunction::representsPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsNegative(const MathStructure&, bool) const {return false;} bool DoubleFactorialFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsNonPositive(const MathStructure&, bool) const {return false;} bool DoubleFactorialFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsComplex(const MathStructure&, bool) const {return false;} bool DoubleFactorialFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsEven(const MathStructure&, bool) const {return false;} bool DoubleFactorialFunction::representsOdd(const MathStructure&, bool) const {return false;} bool DoubleFactorialFunction::representsUndefined(const MathStructure&) const {return false;} MultiFactorialFunction::MultiFactorialFunction() : MathFunction("multifactorial", 2) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_NONNEGATIVE, true, true)); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true)); } int MultiFactorialFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION_2(multiFactorial) } bool MultiFactorialFunction::representsPositive(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsNegative(const MathStructure&, bool) const {return false;} bool MultiFactorialFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsNonPositive(const MathStructure&, bool) const {return false;} bool MultiFactorialFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsComplex(const MathStructure&, bool) const {return false;} bool MultiFactorialFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsEven(const MathStructure&, bool) const {return false;} bool MultiFactorialFunction::representsOdd(const MathStructure&, bool) const {return false;} bool MultiFactorialFunction::representsUndefined(const MathStructure&) const {return false;} BinomialFunction::BinomialFunction() : MathFunction("binomial", 2) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true)); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_NONNEGATIVE, true, true)); setCondition("\\x>=\\y"); } int BinomialFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { Number nr; if(!nr.binomial(vargs[0].number(), vargs[1].number())) return 0; mstruct = nr; return 1; } BitXorFunction::BitXorFunction() : MathFunction("bitxor", 2) { ArgumentSet *arg = new ArgumentSet(); arg->addArgument(new IntegerArgument("", ARGUMENT_MIN_MAX_NONE)); arg->addArgument(new VectorArgument); setArgumentDefinition(1, arg); arg = new ArgumentSet(); arg->addArgument(new IntegerArgument("", ARGUMENT_MIN_MAX_NONE)); arg->addArgument(new VectorArgument); setArgumentDefinition(2, arg); } int BitXorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.add(vargs[1], OPERATION_BITWISE_XOR); if(vargs[0].isNumber() && vargs[1].isNumber()) { Number nr(vargs[0].number()); if(nr.bitXor(vargs[1].number()) && (eo.approximation == APPROXIMATION_APPROXIMATE || !nr.isApproximate() || vargs[0].number().isApproximate() || vargs[1].number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || vargs[0].number().isComplex() || vargs[1].number().isComplex()) && (eo.allow_infinite || !nr.isInfinite() || vargs[0].number().isInfinite() || vargs[1].number().isInfinite())) { mstruct.set(nr, true); return 1; } return 0; } else if(vargs[0].isVector() && vargs[1].isVector()) { int i1 = 0, i2 = 1; if(vargs[0].size() < vargs[1].size()) { i1 = 1; i2 = 0; } mstruct.clearVector(); mstruct.resizeVector(vargs[i1].size(), m_undefined); size_t i = 0; for(; i < vargs[i2].size(); i++) { mstruct[i].set(CALCULATOR->f_xor, &vargs[i1][i], &vargs[i2][0], NULL); } for(; i < vargs[i1].size(); i++) { mstruct[i] = vargs[i1][i]; mstruct[i].add(m_zero, OPERATION_GREATER); } return 1; } return 0; } XorFunction::XorFunction() : MathFunction("xor", 2) { } int XorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { int b0, b1; if(vargs[0].representsNonPositive(true)) { b0 = 0; } else if(vargs[0].representsPositive(true)) { b0 = 1; } else { b0 = -1; } if(vargs[1].representsNonPositive(true)) { b1 = 0; } else if(vargs[1].representsPositive(true)) { b1 = 1; } else { b1 = -1; } if((b0 == 1 && b1 == 0) || (b0 == 0 && b1 == 1)) { mstruct = m_one; return 1; } else if(b0 >= 0 && b1 >= 0) { return 1; } else if(b0 == 0) { mstruct = vargs[1]; mstruct.add(m_zero, OPERATION_GREATER); return 1; } else if(b0 == 1) { mstruct = vargs[1]; mstruct.add(m_zero, OPERATION_EQUALS_LESS); return 1; } else if(b1 == 0) { mstruct = vargs[0]; mstruct.add(m_zero, OPERATION_GREATER); return 1; } else if(b1 == 1) { mstruct = vargs[0]; mstruct.add(m_zero, OPERATION_EQUALS_LESS); return 1; } mstruct = vargs[1]; mstruct.setLogicalNot(); mstruct.add(vargs[0], OPERATION_LOGICAL_AND); MathStructure mstruct2(vargs[0]); mstruct2.setLogicalNot(); mstruct2.add(vargs[1], OPERATION_LOGICAL_AND); mstruct.add(mstruct2, OPERATION_LOGICAL_OR); return 1; } OddFunction::OddFunction() : MathFunction("odd", 1) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } int OddFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].representsOdd()) { mstruct.set(1, 1); return 1; } else if(vargs[0].representsEven()) { mstruct.clear(); return 1; } mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.representsOdd()) { mstruct.set(1, 1); return 1; } else if(mstruct.representsEven()) { mstruct.clear(); return 1; } return -1; } EvenFunction::EvenFunction() : MathFunction("even", 1) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } int EvenFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].representsEven()) { mstruct.set(1, 1); return 1; } else if(vargs[0].representsOdd()) { mstruct.clear(); return 1; } mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.representsEven()) { mstruct.set(1, 1); return 1; } else if(mstruct.representsOdd()) { mstruct.clear(); return 1; } return -1; } ShiftFunction::ShiftFunction() : MathFunction("shift", 2) { setArgumentDefinition(1, new IntegerArgument()); setArgumentDefinition(2, new IntegerArgument()); } int ShiftFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION_2(shift) } AbsFunction::AbsFunction() : MathFunction("abs", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } bool AbsFunction::representsPositive(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNumber(allow_units) && vargs[0].representsNonZero(allow_units);} bool AbsFunction::representsNegative(const MathStructure&, bool) const {return false;} bool AbsFunction::representsNonNegative(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNumber(allow_units);} bool AbsFunction::representsNonPositive(const MathStructure&, bool) const {return false;} bool AbsFunction::representsInteger(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsInteger(allow_units);} bool AbsFunction::representsNumber(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNumber(allow_units);} bool AbsFunction::representsRational(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsRational(allow_units);} bool AbsFunction::representsReal(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNumber(allow_units);} bool AbsFunction::representsComplex(const MathStructure&, bool) const {return false;} bool AbsFunction::representsNonZero(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNumber(allow_units) && vargs[0].representsNonZero(allow_units);} bool AbsFunction::representsEven(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsEven(allow_units);} bool AbsFunction::representsOdd(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsOdd(allow_units);} bool AbsFunction::representsUndefined(const MathStructure &vargs) const {return vargs.size() == 1 && vargs[0].representsUndefined();} int AbsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isNumber()) { Number nr = mstruct.number(); if(!nr.abs() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate())) { return 0; } else { mstruct = nr; return 1; } } else if(mstruct.representsNegative(true)) { mstruct.negate(); return 1; } else if(mstruct.representsNonNegative(true)) { return 1; } return -1; } GcdFunction::GcdFunction() : MathFunction("gcd", 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) RATIONAL_POLYNOMIAL_ARGUMENT(2) } int GcdFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(MathStructure::gcd(vargs[0], vargs[1], mstruct, eo)) { return 1; } return 0; } LcmFunction::LcmFunction() : MathFunction("lcm", 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) RATIONAL_POLYNOMIAL_ARGUMENT(2) } int LcmFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(MathStructure::lcm(vargs[0], vargs[1], mstruct, eo)) { return 1; } return 0; } SignumFunction::SignumFunction() : MathFunction("sgn", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false)); } int SignumFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(signum) } CeilFunction::CeilFunction() : MathFunction("ceil", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) } int CeilFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(ceil) } bool CeilFunction::representsPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsPositive();} bool CeilFunction::representsNegative(const MathStructure&, bool) const {return false;} bool CeilFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonNegative();} bool CeilFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonPositive();} bool CeilFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool CeilFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool CeilFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool CeilFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool CeilFunction::representsComplex(const MathStructure&, bool) const {return false;} bool CeilFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsPositive();} bool CeilFunction::representsEven(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsEven();} bool CeilFunction::representsOdd(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsOdd();} bool CeilFunction::representsUndefined(const MathStructure&) const {return false;} FloorFunction::FloorFunction() : MathFunction("floor", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) } int FloorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(floor) } bool FloorFunction::representsPositive(const MathStructure&, bool) const {return false;} bool FloorFunction::representsNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNegative();} bool FloorFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonNegative();} bool FloorFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonPositive();} bool FloorFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool FloorFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool FloorFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool FloorFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool FloorFunction::representsComplex(const MathStructure&, bool) const {return false;} bool FloorFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNegative();} bool FloorFunction::representsEven(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsEven();} bool FloorFunction::representsOdd(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsOdd();} bool FloorFunction::representsUndefined(const MathStructure&) const {return false;} TruncFunction::TruncFunction() : MathFunction("trunc", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) } int TruncFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(trunc) } bool TruncFunction::representsPositive(const MathStructure&, bool) const {return false;} bool TruncFunction::representsNegative(const MathStructure&, bool) const {return false;} bool TruncFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonNegative();} bool TruncFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonPositive();} bool TruncFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool TruncFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool TruncFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool TruncFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool TruncFunction::representsComplex(const MathStructure&, bool) const {return false;} bool TruncFunction::representsNonZero(const MathStructure&, bool) const {return false;} bool TruncFunction::representsEven(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsEven();} bool TruncFunction::representsOdd(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsOdd();} bool TruncFunction::representsUndefined(const MathStructure&) const {return false;} RoundFunction::RoundFunction() : MathFunction("round", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) } int RoundFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(round) } bool RoundFunction::representsPositive(const MathStructure&, bool) const {return false;} bool RoundFunction::representsNegative(const MathStructure&, bool) const {return false;} bool RoundFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonNegative();} bool RoundFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonPositive();} bool RoundFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool RoundFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool RoundFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool RoundFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool RoundFunction::representsComplex(const MathStructure&, bool) const {return false;} bool RoundFunction::representsNonZero(const MathStructure&, bool) const {return false;} bool RoundFunction::representsEven(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsEven();} bool RoundFunction::representsOdd(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsOdd();} bool RoundFunction::representsUndefined(const MathStructure&) const {return false;} FracFunction::FracFunction() : MathFunction("frac", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) } int FracFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(frac) } IntFunction::IntFunction() : MathFunction("int", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) } int IntFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(trunc) } NumeratorFunction::NumeratorFunction() : MathFunction("numerator", 1) { NumberArgument *arg_rational_1 = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg_rational_1->setRationalNumber(true); setArgumentDefinition(1, arg_rational_1); } int NumeratorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isNumber()) { if(vargs[0].number().isInteger()) { mstruct = vargs[0]; return 1; } else if(vargs[0].number().isRational()) { mstruct.set(vargs[0].number().numerator()); return 1; } return 0; } else if(vargs[0].representsInteger()) { mstruct = vargs[0]; return 1; } mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.representsInteger()) { return 1; } else if(mstruct.isNumber() && mstruct.number().isRational()) { Number nr(mstruct.number().numerator()); mstruct.set(nr); return 1; } return -1; } DenominatorFunction::DenominatorFunction() : MathFunction("denominator", 1) { RATIONAL_NUMBER_ARGUMENT_NO_ERROR(1) } int DenominatorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct.set(vargs[0].number().denominator()); return 1; } RemFunction::RemFunction() : MathFunction("rem", 2) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR_NONZERO(2) } int RemFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION_2(rem) } ModFunction::ModFunction() : MathFunction("mod", 2) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR_NONZERO(2) } int ModFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION_2(mod) } PolynomialUnitFunction::PolynomialUnitFunction() : MathFunction("punit", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int PolynomialUnitFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct.set(vargs[0].polynomialUnit(vargs[1]), 0); return 1; } PolynomialPrimpartFunction::PolynomialPrimpartFunction() : MathFunction("primpart", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int PolynomialPrimpartFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { vargs[0].polynomialPrimpart(vargs[1], mstruct, eo); return 1; } PolynomialContentFunction::PolynomialContentFunction() : MathFunction("pcontent", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int PolynomialContentFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { vargs[0].polynomialContent(vargs[1], mstruct, eo); return 1; } CoeffFunction::CoeffFunction() : MathFunction("coeff", 2, 3) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_NONNEGATIVE)); setArgumentDefinition(3, new SymbolicArgument()); setDefaultValue(3, "x"); } int CoeffFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { vargs[0].coefficient(vargs[2], vargs[1].number(), mstruct); return 1; } LCoeffFunction::LCoeffFunction() : MathFunction("lcoeff", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int LCoeffFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { vargs[0].lcoefficient(vargs[1], mstruct); return 1; } TCoeffFunction::TCoeffFunction() : MathFunction("tcoeff", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int TCoeffFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { vargs[0].tcoefficient(vargs[1], mstruct); return 1; } DegreeFunction::DegreeFunction() : MathFunction("degree", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int DegreeFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0].degree(vargs[1]); return 1; } LDegreeFunction::LDegreeFunction() : MathFunction("ldegree", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int LDegreeFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0].ldegree(vargs[1]); return 1; } ImFunction::ImFunction() : MathFunction("im", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } int ImFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isNumber()) { mstruct = mstruct.number().imaginaryPart(); return 1; } else if(mstruct.representsReal()) { mstruct.clear(); return 1; } return -1; } bool ImFunction::representsPositive(const MathStructure&, bool) const {return false;} bool ImFunction::representsNegative(const MathStructure&, bool) const {return false;} bool ImFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool ImFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool ImFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool ImFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool ImFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool ImFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool ImFunction::representsComplex(const MathStructure&, bool) const {return false;} bool ImFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsComplex();} bool ImFunction::representsEven(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool ImFunction::representsOdd(const MathStructure&, bool) const {return false;} bool ImFunction::representsUndefined(const MathStructure&) const {return false;} ReFunction::ReFunction() : MathFunction("re", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } int ReFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isNumber()) { mstruct = mstruct.number().realPart(); return 1; } else if(mstruct.representsReal()) { return 1; } return -1; } bool ReFunction::representsPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsPositive();} bool ReFunction::representsNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNegative();} bool ReFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonNegative();} bool ReFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonPositive();} bool ReFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger();} bool ReFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool ReFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsRational();} bool ReFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool ReFunction::representsComplex(const MathStructure&, bool) const {return false;} bool ReFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonZero();} bool ReFunction::representsEven(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsEven();} bool ReFunction::representsOdd(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsOdd();} bool ReFunction::representsUndefined(const MathStructure&) const {return false;} ArgFunction::ArgFunction() : MathFunction("arg", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } int ArgFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(vargs[0].isNumber()) { if(vargs[0].number().isOne()) { mstruct.clear(); return 1; } else if(vargs[0].number().isMinusOne()) { mstruct = CALCULATOR->v_pi; return 1; } else { Number nr(vargs[0].number().imaginaryPart()); if(nr.isOne()) { nr = vargs[0].number().realPart(); if(nr.isOne()) { mstruct = CALCULATOR->v_pi; mstruct /= 4; return 1; } else if(nr.isZero()) { mstruct = CALCULATOR->v_pi; mstruct /= 2; return 1; } } else if(nr.isMinusOne()) { mstruct = CALCULATOR->v_pi; mstruct /= -2; return 1; } } } MathStructure m_re(CALCULATOR->f_re, &vargs[0], NULL); MathStructure m_im(CALCULATOR->f_im, &vargs[0], NULL); m_im /= m_re; mstruct.set(CALCULATOR->f_atan, &m_im, NULL); return 1; } SqrtFunction::SqrtFunction() : MathFunction("sqrt", 1) { } int SqrtFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; mstruct ^= MathStructure(1, 2); return 1; } SquareFunction::SquareFunction() : MathFunction("sq", 1) { } int SquareFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; mstruct ^= 2; return 1; } ExpFunction::ExpFunction() : MathFunction("exp", 1) { } int ExpFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = CALCULATOR->v_e; mstruct ^= vargs[0]; return 1; } LogFunction::LogFunction() : MathFunction("ln", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONZERO, false)); } bool LogFunction::representsPositive(const MathStructure&, bool) const {return false;} bool LogFunction::representsNegative(const MathStructure&, bool) const {return false;} bool LogFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsPositive();} bool LogFunction::representsNonPositive(const MathStructure&, bool) const {return false;} bool LogFunction::representsInteger(const MathStructure&, bool) const {return false;} bool LogFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber() && vargs[0].representsNonZero();} bool LogFunction::representsRational(const MathStructure&, bool) const {return false;} bool LogFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsPositive();} bool LogFunction::representsComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNegative();} bool LogFunction::representsNonZero(const MathStructure&, bool) const {return false;} bool LogFunction::representsEven(const MathStructure&, bool) const {return false;} bool LogFunction::representsOdd(const MathStructure&, bool) const {return false;} bool LogFunction::representsUndefined(const MathStructure&) const {return false;} int LogFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; int errors = 0; if(eo.approximation == APPROXIMATION_TRY_EXACT) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; CALCULATOR->beginTemporaryStopMessages(); mstruct.eval(eo2); CALCULATOR->endTemporaryStopMessages(&errors); } else { mstruct.eval(eo); } bool b = false; if(mstruct.isVariable() && mstruct.variable() == CALCULATOR->v_e) { mstruct.set(m_one); b = true; } else if(mstruct.isPower()) { if(mstruct[0].isVariable() && mstruct[0].variable() == CALCULATOR->v_e) { if(mstruct[1].representsReal()) { mstruct.setToChild(2, true); b = true; } } else if(mstruct[1].representsPositive() || (mstruct[1].representsNegative() && mstruct[0].representsPositive())) { MathStructure mstruct2; mstruct2.set(CALCULATOR->f_ln, &mstruct[0], NULL); mstruct2 *= mstruct[1]; mstruct = mstruct2; b = true; } } else if(mstruct.isMultiplication()) { b = true; for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].representsPositive()) { b = false; break; } } if(b) { MathStructure mstruct2; mstruct2.set(CALCULATOR->f_ln, &mstruct[0], NULL); for(size_t i = 1; i < mstruct.size(); i++) { mstruct2.add(MathStructure(CALCULATOR->f_ln, &mstruct[i], NULL), i > 1); } mstruct = mstruct2; } } if(b) { if(eo.approximation == APPROXIMATION_TRY_EXACT && errors > 0) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; MathStructure mstruct2 = vargs[0]; mstruct2.eval(eo2); } return 1; } if(eo.approximation == APPROXIMATION_TRY_EXACT && !mstruct.isNumber()) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mstruct = vargs[0]; mstruct.eval(eo2); } if(mstruct.isNumber()) { if(eo.allow_complex && mstruct.number().isMinusOne()) { mstruct = CALCULATOR->v_i->get(); mstruct *= CALCULATOR->v_pi; return 1; } else if(mstruct.number().isI() || mstruct.number().isMinusI()) { mstruct = Number(1, 2); mstruct *= CALCULATOR->v_pi; mstruct *= CALCULATOR->v_i->get(); return 1; } else if(eo.allow_complex && eo.allow_infinite && mstruct.number().isMinusInfinity()) { mstruct = CALCULATOR->v_pi; mstruct *= CALCULATOR->v_i->get(); Number nr; nr.setPlusInfinity(); mstruct += nr; return 1; } Number nr(mstruct.number()); if(nr.ln() && !(eo.approximation == APPROXIMATION_EXACT && nr.isApproximate()) && !(!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) && !(!eo.allow_infinite && nr.isInfinite() && !mstruct.number().isInfinite())) { mstruct.set(nr, true); return 1; } } return -1; } LognFunction::LognFunction() : MathFunction("log", 1, 2) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONZERO, false)); setArgumentDefinition(2, new NumberArgument("", ARGUMENT_MIN_MAX_NONZERO, false)); setDefaultValue(2, "e"); } int LognFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[1].isVariable() && vargs[1].variable() == CALCULATOR->v_e) { mstruct.set(CALCULATOR->f_ln, &vargs[0], NULL); return 1; } mstruct = vargs[0]; mstruct.eval(eo); MathStructure mstructv2 = vargs[1]; mstructv2.eval(eo); if(mstruct.isPower()) { if(mstruct[1].representsPositive() || (mstruct[1].representsNegative() && mstruct[0].representsPositive())) { MathStructure mstruct2; mstruct2.set(CALCULATOR->f_logn, &mstruct[0], &mstructv2, NULL); mstruct2 *= mstruct[1]; mstruct = mstruct2; return 1; } } else if(mstruct.isMultiplication()) { bool b = true; for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].representsPositive()) { b = false; break; } } if(b) { MathStructure mstruct2; mstruct2.set(CALCULATOR->f_logn, &mstruct[0], &mstructv2, NULL); for(size_t i = 1; i < mstruct.size(); i++) { mstruct2.add(MathStructure(CALCULATOR->f_logn, &mstruct[i], &mstructv2, NULL), i > 1); } mstruct = mstruct2; return 1; } } else if(mstruct.isNumber() && mstructv2.isNumber()) { Number nr(mstruct.number()); if(nr.log(mstructv2.number()) && !(eo.approximation == APPROXIMATION_EXACT && nr.isApproximate()) && !(!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) && !(!eo.allow_infinite && nr.isInfinite() && !mstruct.number().isInfinite())) { mstruct.set(nr, true); return 1; } } mstruct.set(CALCULATOR->f_ln, &vargs[0], NULL); mstruct.divide_nocopy(new MathStructure(CALCULATOR->f_ln, &vargs[1], NULL)); return 1; } LambertWFunction::LambertWFunction() : MathFunction("lambertw", 1) { NumberArgument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false); arg->setComplexAllowed(false); setArgumentDefinition(1, arg); } int LambertWFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; int errors = 0; if(eo.approximation == APPROXIMATION_TRY_EXACT) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; CALCULATOR->beginTemporaryStopMessages(); mstruct.eval(eo2); CALCULATOR->endTemporaryStopMessages(&errors); } else { mstruct.eval(eo); } bool b = false; if(mstruct.isZero()) { b = true; } else if(mstruct.isVariable() && mstruct.variable() == CALCULATOR->v_e) { mstruct.set(m_one); b = true; } else if(mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0].isMinusOne() && mstruct[1].isPower() && mstruct[1][0].isVariable() && mstruct[1][0].variable() == CALCULATOR->v_e && mstruct[1][1].isMinusOne()) { mstruct = -1; b = true; } if(b) { if(eo.approximation == APPROXIMATION_TRY_EXACT && errors > 0) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; MathStructure mstruct2 = vargs[0]; mstruct2.eval(eo2); } return 1; } if(eo.approximation == APPROXIMATION_TRY_EXACT && !mstruct.isNumber()) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mstruct = vargs[0]; mstruct.eval(eo2); } if(mstruct.isNumber()) { Number nr(mstruct.number()); if(!nr.lambertW()) { CALCULATOR->error(false, _("Argument for %s() must be a real number greater than or equal to -1/e."), preferredDisplayName().name.c_str(), NULL); } else if(!(eo.approximation == APPROXIMATION_EXACT && nr.isApproximate()) && !(!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) && !(!eo.allow_infinite && nr.isInfinite() && !mstruct.number().isInfinite())) { mstruct.set(nr, true); return 1; } } return -1; } bool is_real_angle_value(const MathStructure &mstruct) { if(mstruct.isUnit()) { return mstruct.unit() == CALCULATOR->getRadUnit() || mstruct.unit() == CALCULATOR->getDegUnit() || mstruct.unit() == CALCULATOR->getGraUnit() ; } else if(mstruct.isMultiplication()) { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(!b && mstruct[i].isUnit()) { if(mstruct[i].unit() == CALCULATOR->getRadUnit() || mstruct[i].unit() == CALCULATOR->getDegUnit() || mstruct[i].unit() == CALCULATOR->getGraUnit()) { b = true; } else { return false; } } else if(!mstruct[i].representsReal()) { return false; } } return b; } return false; } bool is_number_angle_value(const MathStructure &mstruct) { if(mstruct.isUnit()) { return mstruct.unit() == CALCULATOR->getRadUnit() || mstruct.unit() == CALCULATOR->getDegUnit() || mstruct.unit() == CALCULATOR->getGraUnit() ; } else if(mstruct.isMultiplication()) { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(!b && mstruct[i].isUnit()) { if(mstruct[i].unit() == CALCULATOR->getRadUnit() || mstruct[i].unit() == CALCULATOR->getDegUnit() || mstruct[i].unit() == CALCULATOR->getGraUnit()) { b = true; } else { return false; } } else if(!mstruct[i].representsNumber()) { return false; } } return b; } return false; } SinFunction::SinFunction() : MathFunction("sin", 1) { setArgumentDefinition(1, new AngleArgument()); } bool SinFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && is_number_angle_value(vargs[0]);} bool SinFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && is_real_angle_value(vargs[0]);} int SinFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; if(CALCULATOR->getRadUnit()) { mstruct.convert(CALCULATOR->getRadUnit()); mstruct /= CALCULATOR->getRadUnit(); } int errors = 0; if(eo.approximation == APPROXIMATION_TRY_EXACT) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; CALCULATOR->beginTemporaryStopMessages(); mstruct.eval(eo2); CALCULATOR->endTemporaryStopMessages(&errors); } else { mstruct.eval(eo); } bool b = false; if(mstruct.isNumber() && eo.approximation == APPROXIMATION_APPROXIMATE) { Number nr(mstruct.number()); nr /= CALCULATOR->v_pi->get().number(); nr.frac(); nr.setNegative(false); if(nr.isZero()) { mstruct.clear(true); b = true; } } else if(mstruct.isVariable() && mstruct.variable() == CALCULATOR->v_pi) { mstruct.clear(); b = true; } else if(mstruct.isFunction() && mstruct.size() == 1) { if(mstruct.function() == CALCULATOR->f_asin) { MathStructure mstruct_new(mstruct[0]); mstruct = mstruct_new; b = true; } } else if(mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0].isNumber() && mstruct[1].isVariable() && mstruct[1].variable() == CALCULATOR->v_pi) { if(mstruct[0].number().isInteger()) { mstruct.clear(); b = true; } else if(!mstruct[0].number().isComplex() && !mstruct[0].number().isInfinite()) { Number nr(mstruct[0].number()); nr.frac(); Number nr_int(mstruct[0].number()); nr_int.floor(); bool b_even = nr_int.isEven(); nr.setNegative(false); if(nr.equals(Number(1, 2))) { if(b_even) mstruct = 1; else mstruct = -1; b = true; } else if(nr.equals(Number(1, 4)) || nr.equals(Number(3, 4))) { mstruct.set(2, 1); mstruct.raise_nocopy(new MathStructure(1, 2)); mstruct.divide_nocopy(new MathStructure(2, 1)); if(!b_even) mstruct.negate(); b = true; } else if(nr.equals(Number(1, 3)) || nr.equals(Number(2, 3))) { mstruct.set(3, 1); mstruct.raise_nocopy(new MathStructure(1, 2)); mstruct.divide_nocopy(new MathStructure(2, 1)); if(!b_even) mstruct.negate(); b = true; } else if(nr.equals(Number(1, 6)) || nr.equals(Number(5, 6))) { if(b_even) mstruct.set(1, 2); else mstruct.set(-1, 2); b = true; } } } else if(mstruct.isAddition()) { size_t i = 0; for(; i < mstruct.size(); i++) { if(mstruct[i] == CALCULATOR->v_pi || (mstruct[i].isMultiplication() && mstruct[i].size() == 2 && mstruct[i][1] == CALCULATOR->v_pi && mstruct[i][0].isNumber() && mstruct[i][0].number().isInteger())) { b = true; break; } } if(b) { MathStructure mstruct2; for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(i2 != i) { if(mstruct2.isZero()) { mstruct2 = mstruct[i2]; } else { mstruct2.add(mstruct[i2], true); } } } mstruct.set(CALCULATOR->f_sin, &mstruct2, NULL); } } if(b) { if(eo.approximation == APPROXIMATION_TRY_EXACT && errors > 0) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; MathStructure mstruct2 = vargs[0]; if(CALCULATOR->getRadUnit()) { mstruct2.convert(CALCULATOR->getRadUnit()); mstruct2 /= CALCULATOR->getRadUnit(); } mstruct2.eval(eo2); } return 1; } if(eo.approximation == APPROXIMATION_TRY_EXACT && !mstruct.isNumber()) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mstruct = vargs[0]; if(CALCULATOR->getRadUnit()) { mstruct.convert(CALCULATOR->getRadUnit()); mstruct /= CALCULATOR->getRadUnit(); } mstruct.eval(eo2); } if(mstruct.isNumber()) { Number nr(mstruct.number()); if(nr.sin() && !(eo.approximation == APPROXIMATION_EXACT && nr.isApproximate()) && !(!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) && !(!eo.allow_infinite && nr.isInfinite() && !mstruct.number().isInfinite())) { mstruct.set(nr, true); return 1; } } if(mstruct.isNegate()) { MathStructure mstruct2(CALCULATOR->f_sin, &mstruct[0], NULL); mstruct = mstruct2; mstruct.negate(); if(CALCULATOR->getRadUnit()) mstruct[0] *= CALCULATOR->getRadUnit(); return 1; } if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit(); return -1; } CosFunction::CosFunction() : MathFunction("cos", 1) { setArgumentDefinition(1, new AngleArgument()); } bool CosFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && is_number_angle_value(vargs[0]);} bool CosFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && is_real_angle_value(vargs[0]);} int CosFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; if(CALCULATOR->getRadUnit()) { mstruct.convert(CALCULATOR->getRadUnit()); mstruct /= CALCULATOR->getRadUnit(); } int errors = 0; if(eo.approximation == APPROXIMATION_TRY_EXACT) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; CALCULATOR->beginTemporaryStopMessages(); mstruct.eval(eo2); CALCULATOR->endTemporaryStopMessages(&errors); } else { mstruct.eval(eo); } bool b = false; if(mstruct.isNumber() && eo.approximation == APPROXIMATION_APPROXIMATE) { Number nr(mstruct.number()); nr /= CALCULATOR->v_pi->get().number(); nr.frac(); nr.setNegative(false); nr -= Number(1, 2); if(nr.isZero()) { mstruct.clear(true); b = true; } } else if(mstruct.isVariable() && mstruct.variable() == CALCULATOR->v_pi) { mstruct = -1; b = true; } else if(mstruct.isFunction() && mstruct.size() == 1) { if(mstruct.function() == CALCULATOR->f_acos) { MathStructure mstruct_new(mstruct[0]); mstruct = mstruct_new; b = true; } } else if(mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0].isNumber() && mstruct[1].isVariable() && mstruct[1].variable() == CALCULATOR->v_pi) { if(mstruct[0].number().isInteger()) { if(mstruct[0].number().isEven()) { mstruct = 1; } else { mstruct = -1; } b = true; } else if(!mstruct[0].number().isComplex() && !mstruct[0].number().isInfinite()) { Number nr(mstruct[0].number()); nr.frac(); Number nr_int(mstruct[0].number()); nr_int.trunc(); bool b_even = nr_int.isEven(); nr.setNegative(false); if(nr.equals(Number(1, 2))) { mstruct.clear(); b = true; } else if(nr.equals(Number(1, 4))) { mstruct.set(2, 1); mstruct.raise_nocopy(new MathStructure(1, 2)); mstruct.divide_nocopy(new MathStructure(2, 1)); if(!b_even) mstruct.negate(); b = true; } else if(nr.equals(Number(3, 4))) { mstruct.set(2, 1); mstruct.raise_nocopy(new MathStructure(1, 2)); mstruct.divide_nocopy(new MathStructure(2, 1)); if(b_even) mstruct.negate(); b = true; } else if(nr.equals(Number(1, 3))) { if(b_even) mstruct.set(1, 2); else mstruct.set(-1, 2); b = true; } else if(nr.equals(Number(2, 3))) { if(b_even) mstruct.set(-1, 2); else mstruct.set(1, 2); b = true; } else if(nr.equals(Number(1, 6))) { mstruct.set(3, 1); mstruct.raise_nocopy(new MathStructure(1, 2)); mstruct.divide_nocopy(new MathStructure(2, 1)); if(!b_even) mstruct.negate(); b = true; } else if(nr.equals(Number(5, 6))) { mstruct.set(3, 1); mstruct.raise_nocopy(new MathStructure(1, 2)); mstruct.divide_nocopy(new MathStructure(2, 1)); if(b_even) mstruct.negate(); b = true; } } } else if(mstruct.isAddition()) { size_t i = 0; for(; i < mstruct.size(); i++) { if(mstruct[i] == CALCULATOR->v_pi || (mstruct[i].isMultiplication() && mstruct[i].size() == 2 && mstruct[i][1] == CALCULATOR->v_pi && mstruct[i][0].isNumber() && mstruct[i][0].number().isInteger())) { b = true; break; } } if(b) { MathStructure mstruct2; for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(i2 != i) { if(mstruct2.isZero()) { mstruct2 = mstruct[i2]; } else { mstruct2.add(mstruct[i2], true); } } } mstruct.set(CALCULATOR->f_cos, &mstruct2, NULL); mstruct.negate(); } } if(b) { if(eo.approximation == APPROXIMATION_TRY_EXACT && errors > 0) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; MathStructure mstruct2 = vargs[0]; if(CALCULATOR->getRadUnit()) { mstruct2.convert(CALCULATOR->getRadUnit()); mstruct2 /= CALCULATOR->getRadUnit(); } mstruct2.eval(eo2); } return 1; } if(eo.approximation == APPROXIMATION_TRY_EXACT && !mstruct.isNumber()) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mstruct = vargs[0]; if(CALCULATOR->getRadUnit()) { mstruct.convert(CALCULATOR->getRadUnit()); mstruct /= CALCULATOR->getRadUnit(); } mstruct.eval(eo2); } if(mstruct.isNumber()) { Number nr(mstruct.number()); if(nr.cos() && !(eo.approximation == APPROXIMATION_EXACT && nr.isApproximate()) && !(!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) && !(!eo.allow_infinite && nr.isInfinite() && !mstruct.number().isInfinite())) { mstruct.set(nr, true); return 1; } } if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit(); return -1; } TanFunction::TanFunction() : MathFunction("tan", 1) { setArgumentDefinition(1, new AngleArgument()); } int TanFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct.set(CALCULATOR->f_sin, &vargs[0], NULL); mstruct.divide_nocopy(new MathStructure(CALCULATOR->f_cos, &vargs[0], NULL)); return 1; } AsinFunction::AsinFunction() : MathFunction("asin", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false)); } bool AsinFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} int AsinFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].number().isZero()) { mstruct.clear(); } else if(vargs[0].number().isOne()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(90, 1); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(100, 1); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(1, 2); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(1, 2); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(vargs[0].number().isMinusOne()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(-90, 1); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(-100, 1); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(-1, 2); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(-1, 2); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(vargs[0].number().equals(Number(1, 2))) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(30, 1); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(100, 3); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(1, 6); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(1, 6); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else { Number nr = vargs[0].number(); if(!nr.asin() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate()) || (!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) || (!eo.allow_infinite && nr.isInfinite() && !mstruct.number().isInfinite())) return 0; mstruct = nr; switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.multiply_nocopy(new MathStructure(180, 1)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } case ANGLE_UNIT_GRADIANS: { mstruct.multiply_nocopy(new MathStructure(200, 1)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } case ANGLE_UNIT_RADIANS: { break; } default: { if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } return 1; } AcosFunction::AcosFunction() : MathFunction("acos", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false)); } bool AcosFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} int AcosFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].number().isZero()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(90, 1); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(100, 1); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(1, 2); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(1, 2); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(vargs[0].number().isOne()) { mstruct.clear(); } else if(vargs[0].number().isMinusOne()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(180, 1); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(200, 1); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(CALCULATOR->v_pi); break; } default: { mstruct.set(CALCULATOR->v_pi); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(vargs[0].number().equals(Number(1, 2))) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(60, 1); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(200, 3); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(1, 3); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(1, 3); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else { Number nr = vargs[0].number(); if(!nr.acos() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate()) || (!eo.allow_complex && nr.isComplex() && !vargs[0].number().isComplex()) || (!eo.allow_infinite && nr.isInfinite() && !vargs[0].number().isInfinite())) return 0; mstruct = nr; switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.multiply_nocopy(new MathStructure(180, 1)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } case ANGLE_UNIT_GRADIANS: { mstruct.multiply_nocopy(new MathStructure(200, 1)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } case ANGLE_UNIT_RADIANS: { break; } default: { if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } return 1; } AtanFunction::AtanFunction() : MathFunction("atan", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false)); } bool AtanFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool AtanFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} int AtanFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].number().isZero()) { mstruct.clear(); } else if(eo.allow_infinite && vargs[0].number().isI()) { mstruct = vargs[0]; Number nr; nr.setInfinity(); mstruct *= nr; } else if(eo.allow_infinite && vargs[0].number().isMinusI()) { mstruct = vargs[0]; Number nr; nr.setInfinity(); mstruct *= nr; } else if(vargs[0].number().isPlusInfinity()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(90, 1); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(100, 1); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(1, 2); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(1, 2); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(vargs[0].number().isMinusInfinity()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(-90, 1); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(-100, 1); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(-1, 2); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(-1, 2); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(vargs[0].number().isOne()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(45, 1); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(50, 1); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(1, 4); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(1, 4); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(vargs[0].number().isMinusOne()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(-45, 1); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(-50, 1); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(-1, 4); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(-1, 4); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else { Number nr = vargs[0].number(); if(!nr.atan() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate()) || (!eo.allow_complex && nr.isComplex() && !vargs[0].number().isComplex()) || (!eo.allow_infinite && nr.isInfinite() && !vargs[0].number().isInfinite())) return 0; mstruct = nr; switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.multiply_nocopy(new MathStructure(180, 1)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } case ANGLE_UNIT_GRADIANS: { mstruct.multiply_nocopy(new MathStructure(200, 1)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } case ANGLE_UNIT_RADIANS: { break; } default: { if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } return 1; } SinhFunction::SinhFunction() : MathFunction("sinh", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false)); } bool SinhFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool SinhFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} int SinhFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(sinh) } CoshFunction::CoshFunction() : MathFunction("cosh", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false)); } bool CoshFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool CoshFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} int CoshFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(cosh) } TanhFunction::TanhFunction() : MathFunction("tanh", 1) {} bool TanhFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool TanhFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} int TanhFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct.set(CALCULATOR->f_sinh, &vargs[0], NULL); mstruct.divide_nocopy(new MathStructure(CALCULATOR->f_cosh, &vargs[0], NULL)); return 1; } AsinhFunction::AsinhFunction() : MathFunction("asinh", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } bool AsinhFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool AsinhFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} int AsinhFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { MathStructure m_arg(vargs[0]); m_arg ^= 2; m_arg += 1; m_arg ^= Number(1, 2); m_arg += vargs[0]; mstruct.set(CALCULATOR->f_ln, &m_arg, NULL); return 1; } AcoshFunction::AcoshFunction() : MathFunction("acosh", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } bool AcoshFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} int AcoshFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { MathStructure m_arg(vargs[0]); m_arg ^= 2; m_arg -= 1; m_arg ^= Number(1, 2); m_arg += vargs[0]; mstruct.set(CALCULATOR->f_ln, &m_arg, NULL); return 1; } AtanhFunction::AtanhFunction() : MathFunction("atanh", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } int AtanhFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { MathStructure m_arg = 1; m_arg += vargs[0]; MathStructure m_den = 1; m_den -= vargs[0]; m_arg /= m_den; mstruct.set(CALCULATOR->f_ln, &m_arg, NULL); mstruct *= Number(1, 2); return 1; } RadiansToDefaultAngleUnitFunction::RadiansToDefaultAngleUnitFunction() : MathFunction("radtodef", 1) { } int RadiansToDefaultAngleUnitFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct *= 180; mstruct /= CALCULATOR->v_pi; break; } case ANGLE_UNIT_GRADIANS: { mstruct *= 200; mstruct /= CALCULATOR->v_pi; break; } case ANGLE_UNIT_RADIANS: { break; } default: { if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } return 1; } TotalFunction::TotalFunction() : MathFunction("total", 1) { setArgumentDefinition(1, new VectorArgument("")); } int TotalFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct.clear(); for(size_t index = 0; index < vargs[0].size(); index++) { mstruct.add(vargs[0][index], true); } return 1; } PercentileFunction::PercentileFunction() : MathFunction("percentile", 2) { setArgumentDefinition(1, new VectorArgument("")); NumberArgument *arg = new NumberArgument(); Number fr; arg->setMin(&fr); fr.set(99, 1); arg->setMax(&fr); arg->setIncludeEqualsMin(false); arg->setIncludeEqualsMax(false); setArgumentDefinition(2, arg); } int PercentileFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { MathStructure v(vargs[0]); MathStructure *mp; Number fr100(100); if(!v.sortVector()) { return 0; } else { Number pfr(vargs[1].number()); pfr /= 100; pfr *= (int) v.countChildren() + 1; /* Number cfr(v->countChildren()); if(pfr.isZero() || pfr.numerator()->isLessThan(pfr.denominator()) || pfr.isGreaterThan(&cfr)) { CALCULATOR->error(true, _("Not enough samples."), NULL); }*/ if(pfr.isInteger()) { mp = v.getChild((size_t) pfr.intValue()); if(!mp) return 0; mstruct = *mp; } else { Number ufr(pfr); ufr.ceil(); Number lfr(pfr); lfr.floor(); pfr -= lfr; mp = v.getChild((size_t) ufr.intValue()); if(!mp) return 0; MathStructure gap(*mp); mp = v.getChild((size_t) lfr.intValue()); if(!mp) return 0; gap -= *mp; gap *= pfr; mp = v.getChild((size_t) lfr.intValue()); if(!mp) return 0; mstruct = *mp; mstruct += gap; } } return 1; } MinFunction::MinFunction() : MathFunction("min", 1) { setArgumentDefinition(1, new VectorArgument("")); } int MinFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { ComparisonResult cmp; const MathStructure *min = NULL; vector unsolveds; bool b = false; for(size_t index = 0; index < vargs[0].size(); index++) { if(min == NULL) { min = &vargs[0][index]; } else { cmp = min->compare(vargs[0][index]); if(cmp == COMPARISON_RESULT_LESS) { min = &vargs[0][index]; b = true; } else if(COMPARISON_NOT_FULLY_KNOWN(cmp)) { if(CALCULATOR->showArgumentErrors()) { CALCULATOR->error(true, _("Unsolvable comparison in %s()."), name().c_str(), NULL); } unsolveds.push_back(&vargs[0][index]); } else { b = true; } } } if(min) { if(unsolveds.size() > 0) { if(!b) return 0; MathStructure margs; margs.clearVector(); margs.addChild(*min); for(size_t i = 0; i < unsolveds.size(); i++) { margs.addChild(*unsolveds[i]); } mstruct.set(this, &margs, NULL); return 1; } else { mstruct = *min; return 1; } } return 0; } MaxFunction::MaxFunction() : MathFunction("max", 1) { setArgumentDefinition(1, new VectorArgument("")); } int MaxFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { ComparisonResult cmp; const MathStructure *max = NULL; vector unsolveds; bool b = false; for(size_t index = 0; index < vargs[0].size(); index++) { if(max == NULL) { max = &vargs[0][index]; } else { cmp = max->compare(vargs[0][index]); if(cmp == COMPARISON_RESULT_GREATER) { max = &vargs[0][index]; b = true; } else if(COMPARISON_NOT_FULLY_KNOWN(cmp)) { if(CALCULATOR->showArgumentErrors()) { CALCULATOR->error(true, _("Unsolvable comparison in %s()."), name().c_str(), NULL); } unsolveds.push_back(&vargs[0][index]); } else { b = true; } } } if(max) { if(unsolveds.size() > 0) { if(!b) return 0; MathStructure margs; margs.clearVector(); margs.addChild(*max); for(size_t i = 0; i < unsolveds.size(); i++) { margs.addChild(*unsolveds[i]); } mstruct.set(this, &margs, NULL); return 1; } else { mstruct = *max; return 1; } } return 0; } ModeFunction::ModeFunction() : MathFunction("mode", 1) { setArgumentDefinition(1, new VectorArgument("")); } int ModeFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(vargs[0].size() <= 0) { return 0; } size_t n = 0; bool b; vector vargs_nodup; vector is; const MathStructure *value = NULL; for(size_t index_c = 0; index_c < vargs[0].size(); index_c++) { b = true; for(size_t index = 0; index < vargs_nodup.size(); index++) { if(vargs_nodup[index]->equals(vargs[0][index_c])) { is[index]++; b = false; break; } } if(b) { vargs_nodup.push_back(&vargs[0][index_c]); is.push_back(1); } } for(size_t index = 0; index < is.size(); index++) { if(is[index] > n) { n = is[index]; value = vargs_nodup[index]; } } if(value) { mstruct = *value; return 1; } return 0; } RandFunction::RandFunction() : MathFunction("rand", 0, 1) { setArgumentDefinition(1, new IntegerArgument()); setDefaultValue(1, "0"); } int RandFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(vargs[0].number().isZero() || vargs[0].number().isNegative()) { Number nr; nr.setInternal(cln::random_F(cln::cl_float(1))); mstruct = nr; } else { Number nr; nr.setInternal(cln::random_I(cln::numerator(cln::rational(cln::realpart(vargs[0].number().internalNumber())))) + 1); mstruct = nr; } return 1; } bool RandFunction::representsReal(const MathStructure&, bool) const {return true;} bool RandFunction::representsInteger(const MathStructure &vargs) const {return vargs.size() > 0 && vargs[0].isNumber() && vargs[0].number().isPositive();} bool RandFunction::representsNonNegative(const MathStructure&) const {return true;} ISODateFunction::ISODateFunction() : MathFunction("isodate", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "today"); } int ISODateFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { GDate *gtime = g_date_new(); string str = vargs[0].symbol(); remove_blank_ends(str); if(str == _("today") || str == "today") { g_date_set_time(gtime, time(NULL)); } else { g_date_set_parse(gtime, str.c_str()); } gchar *gstr = (gchar*) malloc(sizeof(gchar) * 100); g_date_strftime(gstr, 100, "%F", gtime); mstruct.set(gstr); g_date_free(gtime); g_free(gstr); return 1; } LocalDateFunction::LocalDateFunction() : MathFunction("localdate", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "today"); } int LocalDateFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { GDate *gtime = g_date_new(); string str = vargs[0].symbol(); remove_blank_ends(str); if(str == _("today") || str == "today") { g_date_set_time(gtime, time(NULL)); } else { g_date_set_parse(gtime, str.c_str()); } gchar *gstr = (gchar*) malloc(sizeof(gchar) * 100); g_date_strftime(gstr, 100, "%x", gtime); mstruct.set(gstr); g_date_free(gtime); g_free(gstr); return 1; } TimestampFunction::TimestampFunction() : MathFunction("timestamp", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "now"); } int TimestampFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { string str = vargs[0].symbol(); remove_blank_ends(str); if(str == _("now") || str == "now") { mstruct.number().setInternal(time(NULL)); return 1; } GDate *gtime = g_date_new(); if(str == _("today") || str == "today") { g_date_set_time(gtime, time(NULL)); } else { g_date_set_parse(gtime, str.c_str()); } gchar *gstr = (gchar*) malloc(sizeof(gchar) * 100); g_date_strftime(gstr, 100, "%s", gtime); Number nr(gstr); g_date_free(gtime); g_free(gstr); if(nr.isMinusOne()) { CALCULATOR->error(true, _("The timestamp value for the date %s is too large or small for %s()."), vargs[0].print().c_str(), preferredDisplayName().name.c_str(), NULL); return 0; } mstruct.set(nr); return 1; } TimestampToDateFunction::TimestampToDateFunction() : MathFunction("stamptodate", 1) { setArgumentDefinition(1, new IntegerArgument()); } int TimestampToDateFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { cln::cl_I i = cln::numerator(cln::rational(cln::realpart(vargs[0].number().internalNumber()))); GTime ti = 0; if(i > long(LONG_MAX)) { return 0; } else if(i < long(LONG_MIN)) { return 0; } ti = (GTime) cln::cl_I_to_long(i); GDate *gtime = g_date_new(); g_date_set_time(gtime, ti); gchar *gstr = (gchar*) malloc(sizeof(gchar) * 100); g_date_strftime(gstr, 100, "%F", gtime); mstruct.set(gstr); g_date_free(gtime); g_free(gstr); return 1; } AddDaysFunction::AddDaysFunction() : MathFunction("addDays", 2) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new IntegerArgument()); } int AddDaysFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { string str = addDays(vargs[0].symbol(), vargs[1].number().intValue()); if(str.empty()) { CALCULATOR->error(true, _("Error in date format for function %s()."), name().c_str(), NULL); return 0; } mstruct.set(str); return 1; } AddMonthsFunction::AddMonthsFunction() : MathFunction("addMonths", 2) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new IntegerArgument()); } int AddMonthsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { string str = addMonths(vargs[0].symbol(), vargs[1].number().intValue()); if(str.empty()) { CALCULATOR->error(true, _("Error in date format for function %s()."), name().c_str(), NULL); return 0; } mstruct.set(str); return 1; } AddYearsFunction::AddYearsFunction() : MathFunction("addYears", 2) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new IntegerArgument()); } int AddYearsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { string str = addYears(vargs[0].symbol(), vargs[1].number().intValue()); if(str.empty()) { CALCULATOR->error(true, _("Error in date format for function %s()."), name().c_str(), NULL); return 0; } mstruct.set(str); return 1; } DaysFunction::DaysFunction() : MathFunction("days", 2, 4) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new DateArgument()); IntegerArgument *arg = new IntegerArgument(); Number integ; arg->setMin(&integ); integ.set(4, 1); arg->setMax(&integ); setArgumentDefinition(3, arg); setArgumentDefinition(4, new BooleanArgument()); setDefaultValue(3, "1"); } int DaysFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { int days = daysBetweenDates(vargs[0].symbol(), vargs[1].symbol(), vargs[2].number().intValue(), vargs[3].number().isZero()); if(days < 0) { CALCULATOR->error(true, _("Error in date format for function %s()."), name().c_str(), NULL); return 0; } mstruct.set(days, 1); return 1; } YearFracFunction::YearFracFunction() : MathFunction("yearfrac", 2, 4) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new DateArgument()); IntegerArgument *arg = new IntegerArgument(); Number integ; arg->setMin(&integ); integ.set(4, 1); arg->setMax(&integ); setArgumentDefinition(3, arg); setArgumentDefinition(4, new BooleanArgument()); setDefaultValue(3, "1"); } int YearFracFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { Number yfr = yearsBetweenDates(vargs[0].symbol(), vargs[1].symbol(), vargs[2].number().intValue(), vargs[3].number().isZero()); if(yfr.isMinusOne()) { CALCULATOR->error(true, _("Error in date format for function %s()."), name().c_str(), NULL); return 0; } mstruct.set(yfr); return 1; } WeekFunction::WeekFunction() : MathFunction("week", 0, 2) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new BooleanArgument()); setDefaultValue(1, "today"); } int WeekFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { int w = week(vargs[0].symbol(), vargs[1].number().getBoolean()); if(w < 0) { return 0; } mstruct.set(w, 1); return 1; } WeekdayFunction::WeekdayFunction() : MathFunction("weekday", 0, 2) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new BooleanArgument()); setDefaultValue(1, "today"); } int WeekdayFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { int w = weekday(vargs[0].symbol()); if(w < 0) { return 0; } if(vargs[1].number().getBoolean()) { if(w == 7) w = 1; else w++; } mstruct.set(w, 1); return 1; } YeardayFunction::YeardayFunction() : MathFunction("yearday", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "today"); } int YeardayFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { int d = yearday(vargs[0].symbol()); if(d < 0) { return 0; } mstruct.set(d, 1); return 1; } MonthFunction::MonthFunction() : MathFunction("month", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "today"); } int MonthFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { int year, month, day; if(!s2date(vargs[0].symbol(), year, month, day)) { return 0; } mstruct.set(month, 1); return 1; } DayFunction::DayFunction() : MathFunction("day", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "today"); } int DayFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { int year, month, day; if(!s2date(vargs[0].symbol(), year, month, day)) { return 0; } mstruct.set(day, 1); return 1; } YearFunction::YearFunction() : MathFunction("year", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "today"); } int YearFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { int year, month, day; if(!s2date(vargs[0].symbol(), year, month, day)) { return 0; } mstruct.set(year, 1); return 1; } TimeFunction::TimeFunction() : MathFunction("time", 0) { } int TimeFunction::calculate(MathStructure &mstruct, const MathStructure&, const EvaluationOptions&) { int hour, min, sec; now(hour, min, sec); Number tnr(sec, 1); tnr /= 60; tnr += min; tnr /= 60; tnr += hour; mstruct = tnr; return 1; } BinFunction::BinFunction() : MathFunction("bin", 1) { setArgumentDefinition(1, new TextArgument()); } int BinFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { //mstruct = Number(vargs[0].symbol(), 2); ParseOptions po = eo.parse_options; po.base = BASE_BINARY; CALCULATOR->parse(&mstruct, vargs[0].symbol(), po); return 1; } OctFunction::OctFunction() : MathFunction("oct", 1) { setArgumentDefinition(1, new TextArgument()); } int OctFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { //mstruct = Number(vargs[0].symbol(), 8); ParseOptions po = eo.parse_options; po.base = BASE_OCTAL; CALCULATOR->parse(&mstruct, vargs[0].symbol(), po); return 1; } HexFunction::HexFunction() : MathFunction("hex", 1) { setArgumentDefinition(1, new TextArgument()); } int HexFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { //mstruct = Number(vargs[0].symbol(), 16); ParseOptions po = eo.parse_options; po.base = BASE_HEXADECIMAL; CALCULATOR->parse(&mstruct, vargs[0].symbol(), po); return 1; } BaseFunction::BaseFunction() : MathFunction("base", 2) { setArgumentDefinition(1, new TextArgument()); IntegerArgument *arg = new IntegerArgument(); Number integ(2, 1); arg->setMin(&integ); integ.set(36, 1); arg->setMax(&integ); setArgumentDefinition(2, arg); } int BaseFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { //mstruct = Number(vargs[0].symbol(), vargs[1].number().intValue()); ParseOptions po = eo.parse_options; po.base = vargs[1].number().intValue(); CALCULATOR->parse(&mstruct, vargs[0].symbol(), po); return 1; } RomanFunction::RomanFunction() : MathFunction("roman", 1) { setArgumentDefinition(1, new TextArgument()); } int RomanFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { //mstruct = Number(vargs[0].symbol(), BASE_ROMAN_NUMERALS); ParseOptions po = eo.parse_options; po.base = BASE_ROMAN_NUMERALS; CALCULATOR->parse(&mstruct, vargs[0].symbol(), po); return 1; } AsciiFunction::AsciiFunction() : MathFunction("code", 1) { TextArgument *arg = new TextArgument(); arg->setCustomCondition("len(\\x) = 1"); setArgumentDefinition(1, arg); } int AsciiFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { unsigned char c = (unsigned char) vargs[0].symbol()[0]; mstruct.set(c, 1); return 1; } CharFunction::CharFunction() : MathFunction("char", 1) { IntegerArgument *arg = new IntegerArgument(); Number fr(32, 0); arg->setMin(&fr); fr.set(0x7f, 1); arg->setMax(&fr); setArgumentDefinition(1, arg); } int CharFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { string str; str += vargs[0].number().intValue(); mstruct = str; return 1; } ConcatenateFunction::ConcatenateFunction() : MathFunction("concatenate", 1, -1) { setArgumentDefinition(1, new TextArgument()); setArgumentDefinition(2, new TextArgument()); } int ConcatenateFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { string str; for(size_t i = 0; i < vargs.size(); i++) { str += vargs[i].symbol(); } mstruct = str; return 1; } LengthFunction::LengthFunction() : MathFunction("len", 1) { setArgumentDefinition(1, new TextArgument()); } int LengthFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = (int) vargs[0].symbol().length(); return 1; } ReplaceFunction::ReplaceFunction() : MathFunction("replace", 3, 4) { setArgumentDefinition(4, new BooleanArgument()); setDefaultValue(4, "0"); } int ReplaceFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; if(vargs[3].number().getBoolean()) mstruct.eval(eo); mstruct.replace(vargs[1], vargs[2]); return 1; } StripUnitsFunction::StripUnitsFunction() : MathFunction("nounit", 1) { } int StripUnitsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.eval(eo); mstruct.removeType(STRUCT_UNIT); return 1; } ErrorFunction::ErrorFunction() : MathFunction("error", 1) { setArgumentDefinition(1, new TextArgument()); } int ErrorFunction::calculate(MathStructure&, const MathStructure &vargs, const EvaluationOptions&) { CALCULATOR->error(true, vargs[0].symbol().c_str(), NULL); return 1; } WarningFunction::WarningFunction() : MathFunction("warning", 1) { setArgumentDefinition(1, new TextArgument()); } int WarningFunction::calculate(MathStructure&, const MathStructure &vargs, const EvaluationOptions&) { CALCULATOR->error(false, vargs[0].symbol().c_str(), NULL); return 1; } MessageFunction::MessageFunction() : MathFunction("message", 1) { setArgumentDefinition(1, new TextArgument()); } int MessageFunction::calculate(MathStructure&, const MathStructure &vargs, const EvaluationOptions&) { CALCULATOR->message(MESSAGE_INFORMATION, vargs[0].symbol().c_str(), NULL); return 1; } GenerateVectorFunction::GenerateVectorFunction() : MathFunction("genvector", 4, 6) { setArgumentDefinition(5, new SymbolicArgument()); setDefaultValue(5, "x"); setArgumentDefinition(6, new BooleanArgument()); setDefaultValue(6, "0"); } int GenerateVectorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[5].number().getBoolean()) { mstruct = vargs[0].generateVector(vargs[4], vargs[1], vargs[2], vargs[3], NULL, eo); } else { bool overflow = false; int steps = vargs[3].number().intValue(&overflow); if(!vargs[3].isNumber() || overflow || steps < 1) { CALCULATOR->error(true, _("The number of requested elements in generate vector function must be a positive integer."), NULL); return 0; } mstruct = vargs[0].generateVector(vargs[4], vargs[1], vargs[2], steps, NULL, eo); } return 1; } ForFunction::ForFunction() : MathFunction("for", 7) { setArgumentDefinition(2, new SymbolicArgument()); setArgumentDefinition(7, new SymbolicArgument()); } int ForFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[4]; MathStructure mcounter = vargs[0]; MathStructure mtest; MathStructure mcount; MathStructure mupdate; while(true) { mtest = vargs[3]; mtest.replace(vargs[1], mcounter); mtest.eval(eo); if(!mtest.isNumber()) return 0; if(!mtest.number().getBoolean()) { break; } mupdate = vargs[5]; mupdate.replace(vargs[1], mcounter, vargs[6], mstruct); mstruct = mupdate; mcount = vargs[3]; mcount.replace(vargs[1], mcounter); mcounter = mcount; } return 1; } SumFunction::SumFunction() : MathFunction("sum", 3, 4) { setArgumentDefinition(2, new IntegerArgument()); setArgumentDefinition(3, new IntegerArgument()); setArgumentDefinition(4, new SymbolicArgument()); setDefaultValue(4, "x"); setCondition("\\z >= \\y"); } int SumFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct.clear(); Number i_nr(vargs[1].number()); MathStructure mstruct_calc; bool started = false, s2 = false; while(i_nr.isLessThanOrEqualTo(vargs[2].number())) { mstruct_calc.set(vargs[0]); mstruct_calc.replace(vargs[3], i_nr); if(started) { mstruct.add(mstruct_calc, s2); s2 = true; } else { mstruct = mstruct_calc; started = true; } i_nr += 1; } return 1; } ProductFunction::ProductFunction() : MathFunction("product", 3, 4) { setArgumentDefinition(2, new IntegerArgument()); setArgumentDefinition(3, new IntegerArgument()); setArgumentDefinition(4, new SymbolicArgument()); setDefaultValue(4, "x"); setCondition("\\z >= \\y"); } int ProductFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct.clear(); Number i_nr(vargs[1].number()); MathStructure mstruct_calc; bool started = false, s2 = false; while(i_nr.isLessThanOrEqualTo(vargs[2].number())) { mstruct_calc.set(vargs[0]); mstruct_calc.replace(vargs[3], i_nr); if(started) { mstruct.multiply(mstruct_calc, s2); s2 = true; } else { mstruct = mstruct_calc; started = true; } i_nr += 1; } return 1; } bool process_replace(MathStructure &mprocess, const MathStructure &mstruct, const MathStructure &vargs, size_t index); bool process_replace(MathStructure &mprocess, const MathStructure &mstruct, const MathStructure &vargs, size_t index) { if(mprocess == vargs[1]) { mprocess = mstruct[index]; return true; } if(!vargs[3].isEmptySymbol() && mprocess == vargs[3]) { mprocess = (int) index + 1; return true; } if(!vargs[4].isEmptySymbol() && mprocess == vargs[4]) { mprocess = vargs[2]; return true; } bool b = false; for(size_t i = 0; i < mprocess.size(); i++) { if(process_replace(mprocess[i], mstruct, vargs, index)) { mprocess.childUpdated(i + 1); b = true; } } return b; } ProcessFunction::ProcessFunction() : MathFunction("process", 3, 5) { setArgumentDefinition(2, new SymbolicArgument()); setArgumentDefinition(3, new VectorArgument()); setArgumentDefinition(4, new SymbolicArgument()); setDefaultValue(4, "\"\""); setArgumentDefinition(5, new SymbolicArgument()); setDefaultValue(5, "\"\""); } int ProcessFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[2]; MathStructure mprocess; for(size_t index = 0; index < mstruct.size(); index++) { mprocess = vargs[0]; process_replace(mprocess, mstruct, vargs, index); mstruct[index] = mprocess; } return 1; } bool process_matrix_replace(MathStructure &mprocess, const MathStructure &mstruct, const MathStructure &vargs, size_t rindex, size_t cindex); bool process_matrix_replace(MathStructure &mprocess, const MathStructure &mstruct, const MathStructure &vargs, size_t rindex, size_t cindex) { if(mprocess == vargs[1]) { mprocess = mstruct[rindex][cindex]; return true; } if(!vargs[3].isEmptySymbol() && mprocess == vargs[3]) { mprocess = (int) rindex + 1; return true; } if(!vargs[4].isEmptySymbol() && mprocess == vargs[4]) { mprocess = (int) cindex + 1; return true; } if(!vargs[5].isEmptySymbol() && mprocess == vargs[5]) { mprocess = vargs[2]; return true; } bool b = false; for(size_t i = 0; i < mprocess.size(); i++) { if(process_matrix_replace(mprocess[i], mstruct, vargs, rindex, cindex)) { mprocess.childUpdated(i + 1); b = true; } } return b; } ProcessMatrixFunction::ProcessMatrixFunction() : MathFunction("processm", 3, 6) { setArgumentDefinition(2, new SymbolicArgument()); setArgumentDefinition(3, new MatrixArgument()); setArgumentDefinition(4, new SymbolicArgument()); setDefaultValue(4, "\"\""); setArgumentDefinition(5, new SymbolicArgument()); setDefaultValue(5, "\"\""); setArgumentDefinition(6, new SymbolicArgument()); setDefaultValue(6, "\"\""); } int ProcessMatrixFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[2]; MathStructure mprocess; for(size_t rindex = 0; rindex < mstruct.size(); rindex++) { for(size_t cindex = 0; cindex < mstruct[rindex].size(); cindex++) { mprocess = vargs[0]; process_matrix_replace(mprocess, mstruct, vargs, rindex, cindex); mstruct[rindex][cindex] = mprocess; } } return 1; } bool csum_replace(MathStructure &mprocess, const MathStructure &mstruct, const MathStructure &vargs, size_t index, const EvaluationOptions &eo2); bool csum_replace(MathStructure &mprocess, const MathStructure &mstruct, const MathStructure &vargs, size_t index, const EvaluationOptions &eo2) { if(mprocess == vargs[4]) { mprocess = vargs[6][index]; return true; } if(mprocess == vargs[5]) { mprocess = mstruct; return true; } if(!vargs[7].isEmptySymbol() && mprocess == vargs[7]) { mprocess = (int) index + 1; return true; } if(!vargs[8].isEmptySymbol()) { if(mprocess.isFunction() && mprocess.function() == CALCULATOR->f_component && mprocess.size() == 2 && mprocess[1] == vargs[8]) { bool b = csum_replace(mprocess[0], mstruct, vargs, index, eo2); mprocess[0].eval(eo2); if(mprocess[0].isNumber() && mprocess[0].number().isInteger() && mprocess[0].number().isPositive() && mprocess[0].number().isLessThanOrEqualTo(vargs[6].size())) { mprocess = vargs[6][mprocess[0].number().intValue() - 1]; return true; } return csum_replace(mprocess[1], mstruct, vargs, index, eo2) || b; } else if(mprocess == vargs[8]) { mprocess = vargs[6]; return true; } } bool b = false; for(size_t i = 0; i < mprocess.size(); i++) { if(csum_replace(mprocess[i], mstruct, vargs, index, eo2)) { mprocess.childUpdated(i + 1); b = true; } } return b; } CustomSumFunction::CustomSumFunction() : MathFunction("csum", 7, 9) { setArgumentDefinition(1, new IntegerArgument()); //begin setArgumentDefinition(2, new IntegerArgument()); //end //3. initial //4. function setArgumentDefinition(5, new SymbolicArgument()); //x var setArgumentDefinition(6, new SymbolicArgument()); //y var setArgumentDefinition(7, new VectorArgument()); setArgumentDefinition(8, new SymbolicArgument()); //i var setDefaultValue(8, "\"\""); setArgumentDefinition(9, new SymbolicArgument()); //v var setDefaultValue(9, "\"\""); } int CustomSumFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { int start = vargs[0].number().intValue(); if(start < 1) start = 1; int end = vargs[1].number().intValue(); int n = vargs[6].countChildren(); if(start > n) start = n; if(end < 1 || end > n) end = n; else if(end < start) end = start; mstruct = vargs[2]; MathStructure mexpr(vargs[3]); MathStructure mprocess; EvaluationOptions eo2 = eo; eo2.calculate_functions = false; for(size_t index = (size_t) start - 1; index < (size_t) end; index++) { mprocess = mexpr; csum_replace(mprocess, mstruct, vargs, index, eo2); mprocess.eval(eo2); mstruct = mprocess; } return 1; } FunctionFunction::FunctionFunction() : MathFunction("function", 2) { setArgumentDefinition(1, new TextArgument()); setArgumentDefinition(2, new VectorArgument()); } int FunctionFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { UserFunction f("", "Generated MathFunction", vargs[0].symbol()); MathStructure args = vargs[1]; mstruct = f.MathFunction::calculate(args, eo); return 1; } SelectFunction::SelectFunction() : MathFunction("select", 2, 4) { setArgumentDefinition(3, new SymbolicArgument()); setDefaultValue(3, "x"); setArgumentDefinition(4, new BooleanArgument()); setDefaultValue(4, "0"); } int SelectFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { MathStructure mtest; mstruct = vargs[0]; mstruct.eval(eo); if(!mstruct.isVector()) { mtest = vargs[1]; mtest.replace(vargs[2], mstruct); mtest.eval(eo); if(!mtest.isNumber() || mtest.number().getBoolean() < 0) { CALCULATOR->error(true, _("Comparison failed."), NULL); return -1; } if(mtest.number().getBoolean() == 0) { if(vargs[3].number().getBoolean() > 0) { CALCULATOR->error(true, _("No matching item found."), NULL); return -1; } mstruct.clearVector(); } return 1; } for(size_t i = 0; i < mstruct.size();) { mtest = vargs[1]; mtest.replace(vargs[2], mstruct[i]); mtest.eval(eo); if(!mtest.isNumber() || mtest.number().getBoolean() < 0) { CALCULATOR->error(true, _("Comparison failed."), NULL); return -1; } if(mtest.number().getBoolean() == 0) { if(vargs[3].number().getBoolean() == 0) { mstruct.delChild(i + 1); } else { i++; } } else if(vargs[3].number().getBoolean() > 0) { MathStructure msave(mstruct[i]); mstruct = msave; return 1; } else { i++; } } if(vargs[3].number().getBoolean() > 0) { CALCULATOR->error(true, _("No matching item found."), NULL); return -1; } return 1; } IFFunction::IFFunction() : MathFunction("if", 3) { NON_COMPLEX_NUMBER_ARGUMENT(1) } int IFFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { int result = vargs[0].number().getBoolean(); if(result) { mstruct = vargs[1]; } else if(result == 0) { mstruct = vargs[2]; } else { return 0; } return 1; } IsNumberFunction::IsNumberFunction() : MathFunction("isNumber", 1) { } int IsNumberFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; if(!mstruct.isNumber()) mstruct.eval(eo); if(mstruct.isNumber()) { mstruct.number().setTrue(); } else { mstruct.clear(); mstruct.number().setFalse(); } return 1; } IS_NUMBER_FUNCTION(IsIntegerFunction, isInteger) IS_NUMBER_FUNCTION(IsRealFunction, isReal) IS_NUMBER_FUNCTION(IsRationalFunction, isRational) REPRESENTS_FUNCTION(RepresentsIntegerFunction, representsInteger) REPRESENTS_FUNCTION(RepresentsRealFunction, representsReal) REPRESENTS_FUNCTION(RepresentsRationalFunction, representsRational) REPRESENTS_FUNCTION(RepresentsNumberFunction, representsNumber) LoadFunction::LoadFunction() : MathFunction("load", 1, 3) { setArgumentDefinition(1, new FileArgument()); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); setDefaultValue(2, "1"); setArgumentDefinition(3, new TextArgument()); setDefaultValue(3, ","); } int LoadFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { string delim = vargs[2].symbol(); if(delim == "tab") { delim = "\t"; } if(!CALCULATOR->importCSV(mstruct, vargs[0].symbol().c_str(), vargs[1].number().intValue(), delim)) { CALCULATOR->error(true, "Failed to load %s.", vargs[0].symbol().c_str(), NULL); return 0; } return 1; } ExportFunction::ExportFunction() : MathFunction("export", 2, 3) { setArgumentDefinition(1, new VectorArgument()); setArgumentDefinition(2, new FileArgument()); setArgumentDefinition(3, new TextArgument()); setDefaultValue(3, ","); } int ExportFunction::calculate(MathStructure&, const MathStructure &vargs, const EvaluationOptions&) { string delim = vargs[2].symbol(); if(delim == "tab") { delim = "\t"; } if(!CALCULATOR->exportCSV(vargs[0], vargs[1].symbol().c_str(), delim)) { CALCULATOR->error(true, "Failed to export to %s.", vargs[1].symbol().c_str(), NULL); return 0; } return 1; } TitleFunction::TitleFunction() : MathFunction("title", 1) { setArgumentDefinition(1, new ExpressionItemArgument()); } int TitleFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { ExpressionItem *item = CALCULATOR->getExpressionItem(vargs[0].symbol()); if(!item) { CALCULATOR->error(true, _("Object %s does not exist."), vargs[0].symbol().c_str(), NULL); return 0; } else { mstruct = item->title(); } return 1; } SaveFunction::SaveFunction() : MathFunction("save", 2, 4) { setArgumentDefinition(2, new TextArgument()); setArgumentDefinition(3, new TextArgument()); setArgumentDefinition(4, new TextArgument()); setDefaultValue(3, "Temporary"); setDefaultValue(4, ""); } int SaveFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.eval(eo); CALCULATOR->addVariable(new KnownVariable(vargs[2].symbol(), vargs[1].symbol(), mstruct, vargs[3].symbol())); CALCULATOR->saveFunctionCalled(); return 1; } RegisterFunction::RegisterFunction() : MathFunction("register", 1) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); } int RegisterFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(vargs[0].number().isGreaterThan(CALCULATOR->RPNStackSize())) { CALCULATOR->error(false, _("Register %s does not exist. Returning zero."), vargs[0].print().c_str(), NULL); mstruct.clear(); return 1; } mstruct.set(*CALCULATOR->getRPNRegister((size_t) vargs[0].number().intValue())); return 1; } StackFunction::StackFunction() : MathFunction("stack", 0) { } int StackFunction::calculate(MathStructure &mstruct, const MathStructure&, const EvaluationOptions&) { mstruct.clearVector(); for(size_t i = 1; i <= CALCULATOR->RPNStackSize(); i++) { mstruct.addChild(*CALCULATOR->getRPNRegister(i)); } return 1; } DeriveFunction::DeriveFunction() : MathFunction("diff", 1, 3) { setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); setArgumentDefinition(3, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE)); setDefaultValue(3, "1"); } int DeriveFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { int i = vargs[2].number().intValue(); mstruct = vargs[0]; bool b = false; while(i) { if(!mstruct.differentiate(vargs[1], eo) && !b) { return 0; } b = true; i--; } return 1; } IntegrateFunction::IntegrateFunction() : MathFunction("integrate", 1, 4) { setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); setDefaultValue(3, "undefined"); setDefaultValue(4, "undefined"); } int IntegrateFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; if(!mstruct.integrate(vargs[1], eo)) { mstruct = vargs[0]; mstruct.eval(eo); if(mstruct == vargs[0]) { return 0; } MathStructure mstruct2(mstruct); if(!mstruct.integrate(vargs[1], eo)) { mstruct = mstruct2; return -1; } } if(vargs[2] != CALCULATOR->v_undef && vargs[2].print() != "undefined") { if(vargs[3] == CALCULATOR->v_undef || vargs[3].print() == "undefined") { CALCULATOR->error(true, _("Both the lower and upper limit must be set to get the definite integral."), NULL); return 0; } MathStructure mstruct_lower(mstruct); mstruct_lower.replace(vargs[1], vargs[2]); mstruct.replace(vargs[1], vargs[3]); mstruct -= mstruct_lower; } return 1; } SolveFunction::SolveFunction() : MathFunction("solve", 1, 2) { setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } bool is_comparison_structure(const MathStructure &mstruct, const MathStructure &xvar, bool *bce = NULL, bool do_bce_or = false); bool is_comparison_structure(const MathStructure &mstruct, const MathStructure &xvar, bool *bce, bool do_bce_or) { if(mstruct.isComparison()) { if(bce) *bce = mstruct.comparisonType() == COMPARISON_EQUALS && mstruct[0] == xvar; return true; } if(bce && do_bce_or && mstruct.isLogicalOr()) { *bce = true; for(size_t i = 0; i < mstruct.size(); i++) { bool bcei = false; if(!is_comparison_structure(mstruct[i], xvar, &bcei, false)) return false; if(!bcei) *bce = false; } return true; } if(bce) *bce = false; if(mstruct.isLogicalAnd()) { for(size_t i = 0; i < mstruct.size(); i++) { if(is_comparison_structure(mstruct[i], xvar)) return true; } return true; } else if(mstruct.isLogicalOr()) { for(size_t i = 0; i < mstruct.size(); i++) { if(!is_comparison_structure(mstruct[i], xvar)) return false; } return true; } return false; } MathStructure *solve_handle_logical_and(MathStructure &mstruct, MathStructure **mtruefor, ComparisonType ct, bool &b_partial, const MathStructure &vargs) { MathStructure *mcondition = NULL; for(size_t i2 = 0; i2 < mstruct.size(); ) { if(ct == COMPARISON_EQUALS) { if(mstruct[i2].isComparison() && ct == mstruct[i2].comparisonType() && mstruct[i2][0].contains(vargs[1])) { if(mstruct[i2][0] == vargs[1]) { if(mstruct.size() == 2) { if(i2 == 0) { mstruct[1].ref(); mcondition = &mstruct[1]; } else { mstruct[0].ref(); mcondition = &mstruct[0]; } } else { mcondition = new MathStructure(); mcondition->set_nocopy(mstruct); mcondition->delChild(i2 + 1); } mstruct.setToChild(i2 + 1, true); break; } else { b_partial = true; i2++; } } else { i2++; } } else { if(mstruct[i2].isComparison() && mstruct[i2][0].contains(vargs[1])) { i2++; } else { mstruct[i2].ref(); if(mcondition) { mcondition->add_nocopy(&mstruct[i2], OPERATION_LOGICAL_AND, true); } else { mcondition = &mstruct[i2]; } mstruct.delChild(i2 + 1); } } } if(ct == COMPARISON_EQUALS) { if(mstruct.isLogicalAnd()) { MathStructure *mtmp = new MathStructure(); mtmp->set_nocopy(mstruct); if(!(*mtruefor)) { *mtruefor = mtmp; } else { (*mtruefor)->add_nocopy(mtmp, OPERATION_LOGICAL_OR, true); } mstruct.clear(true); } } else { if(mstruct.size() == 1) { mstruct.setToChild(1, true); if(ct != COMPARISON_EQUALS) mstruct.setProtected(); } else if(mstruct.size() == 0) { mstruct.clear(true); if(!(*mtruefor)) { *mtruefor = mcondition; } else { (*mtruefor)->add_nocopy(mcondition, OPERATION_LOGICAL_OR, true); } mcondition = NULL; } else if(ct != COMPARISON_EQUALS) { for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i].setProtected(); } } } return mcondition; } int SolveFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { int itry = 0; int ierror = 0; int first_error = 0; Assumptions *assumptions = NULL; bool assumptions_added = false; AssumptionSign as = ASSUMPTION_SIGN_UNKNOWN; AssumptionType at = ASSUMPTION_TYPE_NONMATRIX; MathStructure msave; string strueforall; while(true) { if(itry == 1) { if(ierror == 1) { CALCULATOR->error(true, _("No equality or inequality to solve. The entered expression to solve is not correct (ex. \"x + 5 = 3\" is correct)"), NULL); return -1; } else { first_error = ierror; msave = mstruct; } } itry++; if(itry == 2) { if(vargs[1].isVariable() && vargs[1].variable()->subtype() == SUBTYPE_UNKNOWN_VARIABLE) { assumptions = ((UnknownVariable*) vargs[1].variable())->assumptions(); if(!assumptions) { assumptions = new Assumptions(); assumptions->setSign(CALCULATOR->defaultAssumptions()->sign()); assumptions->setType(CALCULATOR->defaultAssumptions()->type()); ((UnknownVariable*) vargs[1].variable())->setAssumptions(assumptions); assumptions_added = true; } } else { assumptions = CALCULATOR->defaultAssumptions(); } if(assumptions->sign() != ASSUMPTION_SIGN_UNKNOWN) { as = assumptions->sign(); assumptions->setSign(ASSUMPTION_SIGN_UNKNOWN); } else { itry++; } } if(itry == 3) { if(assumptions->type() > ASSUMPTION_TYPE_NONMATRIX) { at = assumptions->type(); assumptions->setType(ASSUMPTION_TYPE_NONMATRIX); as = assumptions->sign(); assumptions->setSign(ASSUMPTION_SIGN_UNKNOWN); } else { itry++; } } if(itry > 3) { if(as != ASSUMPTION_SIGN_UNKNOWN) assumptions->setSign(as); if(at > ASSUMPTION_TYPE_NONMATRIX) assumptions->setType(at); if(assumptions_added) ((UnknownVariable*) vargs[1].variable())->setAssumptions(NULL); switch(first_error) { case 2: { CALCULATOR->error(true, _("The comparison is true for all %s (with current assumptions)."), vargs[1].print().c_str(), NULL); break; } case 3: { CALCULATOR->error(true, _("No possible solution was found (with current assumptions)."), NULL); break; } case 4: { CALCULATOR->error(true, _("Was unable to completely isolate %s."), vargs[1].print().c_str(), NULL); break; } case 7: { CALCULATOR->error(false, _("The comparison is true for all %s if %s."), vargs[1].print().c_str(), strueforall.c_str(), NULL); break; } default: { CALCULATOR->error(true, _("Was unable to isolate %s."), vargs[1].print().c_str(), NULL); break; } } mstruct = msave; return -1; } ComparisonType ct; bool b = false; bool b_partial = false; if(vargs[0].isComparison()) { ct = vargs[0].comparisonType(); mstruct = vargs[0]; b = true; } else if(vargs[0].isLogicalAnd() && vargs[0].size() > 0 && vargs[0][0].isComparison()) { ct = vargs[0][0].comparisonType(); mstruct = vargs[0]; b = true; } else if(vargs[0].isVariable() && vargs[0].variable()->isKnown() && (eo.approximation != APPROXIMATION_EXACT || !vargs[0].variable()->isApproximate()) && ((KnownVariable*) vargs[0].variable())->get().isComparison()) { mstruct = ((KnownVariable*) vargs[0].variable())->get(); ct = vargs[0].comparisonType(); b = true; } else { EvaluationOptions eo2 = eo; eo2.test_comparisons = false; eo2.assume_denominators_nonzero = false; eo2.isolate_x = false; mstruct = vargs[0]; mstruct.eval(eo2); if(mstruct.isComparison()) { ct = mstruct.comparisonType(); b = true; } else if(mstruct.isLogicalAnd() && mstruct.size() > 0 && mstruct[0].isComparison()) { ct = mstruct[0].comparisonType(); b = true; } } if(!b) { ierror = 1; continue; } EvaluationOptions eo2 = eo; eo2.isolate_var = &vargs[1]; eo2.isolate_x = true; eo2.test_comparisons = true; mstruct.eval(eo2); if(mstruct.isOne()) { ierror = 2; continue; } else if(mstruct.isZero()) { ierror = 3; continue; } PrintOptions po; po.spell_out_logical_operators = true; if(mstruct.isComparison()) { if((ct == COMPARISON_EQUALS && mstruct.comparisonType() != COMPARISON_EQUALS) || !mstruct.contains(vargs[1])) { if(itry == 1) { mstruct.format(po); strueforall = mstruct.print(po); } ierror = 7; continue; } else if(ct == COMPARISON_EQUALS && mstruct[0] != vargs[1]) { ierror = 4; continue; } if(ct == COMPARISON_EQUALS) { mstruct.setToChild(2, true); } else { mstruct.setProtected(); } if(itry > 1) { assumptions->setSign(as); if(itry == 2) { CALCULATOR->error(false, _("Was unable to isolate %s with the current assumptions. The assumed sign was therefor temporarily set as unknown."), vargs[1].print().c_str(), NULL); } else if(itry == 3) { assumptions->setType(at); CALCULATOR->error(false, _("Was unable to isolate %s with the current assumptions. The assumed type and sign was therefor temporarily set as unknown."), vargs[1].print().c_str(), NULL); } if(assumptions_added) ((UnknownVariable*) vargs[1].variable())->setAssumptions(NULL); } return 1; } else if(mstruct.isLogicalAnd()) { MathStructure *mtruefor = NULL; bool b_partial; MathStructure mcopy(mstruct); MathStructure *mcondition = solve_handle_logical_and(mstruct, &mtruefor, ct, b_partial, vargs); if((!mstruct.isComparison() && !mstruct.isLogicalAnd()) || (ct == COMPARISON_EQUALS && (!mstruct.isComparison() || mstruct.comparisonType() != COMPARISON_EQUALS || mstruct[0] != vargs[1])) || !mstruct.contains(vargs[1])) { if(mtruefor) delete mtruefor; if(mcondition) delete mcondition; if(b_partial) { ierror = 4; } else { ierror = 5; } mstruct = mcopy; continue; } if(itry > 1) { assumptions->setSign(as); if(itry == 2) { CALCULATOR->error(false, _("Was unable to isolate %s with the current assumptions. The assumed sign was therefor temporarily set as unknown."), vargs[1].print().c_str(), NULL); } else if(itry == 3) { assumptions->setType(at); CALCULATOR->error(false, _("Was unable to isolate %s with the current assumptions. The assumed type and sign was therefor temporarily set as unknown."), vargs[1].print().c_str(), NULL); } if(assumptions_added) ((UnknownVariable*) vargs[1].variable())->setAssumptions(NULL); } if(mcondition) { mcondition->format(po); CALCULATOR->error(false, _("The solution requires that %s."), mcondition->print(po).c_str(), NULL); delete mcondition; } if(mtruefor) { mtruefor->format(po); CALCULATOR->error(false, _("The comparison is true for all %s if %s."), vargs[1].print().c_str(), mtruefor->print(po).c_str(), NULL); delete mtruefor; } if(ct == COMPARISON_EQUALS) mstruct.setToChild(2, true); return 1; } else if(mstruct.isLogicalOr()) { MathStructure mcopy(mstruct); MathStructure *mtruefor = NULL; vector mconditions; for(size_t i = 0; i < mstruct.size(); ) { MathStructure *mcondition = NULL; bool b_and = false; if(mstruct[i].isLogicalAnd()) { mcondition = solve_handle_logical_and(mstruct[i], &mtruefor, ct, b_partial, vargs); b_and = true; } if(!mstruct[i].isZero()) { for(size_t i2 = 0; i2 < i; i2++) { if(mstruct[i2] == mstruct[i]) { mstruct[i].clear(); if(mcondition && mconditions[i2]) { mconditions[i2]->add_nocopy(mcondition, OPERATION_LOGICAL_OR, true); } break; } } } bool b_del = false; if((!mstruct[i].isComparison() && !mstruct[i].isLogicalAnd()) || (ct == COMPARISON_EQUALS && (!mstruct[i].isComparison() || mstruct[i].comparisonType() != COMPARISON_EQUALS)) || !mstruct[i].contains(vargs[1])) { b_del = true; } else if(ct == COMPARISON_EQUALS && mstruct[i][0] != vargs[1]) { b_partial = true; b_del = true; } if(b_del) { if(!mstruct[i].isZero()) { mstruct[i].ref(); if(!mtruefor) { mtruefor = &mstruct[i]; } else { mtruefor->add_nocopy(&mstruct[i], OPERATION_LOGICAL_OR, true); } } mstruct.delChild(i + 1); } else { mconditions.push_back(mcondition); if(!b_and && ct != COMPARISON_EQUALS) mstruct[i].setProtected(); i++; } } if(ct == COMPARISON_EQUALS) { for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i].setToChild(2, true); } } if(mstruct.size() == 1) { mstruct.setToChild(1, true); } else if(mstruct.size() == 0) { if(mtruefor) delete mtruefor; if(b_partial) ierror = 4; else ierror = 5; mstruct = mcopy; continue; } else { mstruct.setType(STRUCT_VECTOR); } if(itry > 1) { assumptions->setSign(as); if(itry == 2) { CALCULATOR->error(false, _("Was unable to isolate %s with the current assumptions. The assumed sign was therefor temporarily set as unknown."), vargs[1].print().c_str(), NULL); } else if(itry == 3) { assumptions->setType(at); CALCULATOR->error(false, _("Was unable to isolate %s with the current assumptions. The assumed type and sign was therefor temporarily set as unknown."), vargs[1].print().c_str(), NULL); } if(assumptions_added) ((UnknownVariable*) vargs[1].variable())->setAssumptions(NULL); } if(mconditions.size() == 1) { if(mconditions[0]) { mconditions[0]->format(po); CALCULATOR->error(false, _("The solution requires that %s."), mconditions[0]->print(po).c_str(), NULL); delete mconditions[0]; } } else { string sconditions; for(size_t i = 0; i < mconditions.size(); i++) { if(mconditions[i]) { mconditions[i]->format(po); CALCULATOR->error(false, _("Solution %s requires that %s."), i2s(i + 1).c_str(), mconditions[i]->print(po).c_str(), NULL); delete mconditions[i]; } } } if(mtruefor) { mtruefor->format(po); CALCULATOR->error(false, _("The comparison is true for all %s if %s."), vargs[1].print().c_str(), mtruefor->print(po).c_str(), NULL); delete mtruefor; } return 1; } else { ierror = 6; } } return -1; } SolveMultipleFunction::SolveMultipleFunction() : MathFunction("multisolve", 2) { setArgumentDefinition(1, new VectorArgument()); VectorArgument *arg = new VectorArgument(); arg->addArgument(new SymbolicArgument()); arg->setReoccuringArguments(true); setArgumentDefinition(2, arg); setCondition("dimension(\\x)=dimension(\\y)"); } int SolveMultipleFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct.clearVector(); if(vargs[1].size() < 1) return 1; vector eleft; eleft.resize(vargs[0].size(), true); vector eorder; bool b = false; for(size_t i = 0; i < vargs[1].size(); i++) { b = false; for(size_t i2 = 0; i2 < vargs[0].size(); i2++) { if(eleft[i2] && vargs[0][i2].contains(vargs[1][i], true)) { eorder.push_back(i2); eleft[i2] = false; b = true; break; } } if(!b) { eorder.clear(); for(size_t i2 = 0; i2 < vargs[0].size(); i2++) { eorder.push_back(i2); } break; } } for(size_t i = 0; i < eorder.size(); i++) { MathStructure msolve(vargs[0][eorder[i]]); EvaluationOptions eo2 = eo; eo2.isolate_var = &vargs[1][i]; for(size_t i2 = 0; i2 < i; i2++) { msolve.replace(vargs[1][i2], mstruct[i2]); } msolve.eval(eo2); if(msolve.isComparison()) { if(msolve[0] != vargs[1][i]) { if(!b) { CALCULATOR->error(true, _("Unable to isolate %s.\n\nYou might need to place the equations and variables in an appropriate order so that so that each equation at least contains the corresponding variable (if automatic reordering failed)."), vargs[1][i].print().c_str(), NULL); } else { CALCULATOR->error(true, _("Unable to isolate %s."), vargs[1][i].print().c_str(), NULL); } return 0; } else { if(msolve.comparisonType() == COMPARISON_EQUALS) { mstruct.addChild(msolve[1]); } else { CALCULATOR->error(true, _("Inequalities is not allowed in %s()."), preferredName().name.c_str(), NULL); return 0; } } } else if(msolve.isLogicalOr()) { for(size_t i2 = 0; i2 < msolve.size(); i2++) { if(!msolve[i2].isComparison() || msolve[i2].comparisonType() != COMPARISON_EQUALS || msolve[i2][0] != vargs[1][i]) { CALCULATOR->error(true, _("Unable to isolate %s."), vargs[1][i].print().c_str(), NULL); return 0; } else { msolve[i2].setToChild(2, true); } } msolve.setType(STRUCT_VECTOR); mstruct.addChild(msolve); } else { CALCULATOR->error(true, _("Unable to isolate %s."), vargs[1][i].print().c_str(), NULL); return 0; } for(size_t i2 = 0; i2 < i; i2++) { for(size_t i3 = 0; i3 <= i; i3++) { if(i2 != i3) { mstruct[i2].replace(vargs[1][i3], mstruct[i3]); } } } } return 1; } UncertaintyFunction::UncertaintyFunction() : MathFunction("uncertainty", 2) { } int UncertaintyFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.setUncertainty(vargs[1]); return 1; } libqalculate-0.9.7/libqalculate/includes.h0000644000175100017510000006210111305546372015543 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #ifndef INCLUDES_H #define INCLUDES_H /** @file */ /// \cond using namespace std; /// \endcond #include #include #include #include #include #include #include #include #include #include #include #include #ifdef __GNUC__ # if __GNUC__ < 3 # include namespace Sgi { using ::hash_map; }; // inherit globals # else # include # if __GNUC__ == 3 && __GNUC_MINOR__ == 0 namespace Sgi = std; // GCC 3.0 # else namespace Sgi = ::__gnu_cxx; // GCC 3.1 and later # endif # endif #else // ... there are other compilers, right? namespace Sgi = std; #endif static string empty_string; struct ExpressionName; class Calculator; class MathStructure; class Manager; class Unit; class Variable; class KnownVariable; class UnknownVariable; class Assumptions; class DynamicVariable; class ExpressionItem; class Number; class Prefix; class DecimalPrefix; class BinaryPrefix; class NumberPrefix; class CompositeUnit; class AliasUnit; class AliasUnit_Composite; class MathFunction; class Matrix; class Vector; class UserFunction; class EqItem; class EqNumber; class EqContainer; class Argument; class DataSet; class DataProperty; class DataObject; /// Type of ExpressionItem typedef enum { /// class Variable TYPE_VARIABLE, /// class MathFunction TYPE_FUNCTION, /// class Unit TYPE_UNIT } ExpressionItemType; #define COMPARISON_MIGHT_BE_LESS_OR_GREATER(i) (i == COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_NOT_EQUAL) #define COMPARISON_NOT_FULLY_KNOWN(i) (i == COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_NOT_EQUAL || i == COMPARISON_RESULT_EQUAL_OR_LESS || i == COMPARISON_RESULT_EQUAL_OR_GREATER) #define COMPARISON_IS_EQUAL_OR_GREATER(i) (i == COMPARISON_RESULT_EQUAL || i == COMPARISON_RESULT_GREATER || i == COMPARISON_RESULT_EQUAL_OR_GREATER) #define COMPARISON_IS_EQUAL_OR_LESS(i) (i == COMPARISON_RESULT_EQUAL || i == COMPARISON_RESULT_LESS || i == COMPARISON_RESULT_EQUAL_OR_LESS) #define COMPARISON_IS_NOT_EQUAL(i) (i == COMPARISON_RESULT_NOT_EQUAL || i == COMPARISON_RESULT_LESS || i == COMPARISON_RESULT_GREATER) #define COMPARISON_MIGHT_BE_EQUAL(i) (i == COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_EQUAL_OR_LESS || i == COMPARISON_RESULT_EQUAL_OR_GREATER) #define COMPARISON_MIGHT_BE_NOT_EQUAL(i) (i == COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_EQUAL_OR_LESS || i == COMPARISON_RESULT_EQUAL_OR_GREATER) #define NR_OF_PRIMES 174 static const int PRIMES[] = { 2, 3, 5, 7, 11, 13, 17, 19, 21, 23, 29, 31, 37, 41, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013 }; #define SQP_LT_1000 11 #define SQP_LT_2000 17 #define SQP_LT_10000 28 #define SQP_LT_25000 40 #define SQP_LT_100000 68 static const int SQUARE_PRIMES[] = { 4, 9, 25, 49, 121, 169, 289, 361, 441, 529, 841, 961, 1369, 1681, 961, 1369, 1681, 1849, 2209, 2809, 3481, 3721, 4489, 5041, 5329, 6241, 6889, 7921, 9409, 10201, 10609, 11449, 11881, 12769, 16129, 17161, 18769, 19321, 22201, 22801, 24649, 26569, 27889, 29929, 32041, 32761, 36481, 37249, 38809, 39601, 44521, 49729, 51529, 52441, 54289, 57121, 58081, 63001, 66049, 69169, 72361, 73441, 76729, 78961, 80089, 85849, 94249, 96721, 97969, 100489, 109561, 113569, 120409, 121801, 124609, 128881, 134689, 139129, 143641, 146689, 151321, 157609, 160801, 167281, 175561, 177241, 185761, 187489, 192721, 196249, 201601, 208849, 212521, 214369, 218089, 229441, 237169, 241081, 249001, 253009, 259081, 271441, 273529, 292681, 299209, 310249, 316969, 323761, 326041, 332929, 344569, 351649, 358801, 361201, 368449, 375769, 380689, 383161, 398161, 410881, 413449, 418609, 426409, 434281, 436921, 452929, 458329, 466489, 477481, 491401, 502681, 516961, 528529, 537289, 546121, 552049, 564001, 573049, 579121, 591361, 597529, 619369, 635209, 654481, 657721, 674041, 677329, 683929, 687241, 703921, 727609, 734449, 737881, 744769, 769129, 776161, 779689, 786769, 822649, 829921, 844561, 863041, 877969, 885481, 896809, 908209, 935089, 942841, 954529, 966289, 982081, 994009, 1018081, 1026169 }; /// The result of a comparison of two values typedef enum { COMPARISON_RESULT_EQUAL, COMPARISON_RESULT_GREATER, COMPARISON_RESULT_LESS, COMPARISON_RESULT_EQUAL_OR_GREATER, COMPARISON_RESULT_EQUAL_OR_LESS, COMPARISON_RESULT_NOT_EQUAL, COMPARISON_RESULT_UNKNOWN } ComparisonResult; /// Placement of legend typedef enum { PLOT_LEGEND_NONE, PLOT_LEGEND_TOP_LEFT, PLOT_LEGEND_TOP_RIGHT, PLOT_LEGEND_BOTTOM_LEFT, PLOT_LEGEND_BOTTOM_RIGHT, PLOT_LEGEND_BELOW, PLOT_LEGEND_OUTSIDE } PlotLegendPlacement; /// Plot type/style typedef enum { PLOT_STYLE_LINES, PLOT_STYLE_POINTS, PLOT_STYLE_POINTS_LINES, PLOT_STYLE_BOXES, PLOT_STYLE_HISTOGRAM, PLOT_STYLE_STEPS, PLOT_STYLE_CANDLESTICKS, PLOT_STYLE_DOTS } PlotStyle; /// Smoothing a plotted lines typedef enum { PLOT_SMOOTHING_NONE, PLOT_SMOOTHING_UNIQUE, PLOT_SMOOTHING_CSPLINES, PLOT_SMOOTHING_BEZIER, PLOT_SMOOTHING_SBEZIER } PlotSmoothing; /// File type for saving plot to image typedef enum { PLOT_FILETYPE_AUTO, PLOT_FILETYPE_PNG, PLOT_FILETYPE_PS, PLOT_FILETYPE_EPS, PLOT_FILETYPE_LATEX, PLOT_FILETYPE_SVG, PLOT_FILETYPE_FIG } PlotFileType; /// Mathematical operations typedef enum { OPERATION_MULTIPLY, OPERATION_DIVIDE, OPERATION_ADD, OPERATION_SUBTRACT, OPERATION_RAISE, OPERATION_EXP10, OPERATION_LOGICAL_AND, OPERATION_LOGICAL_OR, OPERATION_LOGICAL_XOR, OPERATION_BITWISE_AND, OPERATION_BITWISE_OR, OPERATION_BITWISE_XOR, OPERATION_LESS, OPERATION_GREATER, OPERATION_EQUALS_LESS, OPERATION_EQUALS_GREATER, OPERATION_EQUALS, OPERATION_NOT_EQUALS } MathOperation; /// Comparison signs for comparison structures typedef enum { COMPARISON_LESS, COMPARISON_GREATER, COMPARISON_EQUALS_LESS, COMPARISON_EQUALS_GREATER, COMPARISON_EQUALS, COMPARISON_NOT_EQUALS } ComparisonType; typedef enum { SORT_DEFAULT = 1 << 0, SORT_SCIENTIFIC = 1 << 1 } SortFlags; #define BASE_ROMAN_NUMERALS -1 #define BASE_TIME -2 #define BASE_BINARY 2 #define BASE_OCTAL 8 #define BASE_DECIMAL 10 #define BASE_HEXADECIMAL 16 #define BASE_SEXAGESIMAL 60 #define EXP_BASE_3 -3 #define EXP_PRECISION -1 #define EXP_NONE 0 #define EXP_PURE 1 #define EXP_SCIENTIFIC 3 typedef enum { /// Display numbers in decimal, not fractional, format (ex. 0.333333) FRACTION_DECIMAL, /// Display as fraction if necessary to get an exact display of the result (ex. 1/3, but 0.25) FRACTION_DECIMAL_EXACT, /// Display as fraction (ex. 4/3) FRACTION_FRACTIONAL, /// Display as an integer and a fraction (ex. 3 + 1/2) FRACTION_COMBINED } NumberFractionFormat; /// Options for ordering the parts of a mathematical expression/result before display static const struct SortOptions { /// Put currency units before quantity. Default: true bool prefix_currencies; /// If true, avoid placing negative terms first. Default: true bool minus_last; SortOptions() : prefix_currencies(true), minus_last(true) {} } default_sort_options; typedef enum { MULTIPLICATION_SIGN_ASTERISK, MULTIPLICATION_SIGN_DOT, MULTIPLICATION_SIGN_X } MultiplicationSign; typedef enum { DIVISION_SIGN_SLASH, DIVISION_SIGN_DIVISION_SLASH, DIVISION_SIGN_DIVISION } DivisionSign; typedef enum { BASE_DISPLAY_NONE, BASE_DISPLAY_NORMAL, BASE_DISPLAY_ALTERNATIVE } BaseDisplay; /// Options for formatting and display of mathematical structures/results. static const struct PrintOptions { int min_exp; /// Number base for displaying numbers. Default: 10 int base; /// How prefixes for numbers in non-decimal bases will be displayed BaseDisplay base_display; /// Use lower case for non-numeric characters for bases > 10. Default: false bool lower_case_numbers; /// Use lower case e for base-10 exponent (ex. 1.2e8 instead of 1.2E8). Default: false bool lower_case_e; /// If rational numbers will be displayed with decimals, as a fraction, or something in between. Default: FRACTION_DECIMAL NumberFractionFormat number_fraction_format; /// Show that the digit series of a number continues forever with three dots, instead of rounding (ex. 2/3 displays as 0.666666... instead of 0.666667). Default: false bool indicate_infinite_series; /// Show ending zeroes for approximate numbers to indicate precision (ex.1.2300000 instead of 1.23) . Default: false bool show_ending_zeroes; /// Prefer abbreviated names of variables, units, functions etc. Default: true bool abbreviate_names; /// Prefer reference names of variables, units, functions etc. Default: false bool use_reference_names; /// Isolate units at the end of the displayed expression (ex. x/y m/s instead of (x m)/(y s)). Default: true bool place_units_separately; /// Use prefixes for units when appropriate. Default: true bool use_unit_prefixes; /// Use prefixes for currencies if unit prefixes are om. Default: false bool use_prefixes_for_currencies; /// Use all decimal SI prefixes. If false, prefixes which is not a multiple of thousand (centi, deci, deka, hekto) will not be used automatically. Default: false bool use_all_prefixes; /// If set to true, prefixes will be split between numerator and denominator in a unit expression (millimeter per kilogram instead of micrometer per gram). Default: true bool use_denominator_prefix; /// If true, negative exponents will be used instead of division (ex. 5/x^2 becomes 5*x^-2). Default: false bool negative_exponents; /// Avoid using multiplication sign, when appropriate. Default: true bool short_multiplication; /// Use a format compatible with ParseOptions::limit_implicit_multiplication. Default: false bool limit_implicit_multiplication; /// If it is not necessary that the displayed expression can be parsed correctly. Default: false bool allow_non_usable; /// If unicode signs can be displayed. Default: false bool use_unicode_signs; /// Sign used for display of multiplication. Default: MULTIPLICATION_SIGN_DOT MultiplicationSign multiplication_sign; /// Sign used for display of division. Default: DIVISION_SIGN_DIVISION_SLASH DivisionSign division_sign; /// If space will be used to make the output look nicer. Default: true bool spacious; /// Use parentheses even when not necessary. Default: false bool excessive_parenthesis; /// Transform raised to 1/2 to square root function. Default: true bool halfexp_to_sqrt; /// Minimum number of decimals to display for numbers. Default: 0 int min_decimals; /// Maximum number of decimals to display for numbers. A negative value disables the limit. Default: -1 int max_decimals; /// Enable use of min_decimals. False is equivalent to a min_decimals value of zero. Default: true bool use_min_decimals; /// Enable use of max_decimals. False is equivalent to a negative max_decimals value. Default: true bool use_max_decimals; /// If true round halfway numbers to nearest even number, otherwise round upwards. Default: false bool round_halfway_to_even; /// Multiply numerator and denominator to get integers (ex. (6x+y)/2z instead of (3x+0.5y)/z). Default: true bool improve_division_multipliers; /// Force use of a specific prefix for units if not NULL. Default: NULL Prefix *prefix; /// If not NULL will be set to true if the output is approximate. Default: NULL bool *is_approximate; /// Options for the order of values in the displayed expression. Default: default_sort_options SortOptions sort_options; /// Comma sign or empty string to use default comma sign. Default: empty string string comma_sign; /// Decimal sign or empty string to use default decimal sign. Default: empty string string decimalpoint_sign; /// Function that returns true if a text string with unicode signs can be properly displayed. Default: NULL bool (*can_display_unicode_string_function) (const char*, void*); /// Argument passed to can_display_unicode_string_function. Default: NULL void *can_display_unicode_string_arg; /// Replace underscores in names with spaces, unless name has suffix. Default: false bool hide_underscore_spaces; /// Preserves the format of the structure (no sorting, no changed prefixes, no improved division multipliers, etc.). Default: false bool preserve_format; /// Allows factorization to occur in the output (should be set to true if the structure has been factorized). Default: false bool allow_factorization; /// If logical operators will be spelled as AND and OR instead of && and ||. Default: false bool spell_out_logical_operators; /// Displays children of the structure with no higher precision than the parent. Default: true bool restrict_to_parent_precision; PrintOptions() : min_exp(EXP_PRECISION), base(BASE_DECIMAL), lower_case_numbers(false), lower_case_e(false), number_fraction_format(FRACTION_DECIMAL), indicate_infinite_series(false), show_ending_zeroes(false), abbreviate_names(true), use_reference_names(false), place_units_separately(true), use_unit_prefixes(true), use_prefixes_for_currencies(false), use_all_prefixes(false), use_denominator_prefix(true), negative_exponents(false), short_multiplication(true), limit_implicit_multiplication(false), allow_non_usable(false), use_unicode_signs(false), multiplication_sign(MULTIPLICATION_SIGN_DOT), division_sign(DIVISION_SIGN_DIVISION_SLASH), spacious(true), excessive_parenthesis(false), halfexp_to_sqrt(true), min_decimals(0), max_decimals(-1), use_min_decimals(true), use_max_decimals(true), round_halfway_to_even(false), improve_division_multipliers(true), prefix(NULL), is_approximate(NULL), can_display_unicode_string_function(NULL), can_display_unicode_string_arg(NULL), hide_underscore_spaces(false), preserve_format(false), allow_factorization(false), spell_out_logical_operators(false), restrict_to_parent_precision(true) {} /// Returns the comma sign used (default sign or comma_sign) const string &comma() const; /// Returns the decimal sign used (default sign or decimalpoint_sign) const string &decimalpoint() const; } default_print_options; static const struct InternalPrintStruct { int depth, power_depth, division_depth; bool wrap; string *num, *den, *re, *im, *exp; bool *minus, *exp_minus; bool parent_approximate; int parent_precision; InternalPrintStruct() : depth(0), power_depth(0), division_depth(0), wrap(false), num(NULL), den(NULL), re(NULL), im(NULL), exp(NULL), minus(NULL), exp_minus(NULL), parent_approximate(false), parent_precision(-1) {} } top_ips; typedef enum { /// Allow only exact results APPROXIMATION_EXACT, /// Try to make the result as exact as possible APPROXIMATION_TRY_EXACT, /// Calculate the result approximately directly APPROXIMATION_APPROXIMATE } ApproximationMode; typedef enum { /// Do not do any factorization or additional simplifications STRUCTURING_NONE, /// Simplify the result as much as possible STRUCTURING_SIMPLIFY, /// Factorize the result STRUCTURING_FACTORIZE } StructuringMode; typedef enum { /// Do not do any conversion of units in addition to syncing POST_CONVERSION_NONE, /// Convert to the best suited SI units (the least amount of units) POST_CONVERSION_BEST, /// Convert to base units POST_CONVERSION_BASE } AutoPostConversion; typedef enum { DONT_READ_PRECISION, ALWAYS_READ_PRECISION, READ_PRECISION_WHEN_DECIMALS } ReadPrecisionMode; typedef enum { ANGLE_UNIT_NONE, ANGLE_UNIT_RADIANS, ANGLE_UNIT_DEGREES, ANGLE_UNIT_GRADIANS } AngleUnit; /// Options for parsing expressions. static const struct ParseOptions { /// If variables will be parsed. Default: true bool variables_enabled; /// If functions will be parsed. Default: true bool functions_enabled; /// If left-over characters will be parsed as symbols. Default: true bool unknowns_enabled; /// If units will be parsed. Default: true bool units_enabled; /// If Reverse Polish Notation syntax will be used. Default: false bool rpn; /// Base of parsed numbers. Default: 10 int base; /// When implicit multiplication is limited variables, functions and units must be separated by a space, operator or parenthesis ("xy" does not equal "x * y"). Default: false /** * If the limit implicit multiplication mode is activated, the use of implicite multiplication when parsing expressions and displaying results will be limited to avoid confusion. For example, if this mode is not activated and "integrte(5x)" is accidently typed instead of "integrate(5x)", the expression is interpreted as "int(e * e * (5 * x) * gr * t)". If limit implicit multiplication is turned on to mistyped expression would instead show an error telling that "integrte" is not a valid variable, function or unit (unless unknowns is not enabled in which case the result will be "5 'integrate' * x". */ bool limit_implicit_multiplication; /// If and when precisions will be read from number of digits in a number. Default: DONT_READ_PRECISION ReadPrecisionMode read_precision; /// If true. dots will ignored if another character is the default decimal sign, to allow dots to be used as thousand separator. Default: false bool dot_as_separator; ///Interpret square brackets equally to parentheses (not only for vectors/matrices). Default; false bool brackets_as_parentheses; /// Default angle unit for trigonometric functions. Default: ANGLE_UNIT_NONE AngleUnit angle_unit; /// If non-NULL will be set to unfinished function at the end of the expression (if there is one). Default: NULL MathStructure *unended_function; /// Preserve the expression structure as much as possible. Default: false bool preserve_format; /// Defaukt dataset. Used for object.property syntax without a preceeding data set. Default: NULL DataSet *default_dataset; ParseOptions() : variables_enabled(true), functions_enabled(true), unknowns_enabled(true), units_enabled(true), rpn(false), base(BASE_DECIMAL), limit_implicit_multiplication(false), read_precision(DONT_READ_PRECISION), dot_as_separator(false), brackets_as_parentheses(false), angle_unit(ANGLE_UNIT_NONE), unended_function(NULL), preserve_format(false), default_dataset(NULL) {} } default_parse_options; /// Options for calculation. static const struct EvaluationOptions { /// How exact the result must be. Default: TRY_EXACT ApproximationMode approximation; /// If units will be synced/converted to allow evaluation (ex. 1 min + 1 s=60 s+ 1 s = 61 s). Default: true bool sync_units; /// If units with complex/non-linear relations (ex. degress celsius and fahrenheit) will synced/converted. Default: true bool sync_complex_unit_relations; /// If unit prefixes in original expression will be kept. Default: false bool keep_prefixes; /// If known variables will be replaced by their value. Default: true bool calculate_variables; /// If functions will be calculated. Default: true bool calculate_functions; /// If comparisons will be evaluated (ex. 5>2 => 1). Default: true bool test_comparisons; /// If a varaible will be isolated to the left side in equations/comparisons (ex. x+y=2 => x=2-y). Default: true bool isolate_x; /// If factors (and bases) containing addition will be expanded (ex. z(x+y)=zx+zy). Default: true bool expand; /// If non-numerical parts of a fraction will be reduced (ex. (5x)/(3xy) =5/(3y) . Default: true bool reduce_divisions; /// If complex numbers will be used for evaluation. Default: true bool allow_complex; /// If infinite numbers will be used for evaluation. Default: true bool allow_infinite; /// If simplification will be made easier by assuming that denominators with unknown value not is zero. Default: false bool assume_denominators_nonzero; /// Warn if a denominator with unknown value was assumed non-zero (with assume_denominators_nonzero set to true) to allow simplification. Default: false bool warn_about_denominators_assumed_nonzero; /// If powers with exponent 1/2 that only have an approximate result will be split to the least base (sqrt(8) = 2 * sqrt(2)). Default: true bool split_squares; /// If units with zero quantity will be preserved. Default: true bool keep_zero_units; /// If and how units will be automatically converted. Does not affect syncing of units. Default: POST_CONVERSION_NONE AutoPostConversion auto_post_conversion; /// If the evaluation result will be simplified or factorized StructuringMode structuring; /// Options for parsing of expression. Default: default_parse_options ParseOptions parse_options; /// If set will decide which variable to isolate in an equation. Default: NULL const MathStructure *isolate_var; EvaluationOptions() : approximation(APPROXIMATION_TRY_EXACT), sync_units(true), sync_complex_unit_relations(true), keep_prefixes(false), calculate_variables(true), calculate_functions(true), test_comparisons(true), isolate_x(true), expand(true), reduce_divisions(true), allow_complex(true), allow_infinite(true), assume_denominators_nonzero(false), warn_about_denominators_assumed_nonzero(false), split_squares(true), keep_zero_units(true), auto_post_conversion(POST_CONVERSION_NONE), structuring(STRUCTURING_SIMPLIFY), isolate_var(NULL) {} } default_evaluation_options; extern MathStructure m_undefined, m_empty_vector, m_empty_matrix, m_zero, m_one, m_minus_one; extern Number nr_zero, nr_one, nr_minus_one; extern EvaluationOptions no_evaluation; extern ExpressionName empty_expression_name; extern Calculator *calculator; #define CALCULATOR calculator #define DEFAULT_PRECISION 8 #define PRECISION CALCULATOR->getPrecision() #define SIGN_POWER_0 "°" #define SIGN_POWER_1 "¹" #define SIGN_POWER_2 "²" #define SIGN_POWER_3 "³" #define SIGN_EURO "€" #define SIGN_POUND "£" #define SIGN_CENT "¢" #define SIGN_YEN "¥" #define SIGN_MICRO "µ" #define SIGN_PI "π" #define SIGN_MULTIPLICATION "×" #define SIGN_MULTIDOT "⋅" #define SIGN_MULTIBULLET "∙" #define SIGN_SMALLCIRCLE "•" #define SIGN_DIVISION_SLASH "∕" #define SIGN_DIVISION "÷" #define SIGN_MINUS "−" #define SIGN_PLUS "+" #define SIGN_SQRT "√" #define SIGN_ALMOST_EQUAL "≈" #define SIGN_APPROXIMATELY_EQUAL "≅" #define SIGN_ZETA "ζ" #define SIGN_GAMMA "γ" #define SIGN_PHI "φ" #define SIGN_LESS_OR_EQUAL "≤" #define SIGN_GREATER_OR_EQUAL "≥" #define SIGN_NOT_EQUAL "≠" #define SIGN_CAPITAL_SIGMA "Σ" #define SIGN_CAPITAL_PI "Π" #define SIGN_CAPITAL_OMEGA "Ω" #define SIGN_CAPITAL_GAMMA "Γ" #define SIGN_CAPITAL_BETA "Β" #define SIGN_INFINITY "∞" #define SIGN_PLUSMINUS "±" #define ID_WRAP_LEFT_CH '{' #define ID_WRAP_RIGHT_CH '}' #define DOT_CH '.' #define ZERO_CH '0' #define ONE_CH '1' #define TWO_CH '2' #define THREE_CH '3' #define FOUR_CH '4' #define FIVE_CH '5' #define SIX_CH '6' #define SEVEN_CH '7' #define EIGHT_CH '8' #define NINE_CH '9' #define PLUS_CH '+' #define MINUS_CH '-' #define MULTIPLICATION_CH '*' #define MULTIPLICATION_2_CH ' ' #define DIVISION_CH '/' #define EXP_CH 'E' #define EXP2_CH 'e' #define POWER_CH '^' #define SPACE_CH ' ' #define LEFT_PARENTHESIS_CH '(' #define RIGHT_PARENTHESIS_CH ')' #define LEFT_VECTOR_WRAP_CH '[' #define RIGHT_VECTOR_WRAP_CH ']' #define FUNCTION_VAR_PRE_CH '\\' #define COMMA_CH ',' #define NAME_NUMBER_PRE_CH '_' #define UNIT_DIVISION_CH '/' #define AND_CH '&' #define OR_CH '|' #define LESS_CH '<' #define GREATER_CH '>' #define BITWISE_NOT_CH '~' #define LOGICAL_NOT_CH '!' #define NOT_CH '!' #define EQUALS_CH '=' #define ID_WRAP_LEFT "{" #define ID_WRAP_RIGHT "}" #define ID_WRAPS "{}" #define DOT "." #define SEXADOT ":" #define COMMA "," #define COMMAS ",;" #define NUMBERS "0123456789" #define NUMBER_ELEMENTS "0123456789.:" #define SIGNS "+-*/^" #define OPERATORS "~+-*/^&|!<>=" #define PARENTHESISS "()" #define LEFT_PARENTHESIS "(" #define RIGHT_PARENTHESIS ")" #define VECTOR_WRAPS "[]" #define LEFT_VECTOR_WRAP "[" #define RIGHT_VECTOR_WRAP "]" #define SPACES " \t\n" #define SPACE " " #define RESERVED "\'@?\\{}\"" #define PLUS "+" #define MINUS "-" #define MULTIPLICATION "*" #define MULTIPLICATION_2 " " #define DIVISION "/" #define EXP "E" #define EXPS "Ee" #define POWER "^" #define LOGICAL_AND "&&" #define LOGICAL_OR "||" #define LOGICAL_NOT "!" #define BITWISE_AND "&" #define BITWISE_OR "|" #define BITWISE_NOT "~" #define SHIFT_RIGHT ">>" #define SHIFT_LEFT "<<" #define LESS "<" #define GREATER ">" #define NOT "!" #define EQUALS "=" #define SINF "INF" #define SNAN "NAN" #define UNDERSCORE "_" #define NOT_IN_NAMES RESERVED OPERATORS SPACES SEXADOT DOT VECTOR_WRAPS PARENTHESISS COMMAS #endif libqalculate-0.9.7/libqalculate/qalculate.h0000644000175100017510000000146511305546373015717 00000000000000/* Qalculate Copyright (C) 2003-2005 Niklas Knutsson (nq@altern.org) 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. */ #ifndef QALCULATE_H #define QALCULATE_H #include #include #include #include #include #include #include #include #include #include #include #include #endif libqalculate-0.9.7/libqalculate/DataSet.h0000644000175100017510000002351711305546372015272 00000000000000/* Qalculate Copyright (C) 2004-2006 Niklas Knutsson (nq@altern.org) 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. */ #ifndef DATA_SET_H #define DATA_SET_H #include #include /** @file */ typedef Sgi::vector::iterator DataObjectPropertyIter; /// A a data set object. /** Data objects consist of property-value pairs. */ class DataObject { protected: vector properties; vector s_properties; vector s_nonlocalized_properties; vector m_properties; vector a_properties; DataSet *parent; bool b_uchanged; public: /** Create a data object. * * @param parent_set Data set that the object will belong to. */ DataObject(DataSet *parent_set); /** Unset (erase value) a property. * * @param property Property to unset. */ void eraseProperty(DataProperty *property); /** Set value for a property. * * @param property Property to set (must belong to parent data set). * @param s_vale Value for the property. * @param is_approximate If the value is approximate. 1 for approximate, 0 for exact, -1 for property default. */ void setProperty(DataProperty *property, string s_value, int is_approximate = -1); /** Set an untranslated value for a key property. Used when a text value is translated, but the original value still is needed as a reference key. * * @param property Property to set (must belong to parent data set). * @param s_vale Value for the property. */ void setNonlocalizedKeyProperty(DataProperty *property, string s_value); /** Returns parsed value for a property. Parses the text string value if not parsed before * * @param property Property to read. * @returns Parsed value or NULL if property value is not set. */ const MathStructure *getPropertyStruct(DataProperty *property); /** Returns unparsed value for a property. * * @param property Property to read. * @param[out] is_approximate If the value is approximate. Is set to 1 for approximate, 0 for exact, -1 for property default, if not NULL. * @returns Unparsed value or empty string if property value is not set. */ const string &getProperty(DataProperty *property, int *is_approximate = NULL); /** Returns unparsed untranslated value for a key property. Used when a text value is translated, but the original value still is needed as a reference key. * * @param property Property to read. * @returns Unparsed untranslated value or empty string if property value is not set. */ const string &getNonlocalizedKeyProperty(DataProperty *property); /** Returns value for a property in a format suitable for use in expressions with unit appended. * * @param property Property to read. * @returns Value in input format or empty string if property value is not set. */ string getPropertyInputString(DataProperty *property); /** Returns value for a property in a format suitable for display with unit appended. * * @param property Property to read. * @returns Value in display format or empty string if property value is not set. */ string getPropertyDisplayString(DataProperty *property); /** If the object has been modified by the end user (if setUserModified() has been called). * * @returns true if the object has been modified by the user. */ bool isUserModified() const; /** Specify if the object has been modified by the end user. * * @param user_modified true if the object has been modified by the user. */ void setUserModified(bool user_modified = true); /** Returns the data set that the object belongs to. * * @returns Parent data set. */ DataSet *parentSet() const; }; typedef enum { PROPERTY_EXPRESSION, PROPERTY_NUMBER, PROPERTY_STRING } PropertyType; /// A data set property. /** Property definitions for use with data set objects. */ class DataProperty { protected: vector names; vector name_is_ref; string sdescr, stitle, sunit; MathStructure *m_unit; bool b_approximate, b_brackets, b_key, b_case, b_hide; DataSet *parent; PropertyType ptype; bool b_uchanged; public: /** Create a data property. * * @param s_name Property name (initial) used for reference. * @param s_title Descriptive name/title. * @param s_description Description. */ DataProperty(DataSet *parent_set, string s_name = "", string s_title = "", string s_description = ""); DataProperty(const DataProperty &dp); void set(const DataProperty &dp); void setName(string s_name, bool is_ref = false); void setNameIsReference(size_t index = 1, bool is_ref = true); bool nameIsReference(size_t index = 1) const; void clearNames(); void addName(string s_name, bool is_ref = false, size_t index = 0); size_t hasName(const string &s_name); size_t countNames() const; const string &getName(size_t index = 1) const; const string &getReferenceName() const; void setTitle(string s_title); const string &title(bool return_name_if_no_title = true) const; void setDescription(string s_description); const string &description() const; void setUnit(string s_unit); const string &getUnitString() const; const MathStructure *getUnitStruct(); string getInputString(const string &valuestr); string getDisplayString(const string &valuestr); MathStructure *generateStruct(const string &valuestr, int is_approximate = -1); void setKey(bool is_key = true); bool isKey() const; void setHidden(bool is_hidden = true); bool isHidden() const; void setCaseSensitive(bool is_case_sensitive = true); bool isCaseSensitive() const; void setUsesBrackets(bool uses_brackets = true); bool usesBrackets() const; void setApproximate(bool is_approximate = true); bool isApproximate() const; void setPropertyType(PropertyType property_type); PropertyType propertyType() const; bool isUserModified() const; void setUserModified(bool user_modified = true); DataSet *parentSet() const; }; typedef vector::iterator DataPropertyIter; typedef vector::iterator DataObjectIter; /// A data set. /** This is a simple database class for storage of many grouped values, when ordinary variables is not practical. * * A data set consists of properties and objects, with values for the properties. Qalculate! includes for example a "Planets" data set with properties such as name, mass, speed and density, and an object for each planet in solar system. * * A data set is also mathemtical function, dataset(object, property), which retrieves values for objects and properties. * Data sets can be saved and loaded from a XML file. */ class DataSet : public MathFunction { protected: string sfile, scopyright; bool b_loaded; vector properties; vector objects; public: DataSet(string s_category = "", string s_name = "", string s_default_file = "", string s_title = "", string s_description = "", bool is_local = true); DataSet(const DataSet *o); ExpressionItem *copy() const; void set(const ExpressionItem *item); int subtype() const; void setCopyright(string s_copyright); const string ©right() const; void setDefaultDataFile(string s_file); const string &defaultDataFile() const; void setDefaultProperty(string property); const string &defaultProperty() const; virtual int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); bool loadObjects(const char *file_name = NULL, bool is_user_defs = true); int saveObjects(const char *file_name = NULL, bool save_global = false); bool objectsLoaded() const; void setObjectsLoaded(bool objects_loaded); void addProperty(DataProperty *dp); void delProperty(DataProperty *dp); void delProperty(DataPropertyIter *it); DataProperty *getPrimaryKeyProperty(); DataProperty *getProperty(string property); DataProperty *getFirstProperty(DataPropertyIter *it); DataProperty *getNextProperty(DataPropertyIter *it); const string &getFirstPropertyName(DataPropertyIter *it); const string &getNextPropertyName(DataPropertyIter *it); void addObject(DataObject *o); void delObject(DataObject *o); void delObject(DataObjectIter *it); DataObject *getObject(string object); DataObject *getObject(const MathStructure &object); DataObject *getFirstObject(DataObjectIter *it); DataObject *getNextObject(DataObjectIter *it); const MathStructure *getObjectProperyStruct(string property, string object); const string &getObjectProperty(string property, string object); string getObjectPropertyInputString(string property, string object); string getObjectPropertyDisplayString(string property, string object); string printProperties(string object); string printProperties(DataObject *o); }; /// Data property function argument. class DataPropertyArgument : public Argument { protected: DataSet *o_data; virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: DataPropertyArgument(DataSet *data_set, string name_ = "", bool does_test = true, bool does_error = true); DataPropertyArgument(const DataPropertyArgument *arg); ~DataPropertyArgument(); int type() const; Argument *copy() const; string print() const; DataSet *dataSet() const; void setDataSet(DataSet *data_set); }; /// Data object function argument. class DataObjectArgument : public Argument { protected: DataSet *o_data; virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: DataObjectArgument(DataSet *data_set, string name_ = "", bool does_test = true, bool does_error = true); DataObjectArgument(const DataObjectArgument *arg); ~DataObjectArgument(); int type() const; Argument *copy() const; string print() const; DataSet *dataSet() const; void setDataSet(DataSet *data_set); }; #endif libqalculate-0.9.7/libqalculate/Prefix.cc0000644000175100017510000001036011305546373015331 00000000000000/* Qalculate Copyright (C) 2003-2006 Niklas Knutsson (nq@altern.org) 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. */ #include "support.h" #include "Prefix.h" #include "Calculator.h" #include "Number.h" Prefix::Prefix(string long_name, string short_name, string unicode_name) { l_name = long_name; s_name = short_name; u_name = unicode_name; } Prefix::~Prefix() { } const string &Prefix::shortName(bool return_long_if_no_short, bool use_unicode) const { if(use_unicode && !u_name.empty()) return u_name; if(return_long_if_no_short && s_name.empty()) { return l_name; } return s_name; } const string &Prefix::longName(bool return_short_if_no_long, bool use_unicode) const { if(return_short_if_no_long && l_name.empty()) { if(use_unicode && !u_name.empty()) return u_name; return s_name; } return l_name; } const string &Prefix::unicodeName(bool return_short_if_no_unicode) const { if(return_short_if_no_unicode && u_name.empty()) { return s_name; } return u_name; } void Prefix::setShortName(string short_name) { s_name = short_name; CALCULATOR->prefixNameChanged(this); } void Prefix::setLongName(string long_name) { l_name = long_name; CALCULATOR->prefixNameChanged(this); } void Prefix::setUnicodeName(string unicode_name) { u_name = unicode_name; CALCULATOR->prefixNameChanged(this); } const string &Prefix::name(bool short_default, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { if(short_default) { if(use_unicode && !u_name.empty() && (!can_display_unicode_string_function || (*can_display_unicode_string_function) (u_name.c_str(), can_display_unicode_string_arg))) return u_name; if(s_name.empty()) { return l_name; } return s_name; } if(l_name.empty()) { if(use_unicode && !u_name.empty() && (!can_display_unicode_string_function || (*can_display_unicode_string_function) (u_name.c_str(), can_display_unicode_string_arg))) return u_name; return s_name; } return l_name; } DecimalPrefix::DecimalPrefix(int exp10, string long_name, string short_name, string unicode_name) : Prefix(long_name, short_name, unicode_name) { exp = exp10; } DecimalPrefix::~DecimalPrefix() { } int DecimalPrefix::exponent(int iexp) const { return exp * iexp; } Number DecimalPrefix::exponent(const Number &nexp) const { return nexp * exp; } void DecimalPrefix::setExponent(int iexp) { exp = iexp; } Number DecimalPrefix::value(const Number &nexp) const { Number nr(exponent(nexp)); nr.exp10(); return nr; } Number DecimalPrefix::value(int iexp) const { Number nr(exponent(iexp)); nr.exp10(); return nr; } Number DecimalPrefix::value() const { Number nr(exp); nr.exp10(); return nr; } int DecimalPrefix::type() const { return PREFIX_DECIMAL; } BinaryPrefix::BinaryPrefix(int exp2, string long_name, string short_name, string unicode_name) : Prefix(long_name, short_name, unicode_name) { exp = exp2; } BinaryPrefix::~BinaryPrefix() { } int BinaryPrefix::exponent(int iexp) const { return exp * iexp; } Number BinaryPrefix::exponent(const Number &nexp) const { return nexp * exp; } void BinaryPrefix::setExponent(int iexp) { exp = iexp; } Number BinaryPrefix::value(const Number &nexp) const { Number nr(exponent(nexp)); nr.exp2(); return nr; } Number BinaryPrefix::value(int iexp) const { Number nr(exponent(iexp)); nr.exp2(); return nr; } Number BinaryPrefix::value() const { Number nr(exp); nr.exp2(); return nr; } int BinaryPrefix::type() const { return PREFIX_BINARY; } NumberPrefix::NumberPrefix(const Number &nr, string long_name, string short_name, string unicode_name) : Prefix(long_name, short_name, unicode_name) { o_number = nr; } NumberPrefix::~NumberPrefix() { } void NumberPrefix::setValue(const Number &nr) { o_number = nr; } Number NumberPrefix::value(const Number &nexp) const { Number nr(o_number); nr.raise(nexp); return nr; } Number NumberPrefix::value(int iexp) const { Number nr(o_number); nr.raise(iexp); return nr; } Number NumberPrefix::value() const { return o_number; } int NumberPrefix::type() const { return PREFIX_NUMBER; } libqalculate-0.9.7/libqalculate/support.h0000644000175100017510000000172211305546373015454 00000000000000/* Qalculate Copyright (C) 2003 Niklas Knutsson (nq@altern.org) 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. */ #ifndef SUPPORT_H #define SUPPORT_H #ifdef HAVE_CONFIG_H # include #endif /* * Standard gettext macros. */ #ifdef ENABLE_NLS # include # undef _ # define _(String) dgettext (PACKAGE, String) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif #else # define textdomain(String) (String) # define gettext(String) (String) # define dgettext(Domain,Message) (Message) # define dcgettext(Domain,Message,Type) (Message) # define bindtextdomain(Domain,Directory) (Domain) # define _(String) (String) # define N_(String) (String) #endif #endif libqalculate-0.9.7/libqalculate/Number.cc0000644000175100017510000024230011320653617015322 00000000000000/* Qalculate Copyright (C) 2004-2007 Niklas Knutsson (nq@altern.org) 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. */ #include "support.h" #include "Number.h" #include "Calculator.h" #include #include #include "util.h" #define REAL_PRECISION_FLOAT_RE(x) cln::cl_float(cln::realpart(x), cln::float_format(PRECISION + 1)) #define REAL_PRECISION_FLOAT_IM(x) cln::cl_float(cln::imagpart(x), cln::float_format(PRECISION + 1)) #define REAL_PRECISION_FLOAT(x) cln::cl_float(x, cln::float_format(PRECISION + 1)) #define MIN_PRECISION_FLOAT_RE(x) cln::cl_float(cln::realpart(x), cln::float_format(cln::float_format_lfloat_min + 1)) #define MIN_PRECISION_FLOAT_IM(x) cln::cl_float(cln::imagpart(x), cln::float_format(cln::float_format_lfloat_min + 1)) #define MIN_PRECISION_FLOAT(x) cln::cl_float(x, cln::float_format(cln::float_format_lfloat_min + 1)) #define CANNOT_FLOAT(x, p) (((cln::plusp(cln::realpart(x)) && (cln::realpart(x) > cln::cl_float(cln::most_positive_float(cln::float_format(p)), cln::default_float_format) || cln::realpart(x) < cln::cl_float(cln::least_positive_float(cln::float_format(p)), cln::default_float_format))) || (cln::minusp(cln::realpart(x)) && (cln::realpart(x) < cln::cl_float(cln::most_negative_float(cln::float_format(p)), cln::default_float_format) || cln::realpart(x) > cln::cl_float(cln::least_negative_float(cln::float_format(p)), cln::default_float_format))))) using namespace cln; /* void cln::cl_abort() { CALCULATOR->error(true, "CLN Error: see terminal output (probably too large or small floating point number)", NULL); if(CALCULATOR->busy()) { CALCULATOR->abort_this(); } else { exit(0); } } */ string printCL_I(cl_I integ, int base = 10, bool display_sign = true, BaseDisplay base_display = BASE_DISPLAY_NORMAL, bool lower_case = false) { if(base == BASE_ROMAN_NUMERALS) { if(!zerop(integ) && integ < 10000 && integ > -10000) { string str; int value = cl_I_to_int(integ); if(value < 0) { value = -value; if(display_sign) { str += "-"; } } int times = value / 1000; for(; times > 0; times--) { if(lower_case) str += "m"; else str += "M"; } value = value % 1000; times = value / 100; if(times == 9) { if(lower_case) str += "c"; else str += "C"; if(lower_case) str += "m"; else str += "M"; times = 0; } else if(times >= 5) { if(lower_case) str += "d"; else str += "D"; times -= 5; } else if(times == 4) { times = 0; if(lower_case) str += "c"; else str += "C"; if(lower_case) str += "d"; else str += "D"; } for(; times > 0; times--) { if(lower_case) str += "c"; else str += "C"; } value = value % 100; times = value / 10; if(times == 9) { if(lower_case) str += "x"; else str += "X"; if(lower_case) str += "c"; else str += "C"; times = 0; } else if(times >= 5) { if(lower_case) str += "l"; else str += "L"; times -= 5; } else if(times == 4) { times = 0; if(lower_case) str += "x"; else str += "X"; if(lower_case) str += "l"; else str += "L"; } for(; times > 0; times--) { if(lower_case) str += "x"; else str += "X"; } value = value % 10; times = value; if(times == 9) { if(lower_case) str += "i"; else str += "I"; if(lower_case) str += "x"; else str += "X"; times = 0; } else if(times >= 5) { if(lower_case) str += "v"; else str += "V"; times -= 5; } else if(times == 4) { times = 0; if(lower_case) str += "i"; else str += "I"; if(lower_case) str += "v"; else str += "V"; } for(; times > 0; times--) { if(lower_case) str += "i"; else str += "I"; } return str; } else if(!zerop(integ)) { CALCULATOR->error(false, _("Cannot display numbers greater than 9999 or less than -9999 as roman numerals."), NULL); } base = 10; } cl_print_flags flags; flags.rational_base = base; ostringstream stream; print_integer(stream, flags, integ); string cl_str = stream.str(); if(lower_case) { for(size_t i = 0; i < cl_str.length(); i++) { if(cl_str[i] >= 'A' && cl_str[i] <= 'Z') { cl_str[i] += 32; } } } if(minusp(integ)) { cl_str.erase(0, 1); } if(cl_str[cl_str.length() - 1] == '.') { cl_str.erase(cl_str.length() - 1, 1); } if(base == 2 && base_display != BASE_DISPLAY_NONE) { int i2 = cl_str.length() % 4; if(i2 != 0) i2 = 4 - i2; if(base_display == BASE_DISPLAY_NORMAL) { for(int i = (int) cl_str.length() - 4; i > 0; i -= 4) { cl_str.insert(i, 1, ' '); } } for(; i2 > 0; i2--) { cl_str.insert(cl_str.begin(), 1, '0'); } } string str = ""; if(minusp(integ) && display_sign) { str += '-'; } if(base_display == BASE_DISPLAY_NORMAL) { if(base == 16) { str += "0x"; } else if(base == 8) { str += "0"; } } else if(base_display == BASE_DISPLAY_ALTERNATIVE) { if(base == 16) { str += "0x0"; } else if(base == 8) { str += "0"; } else if(base == 2) { str += "0b00"; } } str += cl_str; return str; } Number::Number() { clear(); } Number::Number(string number, const ParseOptions &po) { set(number, po); } Number::Number(int numerator, int denominator, int exp_10) { set(numerator, denominator, exp_10); } Number::Number(const Number &o) { set(o); } Number::~Number() { } void Number::set(string number, const ParseOptions &po) { b_inf = false; b_pinf = false; b_minf = false; b_approx = false; if(po.base == BASE_ROMAN_NUMERALS) { remove_blanks(number); Number nr; Number cur; bool large = false; vector numbers; bool capital = false; for(size_t i = 0; i < number.length(); i++) { switch(number[i]) { case 'I': { if(!capital && i == number.length() - 1) { cur.set(2); CALCULATOR->error(false, _("Assuming the unusual practice of letting a last capital I mean 2 in a roman numeral."), NULL); break; } } case 'J': {capital = true;} case 'i': {} case 'j': { cur.set(1); break; } case 'V': {capital = true;} case 'v': { cur.set(5); break; } case 'X': {capital = true;} case 'x': { cur.set(10); break; } case 'L': {capital = true;} case 'l': { cur.set(50); break; } case 'C': {capital = true;} case 'c': { cur.set(100); break; } case 'D': {capital = true;} case 'd': { cur.set(500); break; } case 'M': {capital = true;} case 'm': { cur.set(1000); break; } case '(': { int multi = 1, multi2 = 0; bool turn = false; bool error = false; i++; for(; i < number.length(); i++) { if(number[i] == '|') { if(!turn) { turn = true; multi2 = multi; } else { error = true; break; } } else if(number[i] == ')') { if(turn) { multi2--; if(multi2 < 1) { break; } } else { error = true; break; } } else if(number[i] == '(') { if(!turn) { multi++; } else { error = true; break; } } else { error = true; i--; break; } } if(error | !turn) { CALCULATOR->error(true, _("Error in roman numerals: %s."), number.c_str(), NULL); } else { cur.set(10); cur.raise(multi); cur.multiply(100); } break; } case '|': { if(large) { cur.clear(); large = false; break; } else if(number.length() > i + 1 && number[i + 2] == ')') { i++; int multi = 1; for(; i < number.length(); i++) { if(number[i] != ')') { i--; break; } multi++; } cur.set(10); cur.raise(multi); cur.multiply(50); break; } else if(number.length() > i + 2 && number[i + 2] == '|') { cur.clear(); large = true; break; } } default: { cur.clear(); CALCULATOR->error(true, _("Unknown roman numeral: %c."), number[i], NULL); } } if(!cur.isZero()) { if(large) { cur.multiply(100000); } numbers.resize(numbers.size() + 1); numbers[numbers.size() - 1].set(cur); } } vector values; values.resize(numbers.size()); bool error = false; int rep = 1; for(size_t i = 0; i < numbers.size(); i++) { if(i == 0 || numbers[i].isLessThanOrEqualTo(numbers[i - 1])) { nr.add(numbers[i]); if(i > 0 && numbers[i].equals(numbers[i - 1])) { rep++; if(rep > 3 && numbers[i].isLessThan(1000)) { error = true; } else if(rep > 1 && (numbers[i].equals(5) || numbers[i].equals(50) || numbers[i].equals(500))) { error = true; } } else { rep = 1; } } else { numbers[i - 1].multiply(10); if(numbers[i - 1].isLessThan(numbers[i])) { error = true; } numbers[i - 1].divide(10); for(int i2 = i - 2; ; i2--) { if(i2 < 0) { nr.negate(); nr.add(numbers[i]); break; } else if(numbers[i2].isGreaterThan(numbers[i2 + 1])) { Number nr2(nr); nr2.subtract(values[i2]); nr.subtract(nr2); nr.subtract(nr2); nr.add(numbers[i]); if(numbers[i2].isLessThan(numbers[i])) { error = true; } break; } error = true; } } values[i].set(nr); } if(error) { PrintOptions pro; pro.base = BASE_ROMAN_NUMERALS; CALCULATOR->error(false, _("Errors in roman numerals: \"%s\". Interpreted as %s, which should be written as %s."), number.c_str(), nr.print().c_str(), nr.print(pro).c_str(), NULL); } values.clear(); numbers.clear(); set(nr); return; } cl_I num = 0; cl_I den = 1; int base = po.base; remove_blank_ends(number); if(base == 16 && number.length() >= 2 && number[0] == '0' && (number[1] == 'x' || number[1] == 'X')) { number = number.substr(2, number.length() - 2); } else if(base == 8 && number.length() >= 2 && number[0] == '0' && (number[1] == 'o' || number[1] == 'O')) { number = number.substr(2, number.length() - 2); } else if(base == 8 && number.length() > 1 && number[0] == '0' && number[1] != '.') { number.erase(number.begin()); } else if(base == 2 && number.length() >= 2 && number[0] == '0' && (number[1] == 'b' || number[1] == 'B')) { number = number.substr(2, number.length() - 2); } if(base > 36) base = 36; if(base < 0) base = 10; int readprec = 0; bool numbers_started = false, minus = false, in_decimals = false, b_cplx = false, had_nonzero = false; for(size_t index = 0; index < number.size(); index++) { if(number[index] >= '0' && ((base >= 10 && number[index] <= '9') || (base < 10 && number[index] < '0' + base))) { num = num * base; if(number[index] != '0') { num = num + number[index] - '0'; if(!had_nonzero) readprec = 0; had_nonzero = true; } if(in_decimals) { den = den * base; } readprec++; numbers_started = true; } else if(base > 10 && number[index] >= 'a' && number[index] < 'a' + base - 10) { num = num * base; num = num + (number[index] - 'a' + 10); if(in_decimals) { den = den * base; } if(!had_nonzero) readprec = 0; had_nonzero = true; readprec++; numbers_started = true; } else if(base > 10 && number[index] >= 'A' && number[index] < 'A' + base - 10) { num = num * base; num = num + (number[index] - 'A' + 10); if(in_decimals) { den = den * base; } if(!had_nonzero) readprec = 0; had_nonzero = true; readprec++; numbers_started = true; } else if(number[index] == 'E' && base <= 10) { index++; numbers_started = false; bool exp_minus = false; cl_I exp; while(index < number.size()) { if(number[index] >= '0' && number[index] <= '9') { exp = exp * 10; exp = exp + number[index] - '0'; numbers_started = true; } else if(!numbers_started && number[index] == '-') { exp_minus = !exp_minus; } index++; } if(exp_minus) { cl_I cl10 = 10; exp = cln::abs(exp); den = den * expt_pos(cl10, exp); } else { cl_I cl10 = 10; num = num * expt_pos(cl10, exp); } break; } else if(number[index] == '.') { in_decimals = true; } else if(number[index] == ':') { if(in_decimals) { CALCULATOR->error(true, _("\':\' in decimal number ignored (decimal point detected)."), NULL); } else { vector nums; nums.push_back(num); num = 0; for(index++; index < number.size(); index++) { if(number[index] >= '0' && number[index] <= '9') { num = num * 10; num = num + number[index] - '0'; } else if(number[index] == ':') { nums.push_back(num); num = 0; } else if(number[index] == 'E') { index--; break; } else if(number[index] == '.') { CALCULATOR->error(true, _("Decimal point in sexagesimal number treated as \':\'."), NULL); nums.push_back(num); num = 0; } else if(number[index] == 'i') { b_cplx = true; } } for(int i = nums.size() - 1; i >= 0; i--) { den = den * 60; nums[i] = nums[i] * den; num = num + nums[i]; } } } else if(!numbers_started && number[index] == '-') { minus = !minus; } else if(number[index] == 'i') { b_cplx = true; } else if(number[index] != ' ') { CALCULATOR->error(true, _("Character \'%c\' was ignored in the number \"%s\" with base %s."), number[index], number.c_str(), i2s(base).c_str(), NULL); } } if(minus) num = -num; if(b_cplx) { value = cln::complex(0, num / den); } else { value = num / den; } if(po.read_precision == ALWAYS_READ_PRECISION || (in_decimals && po.read_precision == READ_PRECISION_WHEN_DECIMALS)) { if(base != 10) { Number precmax(10); precmax.raise(readprec); precmax--; precmax.log(base); precmax.floor(); readprec = precmax.intValue(); } i_precision = readprec; b_approx = true; } else { i_precision = -1; } } void Number::set(int numerator, int denominator, int exp_10) { b_inf = false; b_pinf = false; b_minf = false; b_approx = false; i_precision = -1; value = numerator; if(denominator) { value = value / denominator; } if(exp_10 != 0) { exp10(exp_10); } } void Number::setFloat(double d_value) { b_inf = false; b_pinf = false; b_minf = false; b_approx = true; value = d_value; i_precision = 8; } void Number::setInternal(const cl_N &cln_value) { b_inf = false; b_pinf = false; b_minf = false; b_approx = false; value = cln_value; i_precision = -1; testApproximate(); } void Number::setImaginaryPart(const Number &o) { value = cln::complex(cln::realpart(value), cln::realpart(o.internalNumber())); testApproximate(); } void Number::setImaginaryPart(int numerator, int denominator, int exp_10) { Number o(numerator, denominator, exp_10); setImaginaryPart(o); } void Number::set(const Number &o) { b_inf = o.isInfinity(); b_pinf = o.isPlusInfinity(); b_minf = o.isMinusInfinity(); value = o.internalNumber(); b_approx = o.isApproximate(); i_precision = o.precision(); } void Number::setInfinity() { b_inf = true; b_pinf = false; b_minf = false; b_approx = false; value = 0; i_precision = -1; } void Number::setPlusInfinity() { b_inf = false; b_pinf = true; b_minf = false; b_approx = false; value = 0; i_precision = -1; } void Number::setMinusInfinity() { b_inf = false; b_pinf = false; b_minf = true; b_approx = false; value = 0; i_precision = -1; } void Number::clear() { b_inf = false; b_pinf = false; b_minf = false; b_approx = false; value = 0; i_precision = -1; } const cl_N &Number::internalNumber() const { return value; } double Number::floatValue() const { return double_approx(cln::realpart(value)); } int Number::intValue(bool *overflow) const { cl_I i = cln::round1(cln::realpart(value)); if(i > long(INT_MAX)) { if(overflow) *overflow = true; return INT_MAX; } else if(i < long(INT_MIN)) { if(overflow) *overflow = true; return INT_MIN; } return cl_I_to_int(i); } bool Number::isApproximate() const { return b_approx || isApproximateType(); } bool Number::isApproximateType() const { return !isInfinite() && (!cln::instanceof(cln::realpart(value), cln::cl_RA_ring) || (isComplex() && !cln::instanceof(cln::imagpart(value), cln::cl_RA_ring))); } void Number::setApproximate(bool is_approximate) { if(!isInfinite() && is_approximate != isApproximate()) { if(is_approximate) { //value = cln::complex(cln::cl_float(cln::realpart(value)), cln::cl_float(cln::imagpart(value))); //removeFloatZeroPart(); i_precision = PRECISION; b_approx = true; } else { if(isApproximateType()) { value = cln::complex(cln::rational(cln::realpart(value)), cln::rational(cln::imagpart(value))); } i_precision = -1; b_approx = false; } } } int Number::precision() const { return i_precision; } void Number::setPrecision(int prec) { i_precision = prec; if(i_precision > 0) b_approx = true; } bool Number::isUndefined() const { return false; } bool Number::isInfinite() const { return b_pinf || b_minf || b_inf; } bool Number::isInfinity() const { return b_inf; } bool Number::isPlusInfinity() const { return b_pinf; } bool Number::isMinusInfinity() const { return b_minf; } Number Number::realPart() const { if(isInfinite()) return *this; Number real_part; real_part.setInternal(cln::realpart(value)); return real_part; } Number Number::imaginaryPart() const { if(isInfinite()) return Number(); Number imag_part; imag_part.setInternal(cln::imagpart(value)); return imag_part; } Number Number::numerator() const { Number num; num.setInternal(cln::numerator(cln::rational(cln::realpart(value)))); return num; } Number Number::denominator() const { Number den; den.setInternal(cln::denominator(cln::rational(cln::realpart(value)))); return den; } Number Number::complexNumerator() const { Number num; num.setInternal(cln::numerator(cln::rational(cln::imagpart(value)))); return num; } Number Number::complexDenominator() const { Number den; den.setInternal(cln::denominator(cln::rational(cln::imagpart(value)))); return den; } void Number::operator = (const Number &o) {set(o);} void Number::operator -- (int) {value = cln::minus1(value);} void Number::operator ++ (int) {value = cln::plus1(value);} Number Number::operator - () const {Number o(*this); o.negate(); return o;} Number Number::operator * (const Number &o) const {Number o2(*this); o2.multiply(o); return o2;} Number Number::operator / (const Number &o) const {Number o2(*this); o2.divide(o); return o2;} Number Number::operator + (const Number &o) const {Number o2(*this); o2.add(o); return o2;} Number Number::operator - (const Number &o) const {Number o2(*this); o2.subtract(o); return o2;} Number Number::operator ^ (const Number &o) const {Number o2(*this); o2.raise(o); return o2;} Number Number::operator && (const Number &o) const {Number o2(*this); o2.add(o, OPERATION_LOGICAL_AND); return o2;} Number Number::operator || (const Number &o) const {Number o2(*this); o2.add(o, OPERATION_LOGICAL_OR); return o2;} Number Number::operator ! () const {Number o(*this); o.setLogicalNot(); return o;} void Number::operator *= (const Number &o) {multiply(o);} void Number::operator /= (const Number &o) {divide(o);} void Number::operator += (const Number &o) {add(o);} void Number::operator -= (const Number &o) {subtract(o);} void Number::operator ^= (const Number &o) {raise(o);} bool Number::operator == (const Number &o) const {return equals(o);} bool Number::operator != (const Number &o) const {return !equals(o);} bool Number::bitAnd(const Number &o) { if(!o.isInteger() || !isInteger()) return false; value = cln::logand(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); setPrecisionAndApproximateFrom(o); return true; } bool Number::bitOr(const Number &o) { if(!o.isInteger() || !isInteger()) return false; value = cln::logior(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); setPrecisionAndApproximateFrom(o); return true; } bool Number::bitXor(const Number &o) { if(!o.isInteger() || !isInteger()) return false; value = cln::logxor(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); setPrecisionAndApproximateFrom(o); return true; } bool Number::bitNot() { if(!isInteger()) return false; value = cln::lognot(cln::numerator(cln::rational(cln::realpart(value)))); return true; } bool Number::bitEqv(const Number &o) { if(!o.isInteger() || !isInteger()) return false; value = cln::logeqv(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); setPrecisionAndApproximateFrom(o); return true; } bool Number::shiftLeft(const Number &o) { if(!o.isInteger() || !isInteger() || o.isNegative()) return false; cln::cl_I intval = cln::numerator(cln::rational(cln::realpart(value))); intval << cln::numerator(cln::rational(cln::realpart(o.internalNumber()))); value = intval; setPrecisionAndApproximateFrom(o); return true; } bool Number::shiftRight(const Number &o) { if(!o.isInteger() || !isInteger() || o.isNegative()) return false; cln::cl_I intval = cln::numerator(cln::rational(cln::realpart(value))); intval >> cln::numerator(cln::rational(cln::realpart(o.internalNumber()))); value = intval; setPrecisionAndApproximateFrom(o); return true; } bool Number::shift(const Number &o) { if(!o.isInteger() || !isInteger()) return false; value = cln::ash(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); setPrecisionAndApproximateFrom(o); return true; } bool Number::hasRealPart() const { return isInfinite() || !cln::zerop(cln::realpart(value)); } bool Number::hasImaginaryPart() const { return !isInfinite() && !cln::zerop(cln::imagpart(value)); } void Number::removeFloatZeroPart() { if(!isInfinite() && isApproximateType() && !cln::zerop(cln::imagpart(value))) { if(PRECISION < cln::float_format_lfloat_min) { cl_F f_value = MIN_PRECISION_FLOAT_RE(value) + MIN_PRECISION_FLOAT_IM(value); if(MIN_PRECISION_FLOAT(f_value) == MIN_PRECISION_FLOAT_RE(value)) { value = cln::realpart(value); } else if(MIN_PRECISION_FLOAT(f_value) == MIN_PRECISION_FLOAT_IM(value)) { value = cln::complex(0, cln::imagpart(value)); } } else { cl_F f_value = REAL_PRECISION_FLOAT_RE(value) + REAL_PRECISION_FLOAT_IM(value); if(REAL_PRECISION_FLOAT(f_value) == REAL_PRECISION_FLOAT_RE(value)) { value = cln::realpart(value); } else if(REAL_PRECISION_FLOAT(f_value) == REAL_PRECISION_FLOAT_IM(value)) { value = cln::complex(0, cln::imagpart(value)); } } } } void Number::testApproximate() { if(!b_approx && isApproximateType()) { i_precision = PRECISION; b_approx = true; } } void Number::testInteger() { if(isApproximateType() && !isInfinite() && !isComplex()) { if(PRECISION < cln::float_format_lfloat_min) { if(cln::zerop(cln::truncate2(MIN_PRECISION_FLOAT_RE(value)).remainder)) { value = cln::round1(cln::realpart(value)); } } else { if(cln::zerop(cln::truncate2(REAL_PRECISION_FLOAT_RE(value)).remainder)) { value = cln::round1(cln::realpart(value)); } } } } void Number::setPrecisionAndApproximateFrom(const Number &o) { if(o.precision() > 0 && (i_precision < 1 || o.precision() < i_precision)) i_precision = o.precision(); if(o.isApproximate()) b_approx = true; } bool Number::isComplex() const { return !isInfinite() && !cln::zerop(cln::imagpart(value)); } Number Number::integer() const { Number nr(*this); nr.round(); return nr; } bool Number::isInteger() const { if(isInfinite()) return false; if(isComplex()) return false; if(isApproximateType()) return false; return cln::denominator(cln::rational(cln::realpart(value))) == 1; } bool Number::isRational() const { return !isInfinite() && !isComplex() && !isApproximateType(); } bool Number::isReal() const { return !isInfinite() && !isComplex(); } bool Number::isFraction() const { if(isInfinite()) return false; if(!isComplex()) { cl_R real_value = cln::realpart(value); return real_value < 1 && real_value > -1; } return false; } bool Number::isZero() const { if(isInfinite()) return false; return cln::zerop(value); } bool Number::isOne() const { if(isInfinite()) return false; return value == 1; } bool Number::isTwo() const { if(isInfinite()) return false; return value == 2; } bool Number::isI() const { if(isInfinite()) return false; return cln::zerop(cln::realpart(value)) && cln::imagpart(value) == 1; } bool Number::isMinusOne() const { if(isInfinite()) return false; return value == -1; } bool Number::isMinusI() const { if(isInfinite()) return false; return cln::zerop(cln::realpart(value)) && cln::imagpart(value) == -1; } bool Number::isNegative() const { return b_minf || (!isInfinite() && !isComplex() && cln::minusp(cln::realpart(value))); } bool Number::isNonNegative() const { return b_pinf || (!isInfinite() && !isComplex() && !cln::minusp(cln::realpart(value))); } bool Number::isPositive() const { return b_pinf || (!isInfinite() && !isComplex() && cln::plusp(cln::realpart(value))); } bool Number::isNonPositive() const { return b_minf || (!isInfinite() && !isComplex() && !cln::plusp(cln::realpart(value))); } bool Number::realPartIsNegative() const { return b_minf || (!isInfinite() && cln::minusp(cln::realpart(value))); } bool Number::realPartIsPositive() const { return b_pinf || (!isInfinite() && cln::plusp(cln::realpart(value))); } bool Number::imaginaryPartIsNegative() const { return !isInfinite() && cln::minusp(cln::imagpart(value)); } bool Number::imaginaryPartIsPositive() const { return !isInfinite() && cln::plusp(cln::imagpart(value)); } bool Number::hasNegativeSign() const { if(hasRealPart()) return realPartIsNegative(); return imaginaryPartIsNegative(); } bool Number::hasPositiveSign() const { if(hasRealPart()) return realPartIsPositive(); return imaginaryPartIsPositive(); } bool Number::equalsZero() const { if(isZero()) return true; if(isApproximateType() && !isComplex()) { if(PRECISION < cln::float_format_lfloat_min) { return MIN_PRECISION_FLOAT_RE(value + 1) == cln::cl_float(1, cln::float_format(cln::float_format_lfloat_min + 1)); } else { return REAL_PRECISION_FLOAT_RE(value + 1) == cln::cl_float(1, cln::float_format(PRECISION + 1)); } } return false; } bool Number::equals(const Number &o) const { if(b_inf) return false; if(b_pinf) return false; if(b_minf) return false; if(o.isInfinite()) return false; return value == o.internalNumber(); } bool Number::equalsApproximately(const Number &o, int prec) const { if(b_inf) return false; if(b_pinf) return false; if(b_minf) return false; if(o.isInfinite()) return false; if(value == o.internalNumber()) return true; if(isComplex() != o.isComplex()) return false; if(isComplex()) { return realPart().equalsApproximately(o.realPart(), prec) && imaginaryPart().equalsApproximately(o.imaginaryPart(), prec); } bool prec_choosen = prec >= 0; if(prec == EQUALS_PRECISION_LOWEST) { prec = PRECISION; if(i_precision >= 0 && i_precision < prec) prec = i_precision; if(o.precision() >= 0 && o.precision() < prec) prec = o.precision(); } else if(prec == EQUALS_PRECISION_HIGHEST) { prec = i_precision; if(o.precision() >= 0 && o.precision() > prec) prec = o.precision(); if(prec < 0) prec = PRECISION; } else if(prec == EQUALS_PRECISION_DEFAULT) { prec = PRECISION; } /*if(isApproximateType() && o.isApproximateType()) { if(prec >= cln::float_format_lfloat_min) { return cln::cl_float(cln::realpart(value), cln::float_format(prec + 1)) == cln::cl_float(cln::realpart(o.internalNumber()), cln::float_format(prec + 1)); } string str1, str2; std::ostringstream s1, s2; s1 << value; s2 << o.internalNumber(); str1 = s1.str(); str2 = s2.str(); for(size_t i = str1.length() - 1, i2 = str2.length() - 1; ; i--, i2--) { if(is_not_in("0123456789.", str1[i])) { if(is_in("0123456789.", str2[i2])) return false; break; } if(is_not_in("0123456789.", str2[i2])) { if(is_in("0123456789.", str1[i])) return false; break; } if(str1[i] != str2[i2]) return false; } for(size_t i = 0; i < str1.length() && i < str2.length() && (int) i <= prec; i++) { if(str1[i] != str2[i]) return false; if(str1[i] == '.') prec++; } return true; }*/ if(prec_choosen || isApproximate() || o.isApproximate()) { cln::cl_R diff = cln::realpart(value) - cln::realpart(o.internalNumber()); if(cln::zerop(diff)) return true; cln::cl_R val; bool first_greatest = true; if(diff < 0) { first_greatest = false; diff = -diff; val = cln::realpart(o.internalNumber()); } else { val = cln::realpart(value); } val = val / diff; cln::cl_I precval = cln::expt_pos(cln::cl_I(10), cln::cl_I(prec)); val = val / precval; if(val > 3) return true; cl_RA tenth = 1; tenth = tenth / 10; if(val < tenth) return false; cln::cl_R remainder1, remainder2; if(first_greatest) { remainder1 = cln::realpart(value); remainder2 = cln::realpart(o.internalNumber()); } else { remainder2 = cln::realpart(value); remainder1 = cln::realpart(o.internalNumber()); } cln::cl_R_div_t divt1, divt2; bool started = false, oneup = false, even = false; while(prec >= 0) { divt1 = cln::truncate2(remainder1); divt2 = cln::truncate2(remainder2); if(prec == 0) { if(oneup) { if(even) return divt1.quotient < 5 && divt2.quotient > 5; else return divt1.quotient <= 5 && divt2.quotient >= 5; } else { if(even) return (divt1.quotient > 5) == (divt2.quotient > 5); else return (divt1.quotient >= 5) == (divt2.quotient >= 5); } } if(started) { prec--; if(oneup && (divt1.quotient != 0 || divt2.quotient != 9)) return false; if(oneup) { even = false; } else { if(divt1.quotient != divt2.quotient) { if(divt1.quotient == divt2.quotient + 1) { oneup = true; } else { return false; } } even = cln::evenp(divt2.quotient); } } else if(!cln::zerop(divt1.quotient)) { started = true; if(divt1.quotient < 10) { prec--; if(divt1.quotient != divt2.quotient) { if(divt2.quotient == 1) { oneup = true; } else { return false; } } } else { std::ostringstream s1; s1 << divt1.quotient; if(divt1.quotient == divt2.quotient) { prec -= s1.str().length(); } else { std::ostringstream s2; s2 << divt2.quotient; string str1 = s1.str(); string str2 = s2.str(); if(str1.length() != str2.length()) { if(str1.length() == str2.length() + 1 && str1[0] == '1') { oneup = true; prec--; str1.erase(str1.begin()); } else { return false; } } for(size_t i = 0; i < str1.length(); i++) { if(oneup && (str1[i] != '0' || str2[i] != '9')) return false; if(oneup) { even = false; } else { if(str1[i] != str2[i]) { if(str1[i] == str2[i] + 1) { oneup = true; } else { return false; } } even = str2[i] == '0' || str2[i] == '2' || str2[i] == '4' || str2[i] == '6' || str2[i] == '8'; } prec--; if(prec == 0) { if(oneup) { if(even) return i + 1 < str1.length() && str1[i + 1] < '5' && str2[i + 1] > '5'; else return i + 1 < str1.length() && str1[i + 1] <= '5' && str2[i + 1] >= '5'; } else { if(even) return i == str1.length() - 1 || (str1[i + 1] > '5') == (str2[i + 1] > '5'); else return i == str1.length() - 1 || (str1[i + 1] >= '5') == (str2[i + 1] >= '5'); } } } } } } if(cln::zerop(remainder1) && cln::zerop(remainder2)) return !oneup; remainder1 = divt1.remainder * 10; remainder2 = divt2.remainder * 10; } return false; } return false; } ComparisonResult Number::compare(const Number &o) const { if(b_inf || o.isInfinity()) return COMPARISON_RESULT_UNKNOWN; if(b_pinf) { if(o.isPlusInfinity()) return COMPARISON_RESULT_EQUAL; else return COMPARISON_RESULT_LESS; } if(b_minf) { if(o.isMinusInfinity()) return COMPARISON_RESULT_EQUAL; else return COMPARISON_RESULT_GREATER; } if(o.isPlusInfinity()) return COMPARISON_RESULT_GREATER; if(o.isMinusInfinity()) return COMPARISON_RESULT_LESS; if(equals(o)) return COMPARISON_RESULT_EQUAL; if(!isComplex() && !o.isComplex()) { int i = cln::compare(cln::realpart(o.internalNumber()), cln::realpart(value)); if(i == 0) return COMPARISON_RESULT_EQUAL; else if(i == -1) return COMPARISON_RESULT_LESS; else if(i == 1) return COMPARISON_RESULT_GREATER; return COMPARISON_RESULT_UNKNOWN; } else { return COMPARISON_RESULT_NOT_EQUAL; } } ComparisonResult Number::compareApproximately(const Number &o, int prec) const { if(b_inf || o.isInfinity()) return COMPARISON_RESULT_UNKNOWN; if(b_pinf) { if(o.isPlusInfinity()) return COMPARISON_RESULT_EQUAL; else return COMPARISON_RESULT_LESS; } if(b_minf) { if(o.isMinusInfinity()) return COMPARISON_RESULT_EQUAL; else return COMPARISON_RESULT_GREATER; } if(o.isPlusInfinity()) return COMPARISON_RESULT_GREATER; if(o.isMinusInfinity()) return COMPARISON_RESULT_LESS; if(equalsApproximately(o, prec)) return COMPARISON_RESULT_EQUAL; if(!isComplex() && !o.isComplex()) { int i = cln::compare(cln::realpart(o.internalNumber()), cln::realpart(value)); if(i == 0) return COMPARISON_RESULT_EQUAL; else if(i == -1) return COMPARISON_RESULT_LESS; else if(i == 1) return COMPARISON_RESULT_GREATER; return COMPARISON_RESULT_UNKNOWN; } else { return COMPARISON_RESULT_NOT_EQUAL; } } ComparisonResult Number::compareImaginaryParts(const Number &o) const { int i = cln::compare(cln::imagpart(o.internalNumber()), cln::imagpart(value)); if(i == 0) return COMPARISON_RESULT_EQUAL; else if(i == -1) return COMPARISON_RESULT_LESS; else if(i == 1) return COMPARISON_RESULT_GREATER; return COMPARISON_RESULT_UNKNOWN; } ComparisonResult Number::compareRealParts(const Number &o) const { int i = cln::compare(cln::realpart(o.internalNumber()), cln::realpart(value)); if(i == 0) return COMPARISON_RESULT_EQUAL; else if(i == -1) return COMPARISON_RESULT_LESS; else if(i == 1) return COMPARISON_RESULT_GREATER; return COMPARISON_RESULT_UNKNOWN; } bool Number::isGreaterThan(const Number &o) const { if(b_minf || b_inf || o.isInfinity() || o.isPlusInfinity()) return false; if(o.isMinusInfinity()) return true; if(b_pinf) return true; if(isComplex() || o.isComplex()) return false; return cln::realpart(value) > cln::realpart(o.internalNumber()); } bool Number::isLessThan(const Number &o) const { if(o.isMinusInfinity() || o.isInfinity() || b_inf || b_pinf) return false; if(b_minf || o.isPlusInfinity()) return true; if(isComplex() || o.isComplex()) return false; return cln::realpart(value) < cln::realpart(o.internalNumber()); } bool Number::isGreaterThanOrEqualTo(const Number &o) const { if(b_inf || o.isInfinity()) return false; if(b_minf) return o.isMinusInfinity(); if(b_pinf) return true; if(!isComplex() && !o.isComplex()) { return cln::realpart(value) >= cln::realpart(o.internalNumber()); } return false; } bool Number::isLessThanOrEqualTo(const Number &o) const { if(b_inf || o.isInfinity()) return false; if(b_pinf) return o.isPlusInfinity(); if(b_minf) return true; if(!isComplex() && !o.isComplex()) { return cln::realpart(value) <= cln::realpart(o.internalNumber()); } return false; } bool Number::isEven() const { return isInteger() && cln::evenp(cln::numerator(cln::rational(cln::realpart(value)))); } bool Number::denominatorIsEven() const { return !isInfinite() && !isComplex() && !isApproximateType() && cln::evenp(cln::denominator(cln::rational(cln::realpart(value)))); } bool Number::denominatorIsTwo() const { return !isInfinite() && !isComplex() && !isApproximateType() && cln::denominator(cln::rational(cln::realpart(value))) == 2; } bool Number::numeratorIsEven() const { return !isInfinite() && !isComplex() && !isApproximateType() && cln::evenp(cln::numerator(cln::rational(cln::realpart(value)))); } bool Number::numeratorIsOne() const { return !isInfinite() && !isComplex() && !isApproximateType() && cln::numerator(cln::rational(cln::realpart(value))) == 1; } bool Number::numeratorIsMinusOne() const { return !isInfinite() && !isComplex() && !isApproximateType() && cln::numerator(cln::rational(cln::realpart(value))) == -1; } bool Number::isOdd() const { return isInteger() && cln::oddp(cln::numerator(cln::rational(cln::realpart(value)))); } int Number::integerLength() const { if(isInteger()) return cln::integer_length(cln::numerator(cln::rational(cln::realpart(value)))); return 0; } bool Number::add(const Number &o) { if(b_inf) return !o.isInfinite(); if(o.isInfinity()) { if(isInfinite()) return false; setInfinity(); setPrecisionAndApproximateFrom(o); return true; } if(b_minf) return !o.isPlusInfinity(); if(b_pinf) return !o.isMinusInfinity(); if(o.isPlusInfinity()) { b_pinf = true; value = 0; setPrecisionAndApproximateFrom(o); return true; } if(o.isMinusInfinity()) { b_minf = true; value = 0; setPrecisionAndApproximateFrom(o); return true; } if(isApproximateType() || o.isApproximateType()) { if(equalsApproximately(-o, EQUALS_PRECISION_DEFAULT)) { value = 0; setPrecisionAndApproximateFrom(o); return true; } } value = value + o.internalNumber(); removeFloatZeroPart(); setPrecisionAndApproximateFrom(o); return true; } bool Number::subtract(const Number &o) { if(b_inf) { return !o.isInfinite(); } if(o.isInfinity()) { if(isInfinite()) return false; setPrecisionAndApproximateFrom(o); setInfinity(); return true; } if(b_pinf) { return !o.isPlusInfinity(); } if(b_minf) { return !o.isMinusInfinity(); } if(o.isPlusInfinity()) { setPlusInfinity(); setPrecisionAndApproximateFrom(o); return true; } if(o.isMinusInfinity()) { setMinusInfinity(); setPrecisionAndApproximateFrom(o); return true; } if(isApproximateType() || o.isApproximateType()) { if(equalsApproximately(o, EQUALS_PRECISION_DEFAULT)) { value = 0; setPrecisionAndApproximateFrom(o); return true; } } value = value - o.internalNumber(); removeFloatZeroPart(); setPrecisionAndApproximateFrom(o); return true; } bool Number::multiply(const Number &o) { if(o.isInfinite() && isZero()) return false; if(isInfinite() && o.isZero()) return false; if((isInfinite() && o.isComplex()) || (o.isInfinite() && isComplex())) { //setInfinity(); //return true; return false; } if(isInfinity()) return true; if(o.isInfinity()) { //setInfinity(); //return true; return false; } if(b_pinf || b_minf) { if(o.isNegative()) { b_pinf = !b_pinf; b_minf = !b_minf; setPrecisionAndApproximateFrom(o); } return true; } if(o.isPlusInfinity()) { if(isNegative()) setMinusInfinity(); else setPlusInfinity(); setPrecisionAndApproximateFrom(o); return true; } if(o.isMinusInfinity()) { if(isNegative()) setPlusInfinity(); else setMinusInfinity(); setPrecisionAndApproximateFrom(o); return true; } if(isZero()) return true; if(o.isZero()) { clear(); setPrecisionAndApproximateFrom(o); return true; } value = value * o.internalNumber(); removeFloatZeroPart(); setPrecisionAndApproximateFrom(o); return true; } bool Number::divide(const Number &o) { if(isInfinite() && o.isInfinite()) return false; if(isInfinite() && o.isZero()) { //setInfinity(); //return true; return false; } if(o.isInfinite()) { clear(); return true; } if(isInfinite()) { if(o.isComplex()) { //setInfinity(); return false; } else if(o.isNegative()) { b_pinf = !b_pinf; b_minf = !b_minf; } setPrecisionAndApproximateFrom(o); return true; } if(o.isZero()) { if(isZero()) return false; //division by zero!!! //setInfinity(); //return true; return false; } if(isZero()) { setPrecisionAndApproximateFrom(o); return true; } value = value / o.internalNumber(); removeFloatZeroPart(); setPrecisionAndApproximateFrom(o); return true; } bool Number::recip() { if(isZero()) { //division by zero!!! //setInfinity(); //return true; return false; } if(isInfinite()) { clear(); return true; } value = cln::recip(value); removeFloatZeroPart(); return true; } bool Number::raise(const Number &o, bool try_exact) { if(o.isInfinity()) return false; if(isInfinite()) { if(o.isNegative()) { clear(); return true; } if(o.isZero()) { return false; } if(isMinusInfinity()) { if(o.isEven()) { setPlusInfinity(); } else if(!o.isInteger()) { //setInfinity(); return false; } } return true; } if(o.isMinusInfinity()) { if(isZero()) { //setInfinity(); return false; } else if(isComplex()) { return false; } else { clear(); } setPrecisionAndApproximateFrom(o); return true; } if(o.isPlusInfinity()) { if(isZero()) { } else if(isComplex() || isNegative()) { return false; } else { setPlusInfinity(); } setPrecisionAndApproximateFrom(o); return true; } if(isZero() && o.isNegative()) { CALCULATOR->error(true, _("Division by zero."), NULL); return false; } if(isZero()) { if(o.isZero()) { //0^0 CALCULATOR->error(false, _("0^0 might be considered undefined"), NULL); set(1, 1); setApproximate(o.isApproximate()); return true; } return true; } bool neg = false; if(isNegative() && !o.isComplex() && !o.isApproximateType() && !o.numeratorIsEven() && !o.denominatorIsEven()) { neg = true; value = cln::abs(value); } cln::cl_RA dmax = 1; dmax = dmax / 10; if(o.isRational() && isRational() && (!try_exact || (cln::abs(value) <= 1 + dmax && cln::abs(value) >= 1 - dmax)) && value != 1 && value != -1 && (cln::numerator(cln::rational(cln::realpart(o.internalNumber()))) > 10000 || cln::numerator(cln::rational(cln::realpart(o.internalNumber()))) < -10000)) { value = cln::expt(cln::cl_float(cln::realpart(value)), cln::cl_float(cln::realpart(o.internalNumber()))); } else { value = cln::expt(value, o.internalNumber()); } if(neg) { value = -value; } removeFloatZeroPart(); setPrecisionAndApproximateFrom(o); testApproximate(); testInteger(); return true; } bool Number::exp10(const Number &o) { if(isZero()) return true; if(o.isZero()) { setPrecisionAndApproximateFrom(o); return true; } Number ten(10, 1); if(!ten.raise(o)) { return false; } multiply(ten); return true; } bool Number::exp10() { if(isZero()) { set(1, 1); return true; } Number ten(10, 1); if(!ten.raise(*this)) { return false; } set(ten); return true; } bool Number::exp2(const Number &o) { if(isZero()) return true; if(o.isZero()) { setPrecisionAndApproximateFrom(o); return true; } Number two(2, 1); if(!two.raise(o)) { return false; } multiply(two); return true; } bool Number::exp2() { if(isZero()) { set(1, 1); return true; } Number two(2, 1); if(!two.raise(*this)) { return false; } set(two); return true; } bool Number::square() { if(isInfinite()) { setPlusInfinity(); return true; } value = cln::square(value); return true; } bool Number::negate() { if(isInfinite()) { b_pinf = !b_pinf; b_minf = !b_minf; return true; } value = -value; return true; } void Number::setNegative(bool is_negative) { if(!isZero() && minusp(cln::realpart(value)) != is_negative) { if(isInfinite()) {b_pinf = !b_pinf; b_minf = !b_minf; return;} value = cln::complex(-cln::realpart(value), cln::imagpart(value)); } } bool Number::abs() { if(isInfinite()) { setPlusInfinity(); return true; } value = cln::abs(value); return true; } bool Number::signum() { if(isInfinite()) return false; value = cln::signum(value); return true; } bool Number::round() { if(isInfinite() || isComplex()) return false; if(b_approx) { if(isInteger()) { if(!cln::zerop(cln::rem(cln::realpart(value), 10))) { i_precision = -1; b_approx = false; } } else { i_precision = -1; b_approx = false; } } value = cln::round1(cln::realpart(value)); return true; } bool Number::floor() { if(isInfinite() || isComplex()) return false; //if(b_approx && !isInteger()) b_approx = false; value = cln::floor1(cln::realpart(value)); return true; } bool Number::ceil() { if(isInfinite() || isComplex()) return false; //if(b_approx && !isInteger()) b_approx = false; value = cln::ceiling1(cln::realpart(value)); return true; } bool Number::trunc() { if(isInfinite() || isComplex()) return false; //if(b_approx && !isInteger()) b_approx = false; value = cln::truncate1(cln::realpart(value)); return true; } bool Number::round(const Number &o) { if(isInfinite() || o.isInfinite()) { return divide(o) && round(); } if(isComplex()) return false; if(o.isComplex()) return false; value = cln::round1(cln::realpart(value), cln::realpart(o.internalNumber())); setPrecisionAndApproximateFrom(o); return true; } bool Number::floor(const Number &o) { if(isInfinite() || o.isInfinite()) { return divide(o) && floor(); } if(isComplex()) return false; if(o.isComplex()) return false; value = cln::floor1(cln::realpart(value), cln::realpart(o.internalNumber())); setPrecisionAndApproximateFrom(o); return true; } bool Number::ceil(const Number &o) { if(isInfinite() || o.isInfinite()) { return divide(o) && ceil(); } if(isComplex()) return false; if(o.isComplex()) return false; value = cln::ceiling1(cln::realpart(value), cln::realpart(o.internalNumber())); setPrecisionAndApproximateFrom(o); return true; } bool Number::trunc(const Number &o) { if(isInfinite() || o.isInfinite()) { return divide(o) && trunc(); } if(isComplex()) return false; if(o.isComplex()) return false; value = cln::truncate1(cln::realpart(value), cln::realpart(o.internalNumber())); setPrecisionAndApproximateFrom(o); return true; } bool Number::mod(const Number &o) { if(isInfinite() || o.isInfinite()) return false; if(isComplex() || o.isComplex()) return false; value = cln::mod(cln::realpart(value), cln::realpart(o.internalNumber())); setPrecisionAndApproximateFrom(o); return true; } bool Number::frac() { if(isInfinite() || isComplex()) return false; cl_N whole_value = cln::truncate1(cln::realpart(value)); value = value - whole_value; return true; } bool Number::rem(const Number &o) { if(isInfinite() || o.isInfinite()) return false; if(isComplex() || o.isComplex()) return false; value = cln::rem(cln::realpart(value), cln::realpart(o.internalNumber())); setPrecisionAndApproximateFrom(o); return true; } bool Number::smod(const Number &o) { if(!isInteger() || !o.isInteger()) return false; const cln::cl_I b2 = cln::ceiling1(cln::numerator(cln::rational(cln::realpart(o.internalNumber()))) >> 1) - 1; value = cln::mod(cln::numerator(cln::rational(cln::realpart(value))) + b2, cln::numerator(cln::rational(cln::realpart(o.internalNumber())))) - b2; setPrecisionAndApproximateFrom(o); return true; } bool Number::irem(const Number &o) { if(o.isZero()) return false; if(!isInteger() || !o.isInteger()) return false; value = cln::rem(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); return true; } bool Number::irem(const Number &o, Number &q) { if(o.isZero()) return false; if(!isInteger() || !o.isInteger()) return false; const cln::cl_I_div_t rem_quo = cln::truncate2(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); q.setInternal(rem_quo.quotient); value = rem_quo.remainder; return true; } bool Number::iquo(const Number &o) { if(o.isZero()) return false; if(!isInteger() || !o.isInteger()) return false; value = cln::truncate1(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); return true; } bool Number::iquo(const Number &o, Number &r) { if(o.isZero()) return false; if(!isInteger() || !o.isInteger()) return false; const cln::cl_I_div_t rem_quo = cln::truncate2(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); r.setInternal(rem_quo.remainder); value = rem_quo.quotient; return true; } bool Number::isqrt() { if(isInteger()) { cln::cl_I iroot; cln::isqrt(cln::numerator(cln::rational(cln::realpart(value))), &iroot); value = iroot; return true; } return false; } int Number::getBoolean() const { if(isPositive()) { return 1; } else if(isNonPositive()) { return 0; } return -1; } void Number::toBoolean() { setTrue(isPositive()); } void Number::setTrue(bool is_true) { if(is_true) { value = 1; } else { value = 0; } } void Number::setFalse() { setTrue(false); } void Number::setLogicalNot() { setTrue(!isPositive()); } void Number::e() { setInternal(cln::exp1()); } void Number::pi() { setInternal(cln::pi()); } void Number::catalan() { setInternal(cln::catalanconst()); } void Number::euler() { setInternal(cln::eulerconst()); } bool Number::zeta() { if(isOne()) { setInfinity(); return true; } if(isNegative() || !isInteger() || isZero()) { CALCULATOR->error(true, _("Can only handle Riemann Zeta with an integer argument (s) >= 1"), NULL); return false; } bool overflow = false; int i = intValue(&overflow); if(overflow) { CALCULATOR->error(true, _("Cannot handle an argument (s) that large for Riemann Zeta."), NULL); return false; } value = cln::zeta(i); return true; } bool Number::sin() { if(isInfinite()) return false; if(isZero()) return true; value = cln::sin(value); removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::asin() { if(isInfinite()) return false; if(isZero()) return true; value = cln::asin(value); removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::sinh() { if(isInfinite()) return true; if(isZero()) return true; value = cln::sinh(value); removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::asinh() { if(isInfinite()) return true; if(isZero()) return true; value = cln::asinh(value); removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::cos() { if(isInfinite()) return false; if(isZero() && !isApproximate()) { set(1); return true; } value = cln::cos(value); removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::acos() { if(isInfinite()) return false; if(isOne() && !isApproximate()) { clear(); return true; } value = cln::acos(value); removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::cosh() { if(isInfinite()) { //setInfinity(); //return true; return false; } if(isZero() && !isApproximate()) { set(1); return true; } value = cln::cosh(value); removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::acosh() { if(isPlusInfinity() || isInfinity()) return true; if(isMinusInfinity()) return false; value = cln::acosh(value); removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::tan() { if(isInfinite()) return false; if(isZero()) return true; value = cln::tan(value); removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::atan() { if(isInfinity()) return false; if(isZero()) return true; if(isInfinite()) { pi(); divide(2); if(isMinusInfinity()) negate(); return true; } value = cln::atan(value); removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::tanh() { if(isInfinity()) return true; if(isPlusInfinity()) set(1); if(isMinusInfinity()) set(-1); if(isZero()) return true; value = cln::tanh(value); removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::atanh() { if(isInfinite()) return false; if(isZero()) return true; if(isOne()) { setPlusInfinity(); return true; } if(isMinusOne()) { setMinusInfinity(); return true; } value = cln::atanh(value); removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::ln() { if(isPlusInfinity()) return true; if(isInfinite()) return false; if(isOne() && !isApproximate()) { clear(); return true; } if(isZero()) { setMinusInfinity(); return true; } value = cln::log(value); removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::log(const Number &o) { if(isPlusInfinity()) return true; if(isInfinite()) return false; if(isOne()) { bool was_approx = b_approx || o.isApproximate(); clear(); b_approx = was_approx; return true; } if(isZero()) { bool was_approx = b_approx || o.isApproximate(); setMinusInfinity(); b_approx = was_approx; return true; } if(o.isZero()) { clear(); setPrecisionAndApproximateFrom(o); return true; } if(o.isOne()) { //setInfinity(); //return true; return false; } if(!isApproximate() && !o.isApproximate() && isFraction()) { value = -cln::log(cln::recip(value), o.internalNumber()); } else { value = cln::log(value, o.internalNumber()); } removeFloatZeroPart(); setPrecisionAndApproximateFrom(o); testApproximate(); testInteger(); return true; } bool Number::exp() { if(isInfinity()) return false; if(isPlusInfinity()) return true; if(isMinusInfinity()) { clear(); return true; } value = cln::exp(value); testApproximate(); testInteger(); return true; } bool Number::lambertW() { if(!isReal()) return false; if(isZero()) return true; cln::cl_R x = cln::realpart(value); cln::cl_R m1_div_exp1 = -1 / cln::exp1(); if(x == m1_div_exp1) { value = -1; if(!b_approx) { i_precision = PRECISION; b_approx = true; } return true; } if(x < m1_div_exp1) return false; cln::cl_R w = 0; if(x > 10) { w = cln::ln(x) - cln::ln(cln::ln(x)); } cln::cl_RA wPrec = cln::expt(cln::cl_I(10), -(PRECISION + 2)); while(true) { cln::cl_R wTimesExpW = w * cln::exp(w); cln::cl_R wPlusOneTimesExpW = (w + 1) * cln::exp(w); if(wPrec > cln::abs((x - wTimesExpW) / wPlusOneTimesExpW)) { value = w; break; } w = w - (wTimesExpW - x) / (wPlusOneTimesExpW - (w + 2) * (wTimesExpW - x) / (2 * w + 2)); } if(!b_approx) { i_precision = PRECISION; b_approx = true; } testInteger(); return true; } bool Number::gcd(const Number &o) { if(!isInteger() || !o.isInteger()) { return false; } if(isZero() && o.isZero()) { clear(); return true; } cl_I num = cln::numerator(cln::rational(cln::realpart(value))); cl_I num_o = cln::numerator(cln::rational(cln::realpart(o.internalNumber()))); value = cln::gcd(num, num_o); setPrecisionAndApproximateFrom(o); return true; } bool Number::lcm(const Number &o) { if(isInteger() && o.isInteger()) { value = cln::lcm(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); return true; } return multiply(o); } bool Number::factorial() { if(!isInteger()) { return false; } if(isNegative()) { setPlusInfinity(); return true; } if(isZero()) { set(1); return true; } else if(isOne()) { return true; } else if(isNegative()) { return false; } cln::cl_I i = cln::numerator(cln::rational(cln::realpart(value))); i = cln::minus1(i); for(; !cln::zerop(i); i = cln::minus1(i)) { value = value * i; } return true; } bool Number::multiFactorial(const Number &o) { if(o.isOne()) return factorial(); if(o.isTwo()) return doubleFactorial(); if(!isInteger() || !o.isInteger() || !o.isPositive()) { return false; } if(isZero()) { set(1, 1); return true; } else if(isOne()) { return true; } else if(isNegative()) { return false; } cln::cl_I i = cln::numerator(cln::rational(cln::realpart(value))); cln::cl_I i_o = cln::numerator(cln::rational(cln::realpart(o.internalNumber()))); i = i - i_o; for(; cln::plusp(i); i = i - i_o) { value = value * i; } return true; } bool Number::doubleFactorial() { if(!isInteger()) { return false; } if(isZero() || isMinusOne()) { set(1, 1); return true; } else if(isOne()) { return true; } else if(isNegative()) { return false; } cln::cl_I i = cln::numerator(cln::rational(cln::realpart(value))); cln::cl_I i2 = 2; i = i - i2; for(; cln::plusp(i); i = i - i2) { value = value * i; } return true; } bool Number::binomial(const Number &m, const Number &k) { if(!m.isInteger() || !k.isInteger()) return false; if(k.isNegative()) return false; if(m.isZero() || m.isNegative()) return false; if(k.isGreaterThan(m)) return false; if(k.isZero()) { set(1); } else if(k.isOne()) { set(m); setPrecisionAndApproximateFrom(k); } else if(m.equals(k)) { set(1); setPrecisionAndApproximateFrom(m); setPrecisionAndApproximateFrom(k); } else { clear(); cl_I im = cln::numerator(cln::rational(cln::realpart(m.internalNumber()))); cl_I ik = cln::numerator(cln::rational(cln::realpart(k.internalNumber()))); if(im > long(INT_MAX) || ik > long(INT_MAX)) { ik = cln::minus1(ik); Number k_fac(k); k_fac.factorial(); cl_I ithis = im; for(; !cln::zerop(ik); ik = cln::minus1(ik)) { im = cln::minus1(im); ithis = ithis * im; } value = ithis; divide(k_fac); } else { value = cln::binomial(cl_I_to_uint(im), cl_I_to_uint(ik)); } setPrecisionAndApproximateFrom(m); setPrecisionAndApproximateFrom(k); } return true; } bool Number::factorize(vector &factors) { if(isZero() || !isInteger()) return false; cl_I inr = cln::numerator(cln::rational(cln::realpart(value))); if(minusp(inr)) { inr = -inr; factors.push_back(Number(-1, 1)); } size_t prime_index = 0; cl_I last_prime = 0; bool b = true; while(b) { b = false; cl_I facmax = cln::floor1(cln::sqrt(inr)); for(; prime_index < NR_OF_PRIMES && PRIMES[prime_index] <= facmax; prime_index++) { if(cln::zerop(cln::mod(inr, PRIMES[prime_index]))) { inr = cln::exquo(inr, PRIMES[prime_index]); Number fac; fac.setInternal(PRIMES[prime_index]); factors.push_back(fac); b = true; break; } } if(prime_index == NR_OF_PRIMES) { last_prime = PRIMES[NR_OF_PRIMES - 1] + 2; prime_index++; } if(!b && prime_index > NR_OF_PRIMES) { while(!b && last_prime <= facmax) { if(cln::zerop(cln::mod(inr, last_prime))) { inr = cln::exquo(inr, last_prime); b = true; Number fac; fac.setInternal(last_prime); factors.push_back(fac); break; } last_prime = last_prime + 2; } } } if(inr != 1) { Number fac; fac.setInternal(inr); factors.push_back(fac); } return true; } bool Number::add(const Number &o, MathOperation op) { switch(op) { case OPERATION_SUBTRACT: { return subtract(o); } case OPERATION_ADD: { return add(o); } case OPERATION_MULTIPLY: { return multiply(o); } case OPERATION_DIVIDE: { return divide(o); } case OPERATION_RAISE: { return raise(o); } case OPERATION_EXP10: { return exp10(o); } case OPERATION_BITWISE_AND: { return bitAnd(o); } case OPERATION_BITWISE_OR: { return bitOr(o); } case OPERATION_BITWISE_XOR: { return bitXor(o); } case OPERATION_LOGICAL_OR: { Number nr; ComparisonResult i1 = compare(nr); ComparisonResult i2 = o.compare(nr); if(i1 == COMPARISON_RESULT_UNKNOWN || i1 == COMPARISON_RESULT_EQUAL_OR_LESS || i1 == COMPARISON_RESULT_NOT_EQUAL) i1 = COMPARISON_RESULT_UNKNOWN; if(i2 == COMPARISON_RESULT_UNKNOWN || i2 == COMPARISON_RESULT_EQUAL_OR_LESS || i2 == COMPARISON_RESULT_NOT_EQUAL) i2 = COMPARISON_RESULT_UNKNOWN; if(i1 == COMPARISON_RESULT_UNKNOWN && (i2 == COMPARISON_RESULT_UNKNOWN || i2 != COMPARISON_RESULT_LESS)) return false; if(i2 == COMPARISON_RESULT_UNKNOWN && (i1 != COMPARISON_RESULT_LESS)) return false; setTrue(i1 == COMPARISON_RESULT_LESS || i2 == COMPARISON_RESULT_LESS); return true; } case OPERATION_LOGICAL_XOR: { Number nr; ComparisonResult i1 = compare(nr); ComparisonResult i2 = o.compare(nr); if(i1 == COMPARISON_RESULT_UNKNOWN || i1 == COMPARISON_RESULT_EQUAL_OR_LESS || i1 == COMPARISON_RESULT_NOT_EQUAL) return false; if(i2 == COMPARISON_RESULT_UNKNOWN || i2 == COMPARISON_RESULT_EQUAL_OR_LESS || i2 == COMPARISON_RESULT_NOT_EQUAL) return false; if(i1 == COMPARISON_RESULT_LESS) setTrue(i2 != COMPARISON_RESULT_LESS); else setTrue(i2 == COMPARISON_RESULT_LESS); return true; } case OPERATION_LOGICAL_AND: { Number nr; ComparisonResult i1 = compare(nr); ComparisonResult i2 = o.compare(nr); if(i1 == COMPARISON_RESULT_UNKNOWN || i1 == COMPARISON_RESULT_EQUAL_OR_LESS || i1 == COMPARISON_RESULT_NOT_EQUAL) i1 = COMPARISON_RESULT_UNKNOWN; if(i2 == COMPARISON_RESULT_UNKNOWN || i2 == COMPARISON_RESULT_EQUAL_OR_LESS || i2 == COMPARISON_RESULT_NOT_EQUAL) i2 = COMPARISON_RESULT_UNKNOWN; if(i1 == COMPARISON_RESULT_UNKNOWN && (i2 == COMPARISON_RESULT_UNKNOWN || i2 == COMPARISON_RESULT_LESS)) return false; if(i2 == COMPARISON_RESULT_UNKNOWN && (i1 == COMPARISON_RESULT_LESS)) return false; setTrue(i1 == COMPARISON_RESULT_LESS && i2 == COMPARISON_RESULT_LESS); return true; } case OPERATION_EQUALS: { ComparisonResult i = compare(o); if(i == COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_EQUAL_OR_GREATER || i == COMPARISON_RESULT_EQUAL_OR_LESS) return false; setTrue(i == COMPARISON_RESULT_EQUAL); return true; } case OPERATION_GREATER: { ComparisonResult i = compare(o); switch(i) { case COMPARISON_RESULT_LESS: { setTrue(); return true; } case COMPARISON_RESULT_GREATER: {} case COMPARISON_RESULT_EQUAL_OR_GREATER: {} case COMPARISON_RESULT_EQUAL: { setFalse(); return true; } default: { return false; } } } case OPERATION_LESS: { ComparisonResult i = compare(o); switch(i) { case COMPARISON_RESULT_GREATER: { setTrue(); return true; } case COMPARISON_RESULT_LESS: {} case COMPARISON_RESULT_EQUAL_OR_LESS: {} case COMPARISON_RESULT_EQUAL: { setFalse(); return true; } default: { return false; } } } case OPERATION_EQUALS_GREATER: { ComparisonResult i = compare(o); switch(i) { case COMPARISON_RESULT_EQUAL_OR_LESS: {} case COMPARISON_RESULT_EQUAL: {} case COMPARISON_RESULT_LESS: { setTrue(); return true; } case COMPARISON_RESULT_GREATER: { setFalse(); return true; } default: { return false; } } return false; } case OPERATION_EQUALS_LESS: { ComparisonResult i = compare(o); switch(i) { case COMPARISON_RESULT_EQUAL_OR_GREATER: {} case COMPARISON_RESULT_EQUAL: {} case COMPARISON_RESULT_GREATER: { setTrue(); return true; } case COMPARISON_RESULT_LESS: { setFalse(); return true; } default: { return false; } } return false; } case OPERATION_NOT_EQUALS: { ComparisonResult i = compare(o); if(i == COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_EQUAL_OR_GREATER || i == COMPARISON_RESULT_EQUAL_OR_LESS) return false; setTrue(i == COMPARISON_RESULT_NOT_EQUAL || i == COMPARISON_RESULT_GREATER || i == COMPARISON_RESULT_LESS); return true; } } return false; } string Number::printNumerator(int base, bool display_sign, BaseDisplay base_display, bool lower_case) const { return printCL_I(cln::numerator(cln::rational(cln::realpart(value))), base, display_sign, base_display, lower_case); } string Number::printDenominator(int base, bool display_sign, BaseDisplay base_display, bool lower_case) const { return printCL_I(cln::denominator(cln::rational(cln::realpart(value))), base, display_sign, base_display, lower_case); } string Number::printImaginaryNumerator(int base, bool display_sign, BaseDisplay base_display, bool lower_case) const { return printCL_I(cln::numerator(cln::rational(cln::imagpart(value))), base, display_sign, base_display, lower_case); } string Number::printImaginaryDenominator(int base, bool display_sign, BaseDisplay base_display, bool lower_case) const { return printCL_I(cln::denominator(cln::rational(cln::imagpart(value))), base, display_sign, base_display, lower_case); } string Number::print(const PrintOptions &po, const InternalPrintStruct &ips) const { if(isApproximateType() && !isInfinite() && !isComplex()) { if((PRECISION < cln::float_format_lfloat_min && cln::zerop(cln::truncate2(MIN_PRECISION_FLOAT_RE(value)).remainder)) || (PRECISION >= cln::float_format_lfloat_min && cln::zerop(cln::truncate2(REAL_PRECISION_FLOAT_RE(value)).remainder))) { Number nr_copy(*this); nr_copy.testInteger(); return nr_copy.print(po, ips); } } if(ips.minus) *ips.minus = false; if(ips.exp_minus) *ips.exp_minus = false; if(ips.num) *ips.num = ""; if(ips.den) *ips.den = ""; if(ips.exp) *ips.exp = ""; if(ips.re) *ips.re = ""; if(ips.im) *ips.im = ""; if(po.is_approximate && isApproximate()) *po.is_approximate = true; if((po.base == BASE_SEXAGESIMAL || po.base == BASE_TIME) && isReal()) { Number nr(*this); bool neg = nr.isNegative(); nr.setNegative(false); nr.trunc(); string str = nr.printNumerator(10, false); if(po.base == BASE_SEXAGESIMAL) { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_POWER_0, po.can_display_unicode_string_arg))) { str += SIGN_POWER_0; } else { str += "o"; } } nr = *this; nr.frac(); nr *= 60; Number nr2(nr); nr.trunc(); if(po.base == BASE_TIME) { str += ":"; if(nr.isLessThan(10)) { str += "0"; } } str += nr.printNumerator(10, false); if(po.base == BASE_SEXAGESIMAL) { str += "'"; } nr2.frac(); if(!nr2.isZero() || po.base == BASE_SEXAGESIMAL) { nr2.multiply(60); nr = nr2; nr.trunc(); nr2.frac(); if(!nr2.isZero()) { if(po.is_approximate) *po.is_approximate = true; if(nr2.isGreaterThanOrEqualTo(Number(1, 2))) { nr.add(1); } } if(po.base == BASE_TIME) { str += ":"; if(nr.isLessThan(10)) { str += "0"; } } str += nr.printNumerator(10, false); if(po.base == BASE_SEXAGESIMAL) { str += "\""; } } if(ips.minus) { *ips.minus = neg; } else if(neg) { str.insert(0, "-"); } if(ips.num) *ips.num = str; return str; } string str; int base; int min_decimals = po.min_decimals; if(min_decimals < 0 || !po.use_min_decimals) min_decimals = 0; if(min_decimals > po.max_decimals && po.use_max_decimals && po.max_decimals >= 0) { min_decimals = po.max_decimals; } if(po.base <= 1 && po.base != BASE_ROMAN_NUMERALS && po.base != BASE_TIME) base = 10; else if(po.base > 36 && po.base != BASE_SEXAGESIMAL) base = 36; else base = po.base; if(isApproximateType() && base == BASE_ROMAN_NUMERALS) base = 10; int precision = PRECISION; if(b_approx && i_precision > 0 && i_precision < PRECISION) precision = i_precision; if(po.restrict_to_parent_precision && ips.parent_precision > 0 && ips.parent_precision < precision) precision = ips.parent_precision; if(isComplex()) { bool bre = hasRealPart(); if(bre) { Number re, im; re.setInternal(cln::realpart(value)); im.setInternal(cln::imagpart(value)); if(isApproximate()) { re.setApproximate(); im.setApproximate(); } str = re.print(po, ips); if(ips.re) *ips.re = str; InternalPrintStruct ips_n = ips; bool neg = false; ips_n.minus = &neg; string str2 = im.print(po, ips_n); if(ips.im) *ips.im = str2; if(*ips_n.minus) { str += " - "; } else { str += " + "; } str += str2; } else { Number im; im.setInternal(cln::imagpart(value)); if(isApproximate()) { im.setApproximate(); } str = im.print(po, ips); if(ips.im) *ips.im = str; } if(!po.short_multiplication) { if(po.spacious) { str += " * "; } else { str += "*"; } } str += "i"; if(po.is_approximate && isApproximate()) *po.is_approximate = true; if(ips.num) *ips.num = str; } else if(isInteger()) { cl_I ivalue = cln::numerator(cln::rational(cln::realpart(value))); bool neg = cln::minusp(ivalue); string mpz_str; bool rerun = false; bool exact = true; integer_rerun: mpz_str = printCL_I(ivalue, base, false, po.base_display, po.lower_case_numbers); int expo = 0; if(base == 10) { if(mpz_str.length() > 0 && (po.number_fraction_format == FRACTION_DECIMAL || po.number_fraction_format == FRACTION_DECIMAL_EXACT)) { expo = mpz_str.length() - 1; } else if(mpz_str.length() > 0) { for(int i = mpz_str.length() - 1; i >= 0; i--) { if(mpz_str[i] != '0') { break; } expo++; } } } if(po.min_exp == EXP_PRECISION) { if((expo > -precision && expo < precision) || (expo < 3 && expo > -3 && PRECISION >= 3)) { expo = 0; } } else if(po.min_exp == EXP_BASE_3) { expo -= expo % 3; } else if(po.min_exp != 0) { if(expo > -po.min_exp && expo < po.min_exp) { expo = 0; } } else { expo = 0; } bool dp_added = false; if(!rerun && !cln::zerop(ivalue)) { int precision2 = precision; if(base != 10) { Number precmax(10); precmax.raise(precision); precmax--; precmax.log(base); precmax.floor(); precision2 = precmax.intValue(); } precision2 -= mpz_str.length(); if(po.use_max_decimals && po.max_decimals >= 0 && po.max_decimals < expo && po.max_decimals - expo < precision2) { cln::cl_RA_div_t div = cln::floor2(ivalue / cln::expt_pos(cln::cl_I(base), -(po.max_decimals - expo))); if(!cln::zerop(div.remainder)) { ivalue = div.quotient; if(po.round_halfway_to_even && cln::evenp(ivalue)) { if(div.remainder * base > cln::cl_I(base) / cln::cl_I(2)) { ivalue = cln::plus1(ivalue); } } else { if(div.remainder * base >= cln::cl_I(base) / cln::cl_I(2)) { ivalue = cln::plus1(ivalue); } } ivalue = ivalue * cln::expt_pos(cln::cl_I(base), -(po.max_decimals - expo)); exact = false; rerun = true; goto integer_rerun; } } else if(precision2 < 0 && (expo > 0 || isApproximate() || (ips.parent_approximate && po.restrict_to_parent_precision))) { cln::cl_RA_div_t div = cln::floor2(ivalue / cln::expt_pos(cln::cl_I(base), -precision2)); if(!cln::zerop(div.remainder)) { ivalue = div.quotient; if(po.round_halfway_to_even && cln::evenp(ivalue)) { if(div.remainder * base > cln::cl_I(base) / cln::cl_I(2)) { ivalue = cln::plus1(ivalue); } } else { if(div.remainder * base >= cln::cl_I(base) / cln::cl_I(2)) { ivalue = cln::plus1(ivalue); } } ivalue = ivalue * cln::expt_pos(cln::cl_I(base), -precision2); exact = false; rerun = true; goto integer_rerun; } } } int decimals = 0; if(expo > 0) { if(po.number_fraction_format == FRACTION_DECIMAL) { mpz_str.insert(mpz_str.length() - expo, po.decimalpoint()); dp_added = true; decimals = expo; } else if(po.number_fraction_format == FRACTION_DECIMAL_EXACT) { mpz_str.insert(mpz_str.length() - expo, po.decimalpoint()); dp_added = true; decimals = expo; } else { mpz_str = mpz_str.substr(0, mpz_str.length() - expo); } } str = ""; if(ips.minus) { *ips.minus = neg; } else if(neg) { str += "-"; } str += mpz_str; if(base != BASE_ROMAN_NUMERALS && (po.number_fraction_format == FRACTION_DECIMAL || po.number_fraction_format == FRACTION_DECIMAL_EXACT)) { int pos = str.length() - 1; for(; pos >= (int) str.length() + min_decimals - decimals; pos--) { if(str[pos] != '0') { break; } } if(pos + 1 < (int) str.length()) str = str.substr(0, pos + 1); if(min_decimals > decimals) { if(decimals <= 0) { str += po.decimalpoint(); dp_added = true; } while(min_decimals > decimals) { decimals++; str += "0"; } } if(str[str.length() - 1] == po.decimalpoint()[0]) { str.erase(str.end() - 1); dp_added = false; } } if(!exact && po.is_approximate) *po.is_approximate = true; if(po.show_ending_zeroes && (isApproximate() || !exact || (ips.parent_approximate && po.restrict_to_parent_precision)) && (!po.use_max_decimals || po.max_decimals < 0 || po.max_decimals > decimals)) { if(base != 10) { Number precmax(10); precmax.raise(precision); precmax--; precmax.log(base); precmax.floor(); precision = precmax.intValue(); } precision -= str.length(); if(dp_added) { precision += 1; } else if(precision > 0) { str += po.decimalpoint(); } for(; precision > 0 && (!po.use_max_decimals || po.max_decimals < 0 || po.max_decimals > decimals); precision--) { decimals++; str += "0"; } } if(expo != 0) { if(ips.exp) { if(ips.exp_minus) { *ips.exp_minus = expo < 0; if(expo < 0) expo = -expo; } *ips.exp = i2s(expo); } else { if(po.lower_case_e) str += "e"; else str += "E"; str += i2s(expo); } } if(ips.num) *ips.num = str; } else if(isInfinity()) { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_INFINITY, po.can_display_unicode_string_arg))) { str = SIGN_INFINITY; } else { str = _("infinity"); } } else if(isPlusInfinity()) { str = "("; str += "+"; if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_INFINITY, po.can_display_unicode_string_arg))) { str += SIGN_INFINITY; } else { str += _("infinity"); } str += ")"; } else if(isMinusInfinity()) { str = "("; str += "-"; if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_INFINITY, po.can_display_unicode_string_arg))) { str += SIGN_INFINITY; } else { str += _("infinity"); } str += ")"; } else { if(base != BASE_ROMAN_NUMERALS && (isApproximateType() || po.number_fraction_format == FRACTION_DECIMAL || po.number_fraction_format == FRACTION_DECIMAL_EXACT)) { cln::cl_I num, d = cln::denominator(cln::rational(cln::realpart(value))), remainder = 0, remainder2 = 0, exp = 0; cln::cl_I_div_t div; bool neg = cln::minusp(cln::realpart(value)); if(neg) { num = -cln::numerator(cln::rational(cln::realpart(value))); } else { num = cln::numerator(cln::rational(cln::realpart(value))); } int l10 = 0; div = cln::truncate2(num, d); remainder = div.remainder; num = div.quotient; bool exact = cln::zerop(remainder); vector remainders; bool infinite_series = false; if(base != 10) { Number precmax(10); precmax.raise(precision); precmax--; precmax.log(base); precmax.floor(); precision = precmax.intValue(); } bool started = false; int expo = 0; int precision2 = precision; if(!cln::zerop(num)) { str = printCL_I(num, base, true, BASE_DISPLAY_NONE); if(base != 10) { expo = 0; } else { expo = str.length() - 1; if(po.min_exp == EXP_PRECISION) { if((expo > -precision && expo < precision) || (expo < 3 && expo > -3 && PRECISION >= 3)) { expo = 0; } } else if(po.min_exp == EXP_BASE_3) { expo -= expo % 3; } else if(po.min_exp != 0) { if(expo > -po.min_exp && expo < po.min_exp) { expo = 0; } } else { expo = 0; } } precision2 -= str.length(); if(po.use_max_decimals && po.max_decimals >= 0 && po.max_decimals < expo && po.max_decimals - expo < precision2) { cln::cl_R_div_t divr = cln::floor2(cln::realpart(value) / cln::expt_pos(cln::cl_I(base), -(po.max_decimals - expo))); if(!cln::zerop(divr.remainder)) { num = divr.quotient; if(po.round_halfway_to_even && cln::evenp(num)) { if(divr.remainder * base > cln::cl_I(base) / cln::cl_I(2)) { num = cln::plus1(num); } } else { if(divr.remainder * base >= cln::cl_I(base) / cln::cl_I(2)) { num = cln::plus1(num); } } num = num * cln::expt_pos(cln::cl_I(base), -(po.max_decimals - expo)); exact = false; if(neg) num = -num; } remainder = 0; } else if(precision2 < 0) { cln::cl_R_div_t divr = cln::floor2(cln::realpart(value) / cln::expt_pos(cln::cl_I(base), -precision2)); if(!cln::zerop(divr.remainder)) { num = divr.quotient; if(po.round_halfway_to_even && cln::evenp(num)) { if(divr.remainder * base > cln::cl_I(base) / cln::cl_I(2)) { num = cln::plus1(num); } } else { if(divr.remainder * base >= cln::cl_I(base) / cln::cl_I(2)) { num = cln::plus1(num); } } num = num * cln::expt_pos(cln::cl_I(base), -precision2); exact = false; if(neg) num = -num; } remainder = 0; } started = true; } if(!exact && po.use_max_decimals && po.max_decimals >= 0 && precision2 > po.max_decimals - expo) precision2 = po.max_decimals - expo; bool try_infinite_series = po.indicate_infinite_series && !isApproximateType(); while(!exact && precision2 > 0) { if(try_infinite_series) { remainders.push_back(remainder); } remainder = remainder * base; div = cln::truncate2(remainder, d); remainder2 = div.remainder; remainder = div.quotient; exact = cln::zerop(remainder2); if(!started) { started = !cln::zerop(remainder); } if(started) { num = num * base; num = num + remainder; } l10++; remainder = remainder2; if(try_infinite_series && !exact) { for(size_t i = 0; i < remainders.size(); i++) { if(remainders[i] == remainder) { infinite_series = true; try_infinite_series = false; break; } } } if(started) { precision2--; } } remainders.clear(); if(!exact && !infinite_series) { remainder = remainder * base; div = cln::truncate2(remainder, d); remainder2 = div.remainder; remainder = div.quotient; if(po.round_halfway_to_even && cln::evenp(num)) { if(remainder > cl_I(base) / cl_I(2)) { num = cln::plus1(num); } } else { if(remainder >= cl_I(base) / cl_I(2)) { num = cln::plus1(num); } } } if(!exact && !infinite_series) { if(po.number_fraction_format == FRACTION_DECIMAL_EXACT && !isApproximate()) { PrintOptions po2 = po; po2.number_fraction_format = FRACTION_FRACTIONAL; return print(po2, ips); } if(po.is_approximate) *po.is_approximate = true; } str = printCL_I(num, base, true, BASE_DISPLAY_NONE, po.lower_case_numbers); if(base == 10) { expo = str.length() - l10 - 1; if(po.min_exp == EXP_PRECISION) { if((expo > -precision && expo < precision) || (expo < 3 && expo > -3 && PRECISION >= 3)) { expo = 0; } } else if(po.min_exp == EXP_BASE_3) { expo -= expo % 3; } else if(po.min_exp != 0) { if(expo > -po.min_exp && expo < po.min_exp) { expo = 0; } } else { expo = 0; } } if(expo != 0) { l10 += expo; } if(l10 > 0) { l10 = str.length() - l10; if(l10 < 1) { str.insert(str.begin(), 1 - l10, '0'); l10 = 1; } str.insert(l10, po.decimalpoint()); int l2 = 0; while(str[str.length() - 1 - l2] == '0') { l2++; } if(l2 > 0) { str = str.substr(0, str.length() - l2); } if(str[str.length() - 1] == po.decimalpoint()[0]) { str.erase(str.end() - 1); } } int decimals = 0; if(l10 > 0) { decimals = str.length() - l10 - 1; } if(str.empty()) { str = "0"; } if(min_decimals > decimals) { if(decimals <= 0) { str += po.decimalpoint(); decimals = 0; } for(; decimals < min_decimals; decimals++) { str += "0"; } } if(str[str.length() - 1] == po.decimalpoint()[0]) { str.erase(str.end() - 1); } if(po.show_ending_zeroes && !infinite_series && (isApproximate() || !exact || (ips.parent_approximate && po.restrict_to_parent_precision)) && (!po.use_max_decimals || po.max_decimals < 0 || po.max_decimals > decimals)) { precision -= str.length(); if(decimals > 0) { precision += 1; } else if(precision > 0) { str += po.decimalpoint(); } for(; precision > 0 && (!po.use_max_decimals || po.max_decimals < 0 || po.max_decimals > decimals); precision--) { decimals++; str += "0"; } } if(infinite_series) { str += "..."; } if(expo != 0) { if(ips.exp) { if(ips.exp_minus) { *ips.exp_minus = expo < 0; if(expo < 0) expo = -expo; } *ips.exp = i2s(expo); } else { if(po.lower_case_e) str += "e"; else str += "E"; str += i2s(expo); } } switch(po.base_display) { case BASE_DISPLAY_NORMAL: { if(base == 16) { str.insert(0, "0x"); } else if(base == 8) { str.insert(0, "0"); } break; } case BASE_DISPLAY_ALTERNATIVE: { if(base == 16) { str.insert(0, "0x0"); } else if(base == 8) { str.insert(0, "0"); } else if(base == 2) { str.insert(0, "0b00"); } break; } default: {} } if(ips.minus) { *ips.minus = neg; } else if(neg) { str.insert(0, "-"); } if(ips.num) *ips.num = str; } else { Number num, den; num.setInternal(cln::numerator(cln::rational(cln::realpart(value)))); den.setInternal(cln::denominator(cln::rational(cln::realpart(value)))); if(isApproximate()) { num.setApproximate(); den.setApproximate(); } str = num.print(po, ips); if(ips.num) *ips.num = str; if(po.spacious) str += " "; if(po.use_unicode_signs && po.division_sign == DIVISION_SIGN_DIVISION && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_DIVISION, po.can_display_unicode_string_arg))) { str += SIGN_DIVISION; } else if(po.use_unicode_signs && po.division_sign == DIVISION_SIGN_DIVISION_SLASH && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_DIVISION_SLASH, po.can_display_unicode_string_arg))) { str += SIGN_DIVISION_SLASH; } else { str += "/"; } if(po.spacious) str += " "; InternalPrintStruct ips_n = ips; ips_n.minus = NULL; string str2 = den.print(po, ips_n); if(ips.den) *ips.den = str2; str += str2; if(po.is_approximate && isApproximate()) *po.is_approximate = true; } } return str; } libqalculate-0.9.7/libqalculate/Calculator.h0000644000175100017510000013532211320653617016032 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #ifndef CALCULATOR_H #define CALCULATOR_H #include #include #include /** @file */ /** \mainpage Index * * \section intro_sec Introduction * * libqalculate is math libary for expression evaluation with units, variables and functions support and CAS functionality. * * The main parts of the library is the almighty Calculator class, the MathStructure class for mathematical expressions and classes for objects in an epxression, * mostly of the class Numbers and sub classes of ExpressionItem. * * A simple application using libqalculate need only create a calculator object, perhaps load definitions (functions, variables, units, etc.) and use the calculate function as follows: * \code new Calculator(); * CALCULATOR->loadGlobalDefinitions(); * CALCULATOR->loadLocalDefinitions(); * EvaluationOptions eo; * MathStructure result = CALCULATOR->calculate("1 + 1", eo);\endcode * * More complex usage mainly involves manipulating objects of the MathStructure class directly. * * To display the resulting expression you will normally use MathStructure::format() followed by MathStructure::print() as follows: * \code PrintOptions po; * result.format(po); * string result_str = result.print(po); \endcode * * Central to the flexiblity of libqalculate is the many options passed to evaluating and display functions with EvaluationOptions and PrintOptions. * * \section usage_sec Using the library * * libqalculate uses pkg-config. * * For a simple program use pkg-config on the command line: * \code c++ `pkg-config --cflags --libs libqalculate` hello.c -o hello \endcode * * If the program uses autoconf, put the following in configure.in: * \code PKG_CHECK_MODULES(QALCULATE, [ * libqalculate >= 0.9.7 * ]) * AC_SUBST(QALCULATE_CFLAGS) * AC_SUBST(QALCULATE_LIBS) \endcode */ typedef vector p_type; /// Parameters passed to plotting functions. struct PlotParameters { /// Title label. string title; /// Y-axis label. string y_label; /// X-axis label. string x_label; /// Image to save plot to. If empty shows plot in a window on the screen. string filename; /// The image type to save as. Set to PLOT_FILETYPE_AUTO to guess from file extension. PlotFileType filetype; /// Font used for text string font; /// Set to true for colored plot, false for monochrome. Default: true bool color; /// If the minimum y-axis value shall be set automatically (otherwise uses y_min). Default: true bool auto_y_min; /// If the minimum x-axis value shall be set automatically (otherwise uses x_min). Default: true bool auto_x_min; /// If the maximum y-axis value shall be set automatically (otherwise uses y_max). Default: true bool auto_y_max; /// If the maximum x-axis value shall be set automatically (otherwise uses x_max). Default: true bool auto_x_max; /// Minimum y-axis value. float y_min; /// Minimum x-axis value. float x_min; /// Maximum y-axis value. float y_max; /// Maximum x-axis value. float x_max; /// If a logarithimic scale shall be used for the y-axis. Default: false bool y_log; /// If a logarithimic scale shall be used for the x-axis. Default: false bool x_log; /// Logarithimic base for the y-axis. Default: 10 int y_log_base; /// Logarithimic base for the x-axis. Default: 10 int x_log_base; /// If a grid shall be shown in the plot. Default: false bool grid; /// Width of lines. Default: 2 int linewidth; /// If the plot shall be surrounded by borders on all sides (not just axis). Default: false bool show_all_borders; /// Where the plot legend shall be placed. Default: PLOT_LEGEND_TOP_RIGHT PlotLegendPlacement legend_placement; PlotParameters(); }; /// Parameters for plot data series. struct PlotDataParameters { /// Title label. string title; /// Plot smoothing. PlotSmoothing smoothing; /// Plot style PlotStyle style; /// Use scale on second y-axis bool yaxis2; /// Use scale on second x-axis bool xaxis2; PlotDataParameters(); }; ///Message types typedef enum { MESSAGE_INFORMATION, MESSAGE_WARNING, MESSAGE_ERROR } MessageType; /// A message with information to the user. Primarily used for errors and warnings. class CalculatorMessage { protected: string smessage; MessageType mtype; public: CalculatorMessage(string message_, MessageType type_ = MESSAGE_WARNING); CalculatorMessage(const CalculatorMessage &e); string message() const; const char* c_message() const; MessageType type() const; }; #include enum { ELEMENT_CLASS_NOT_DEFINED, ALKALI_METALS, ALKALI_EARTH_METALS, LANTHANIDES, ACTINIDES, TRANSITION_METALS, METALS, METALLOIDS, NONMETALS, HALOGENS, NOBLE_GASES, TRANSACTINIDES }; struct Element { string symbol, name; int number, group; string weight; int x_pos, y_pos; }; #define UFV_LENGTHS 20 /// The almighty calculator class. /** The calculator class is responsible for loading functions, variables and units, and keeping track of them, as well as parsing expressions and much more. A calculator object must be created before any other Qalculate! class is used. There should never be more than one calculator object, accessed with CALCULATOR. * * A simple application using libqalculate need only create a calculator object, perhaps load definitions (functions, variables, units, etc.) and use the calculate function as follows: * \code new Calculator(); * CALCULATOR->loadGlobalDefinitions(); * CALCULATOR->loadLocalDefinitions(); * MathStructure result = CALCULATOR->calculate("1 + 1");\endcode */ class Calculator { protected: vector messages; int ianglemode; int i_precision; char vbuffer[200]; vector ufvl; vector ufvl_t; vector ufvl_i; vector ufv[4][UFV_LENGTHS]; vector ufv_i[4][UFV_LENGTHS]; vector data_sets; Sgi::hash_map id_structs; Sgi::hash_map ids_p; vector freed_ids; size_t ids_i; vector signs; vector real_signs; vector default_signs; vector default_real_signs; char *saved_locale; int disable_errors_ref; vector stopped_errors_count; vector stopped_warnings_count; vector stopped_messages_count; pthread_t calculate_thread; pthread_attr_t calculate_thread_attr; pthread_t print_thread; pthread_attr_t print_thread_attr; bool b_functions_was, b_variables_was, b_units_was, b_unknown_was, b_calcvars_was, b_rpn_was; string NAME_NUMBER_PRE_S, NAME_NUMBER_PRE_STR, DOT_STR, DOT_S, COMMA_S, COMMA_STR, ILLEGAL_IN_NAMES, ILLEGAL_IN_UNITNAMES, ILLEGAL_IN_NAMES_MINUS_SPACE_STR; bool b_argument_errors; bool exchange_rates_warning_issued; int has_gnomevfs; bool b_gnuplot_open; string gnuplot_cmdline; FILE *gnuplot_pipe, *calculate_pipe_r, *calculate_pipe_w, *print_pipe_r, *print_pipe_w; bool local_to; Assumptions *default_assumptions; vector deleted_variables; vector deleted_functions; vector deleted_units; bool b_save_called; string per_str, times_str, plus_str, minus_str, and_str, AND_str, or_str, OR_str, XOR_str; size_t per_str_len, times_str_len, plus_str_len, minus_str_len, and_str_len, AND_str_len, or_str_len, OR_str_len, XOR_str_len; vector rpn_stack; bool calculateRPN(MathStructure *mstruct, int command, size_t index, int msecs, const EvaluationOptions &eo); bool calculateRPN(string str, int command, size_t index, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division); public: KnownVariable *v_pi, *v_e, *v_i, *v_inf, *v_pinf, *v_minf, *v_undef; UnknownVariable *v_x, *v_y, *v_z; MathFunction *f_vector, *f_sort, *f_rank, *f_limits, *f_component, *f_dimension, *f_merge_vectors; MathFunction *f_matrix, *f_matrix_to_vector, *f_area, *f_rows, *f_columns, *f_row, *f_column, *f_elements, *f_element, *f_transpose, *f_identity, *f_determinant, *f_permanent, *f_adjoint, *f_cofactor, *f_inverse; MathFunction *f_factorial, *f_factorial2, *f_multifactorial, *f_binomial; MathFunction *f_xor, *f_bitxor, *f_even, *f_odd, *f_shift; MathFunction *f_abs, *f_gcd, *f_lcm, *f_signum, *f_round, *f_floor, *f_ceil, *f_trunc, *f_int, *f_frac, *f_rem, *f_mod; MathFunction *f_polynomial_unit, *f_polynomial_primpart, *f_polynomial_content, *f_coeff, *f_lcoeff, *f_tcoeff, *f_degree, *f_ldegree; MathFunction *f_re, *f_im, *f_arg, *f_numerator, *f_denominator; MathFunction *f_sqrt, *f_sq; MathFunction *f_exp; MathFunction *f_ln, *f_logn; MathFunction *f_lambert_w; MathFunction *f_sin, *f_cos, *f_tan, *f_asin, *f_acos, *f_atan, *f_sinh, *f_cosh, *f_tanh, *f_asinh, *f_acosh, *f_atanh, *f_radians_to_default_angle_unit; MathFunction *f_zeta, *f_gamma, *f_beta; MathFunction *f_total, *f_percentile, *f_min, *f_max, *f_mode, *f_rand; MathFunction *f_isodate, *f_localdate, *f_timestamp, *f_stamptodate, *f_days, *f_yearfrac, *f_week, *f_weekday, *f_month, *f_day, *f_year, *f_yearday, *f_time, *f_add_days, *f_add_months, *f_add_years; MathFunction *f_bin, *f_oct, *f_hex, *f_base, *f_roman; MathFunction *f_ascii, *f_char; MathFunction *f_length, *f_concatenate; MathFunction *f_replace, *f_stripunits; MathFunction *f_genvector, *f_for, *f_sum, *f_product, *f_process, *f_process_matrix, *f_csum, *f_if, *f_is_number, *f_is_real, *f_is_rational, *f_is_integer, *f_represents_number, *f_represents_real, *f_represents_rational, *f_represents_integer, *f_function, *f_select; MathFunction *f_diff, *f_integrate, *f_solve, *f_multisolve; MathFunction *f_error, *f_warning, *f_message, *f_save, *f_load, *f_export, *f_title; MathFunction *f_register, *f_stack; MathFunction *f_uncertainty; Unit *u_rad, *u_gra, *u_deg, *u_euro; DecimalPrefix *decimal_null_prefix; BinaryPrefix *binary_null_prefix; bool place_currency_code_before, place_currency_sign_before; bool place_currency_code_before_negative, place_currency_sign_before_negative; bool default_dot_as_separator; bool b_busy, calculate_thread_stopped, print_thread_stopped; string expression_to_calculate, tmp_print_result; PrintOptions tmp_printoptions; EvaluationOptions tmp_evaluationoptions; MathStructure *tmp_parsedstruct; MathStructure *tmp_tostruct; MathStructure *tmp_rpn_mstruct; bool tmp_maketodivision; int tmp_proc_command; size_t tmp_rpnindex; PrintOptions save_printoptions; vector variables; vector functions; vector units; vector prefixes; vector decimal_prefixes; vector binary_prefixes; /** @name Constructor */ //@{ Calculator(); virtual ~Calculator(); //@} /** @name Functions for calculating expressions. */ //@{ /** Calculates an expression. The expression should be unlocalized first with unlocalizeExpression(). * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param[out] mstruct Math structure to fill with the result. * @param str Expression. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the result of the parsing of the expression. * @param[out] to_struct NULL or a math structure to fill with unit expression parsed after "to". * @param make_to_division If true, the expression after "to" will be interpreted as a unit epxression to convert the result to. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool calculate(MathStructure *mstruct, string str, int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL, MathStructure *to_struct = NULL, bool make_to_division = true); /** Calculates an expression. The expression should be unlocalized first with unlocalizeExpression(). * * @param str Expression. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the result of the parsing of the expression. * @param[out] to_struct NULL or a math structure to fill with unit expression parsed after "to". * @param make_to_division If true, the expression after "to" will be interpreted as a unit epxression to convert the result to. * @returns The result of the calculation. */ MathStructure calculate(string str, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL, MathStructure *to_struct = NULL, bool make_to_division = true); string printMathStructureTimeOut(const MathStructure &mstruct, int msecs = 100000, const PrintOptions &op = default_print_options); int testCondition(string expression); //@} /** @name Functions for handling of threaded calculations */ //@{ /** Aborts the current calculation. */ void abort(); /** Aborts the current calculation. Used from within the calculation thread. */ void abort_this(); /** Returns true if the calculate or print thread is busy. */ bool busy(); /** Saves the state of the calculator. Used internally to be able to restore the state after aborted calculation. */ void saveState(); /** Restores the saved state of the calculator. Used internally to restore the state after aborted calculation. */ void restoreState(); /** Clears all stored values. Used internally after aborted calculation. */ void clearBuffers(); /** Terminate calculation and print threads if started. Do not use to terminate calculation. */ void terminateThreads(); //@} /** @name Functions for manipulation of the RPN stack. */ //@{ /** Evaluates a value on the RPN stack. * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param index Index, starting at 1, on the RPN stack. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool calculateRPNRegister(size_t index, int msecs, const EvaluationOptions &eo = default_evaluation_options); /** Applies a mathematical operation to the first and second value on the RPN stack. The the second value is changed with input from the first value. * For example, with OPERATION_SUBTRACT the first value is subtracted from the second. The first value on the stack is removed. * If not enough registers is available, then zeros are added. * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param op Operation. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool calculateRPN(MathOperation op, int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies a mathematical operation to the first value on the RPN stack. The value is set as the first argument of the function. * If no register is available, then zero is added. * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param f Mathematical function. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool calculateRPN(MathFunction *f, int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies bitwise not to the first value on the RPN stack. * If no register is available, then zero is added. * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool calculateRPNBitwiseNot(int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies logical not to the first value on the RPN stack. * If no register is available, then zero is added. * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool calculateRPNLogicalNot(int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies a mathematical operation to the first and second value on the RPN stack. The the second value is changed with input from the first value. * For example, with OPERATION_SUBTRACT the first value is subtracted from the second. The first value on the stack is removed. * If not enough registers is available, then zeros are added. * * @param op Operation. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns The first value on the stack. */ MathStructure *calculateRPN(MathOperation op, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies a mathematical operation to the first value on the RPN stack. The value is set as the first argument of the function. * If no register is available, then zero is added. * * @param f Mathematical function. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns The first value on the stack. */ MathStructure *calculateRPN(MathFunction *f, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies bitwise not to the first value on the RPN stack. * If no register is available, then zero is added. * * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns The first value on the stack. */ MathStructure *calculateRPNBitwiseNot(const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies logical not to the first value on the RPN stack. * If no register is available, then zero is added. * * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns The first value on the stack. */ MathStructure *calculateRPNLogicalNot(const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Evaluates a value and adds the result first on the RPN stack. * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param mstruct Value. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation of the expression. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool RPNStackEnter(MathStructure *mstruct, int msecs, const EvaluationOptions &eo = default_evaluation_options); /** Calculates an expression and adds the result first on the RPN stack. The expression should be unlocalized first with unlocalizeExpression(). * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param str Expression. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the result of the parsing of the expression. * @param[out] to_struct NULL or a math structure to fill with unit expression parsed after "to". * @param make_to_division If true, the expression after "to" will be interpreted as a unit epxression to convert the result to. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool RPNStackEnter(string str, int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL, MathStructure *to_struct = NULL, bool make_to_division = true); /** Adds a value first on the RPN stack. * * @param mstruct Value. * @param eval If true, the the mathematical structure will be evaluated first. */ void RPNStackEnter(MathStructure *mstruct, bool eval = false, const EvaluationOptions &eo = default_evaluation_options); /** Calculates an expression adds the result first on the RPN stack. The expression should be unlocalized first with unlocalizeExpression(). * * @param str Expression. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the result of the parsing of the expression. * @param[out] to_struct NULL or a math structure to fill with unit expression parsed after "to". * @param make_to_division If true, the expression after "to" will be interpreted as a unit epxression to convert the result to. */ void RPNStackEnter(string str, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL, MathStructure *to_struct = NULL, bool make_to_division = true); bool setRPNRegister(size_t index, MathStructure *mstruct, int msecs, const EvaluationOptions &eo = default_evaluation_options); bool setRPNRegister(size_t index, string str, int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL, MathStructure *to_struct = NULL, bool make_to_division = true); void setRPNRegister(size_t index, MathStructure *mstruct, bool eval = false, const EvaluationOptions &eo = default_evaluation_options); void setRPNRegister(size_t index, string str, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL, MathStructure *to_struct = NULL, bool make_to_division = true); void deleteRPNRegister(size_t index); MathStructure *getRPNRegister(size_t index = 1) const; size_t RPNStackSize() const; void clearRPNStack(); void moveRPNRegister(size_t old_index, size_t new_index); void moveRPNRegisterUp(size_t index); void moveRPNRegisterDown(size_t index); //@} /** @name Functions for expression parsing. */ //@{ /** Returns a localized expressions. Affects decimal signs and argument separators. * * @param str The expression to localize. * @returns A localized expression. */ string localizeExpression(string str) const; /** Returns an unlocalized expressions. Affects decimal signs and argument separators. * * @param str The expression to unlocalize. * @returns An unlocalized expression. */ string unlocalizeExpression(string str, const ParseOptions &po = default_parse_options) const; /** Split an expression string after and before " to ". * * @param[out] str The expression. Will be set to the string before " to ". * @param[out] to_str Will be set to the string after " to ". * @param eo Options for the evaluation and parsing of the expression (nothing will be done if units are not enabled). * @returns true if " to " was found and the expression split. */ bool separateToExpression(string &str, string &to_str, const EvaluationOptions &eo) const; void parseSigns(string &str) const; /** Parse an expression and place in a MathStructure object. * * @param str Expression * @param po Parse options. * @returns MathStructure with result of parse. */ MathStructure parse(string str, const ParseOptions &po = default_parse_options); void parse(MathStructure *mstruct, string str, const ParseOptions &po = default_parse_options); bool parseNumber(MathStructure *mstruct, string str, const ParseOptions &po = default_parse_options); bool parseOperators(MathStructure *mstruct, string str, const ParseOptions &po = default_parse_options); bool parseAdd(string &str, MathStructure *mstruct, const ParseOptions &po, MathOperation s); bool parseAdd(string &str, MathStructure *mstruct, const ParseOptions &po); //@} /** @name Functions converting epxressions between units. */ //@{ /** Converts to a unit expression. * The converted value is evaluated. * * @param mstruct The value to convert. * @param composite_ Unit expression. * @param eo Evaluation options. * @returns Converted value. */ MathStructure convert(const MathStructure &mstruct, string composite_, const EvaluationOptions &eo = default_evaluation_options); /** Converts to a unit. * The converted value is evaluated. * * @param mstruct The value to convert. * @param composite_ Unit to convert to. * @param eo Evaluation options. * @param always_convert ... * @returns Converted value. */ MathStructure convert(const MathStructure &mstruct, Unit *to_unit, const EvaluationOptions &eo = default_evaluation_options, bool always_convert = true); MathStructure convert(double value, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo = default_evaluation_options); MathStructure convert(string str, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo = default_evaluation_options); MathStructure convertToBaseUnits(const MathStructure &mstruct, const EvaluationOptions &eo = default_evaluation_options); Unit *getBestUnit(Unit *u, bool allow_only_div = false); MathStructure convertToBestUnit(const MathStructure &mstruct, const EvaluationOptions &eo = default_evaluation_options); MathStructure convertToCompositeUnit(const MathStructure &mstruct, CompositeUnit *cu, const EvaluationOptions &eo = default_evaluation_options, bool always_convert = true); //@} /** @name Functions for default assumptions for unknown variables and symbols */ //@{ /** Set assumptions for objects without own assumptions (unknown variables and symbols). */ void setDefaultAssumptions(Assumptions *ass); /** Returns the default assumptions for objects without own assumptions (unknown variables and symbols). */ Assumptions *defaultAssumptions(); //@} /** @name Functions for retrieval of angle units */ //@{ /** Returns the gradians unit. */ Unit *getGraUnit(); /** Returns the radians unit. */ Unit *getRadUnit(); /** Returns the degrees unit. */ Unit *getDegUnit(); //@} /** @name Functions for finding a suitable prefix. */ //@{ /** Returns a decimal prefix with exactly the provided value, that fulfils the condition prefix->exponent(exp) == exp10. * * @param exp10 Base-10 exponent of the requested prefix. * @param exp The exponent of the unit. * @returns A prefix or NULL if not found. */ DecimalPrefix *getExactDecimalPrefix(int exp10, int exp = 1) const; /** Returns a binary prefix with exactly the provided value, that fulfils the condition prefix->exponent(exp) == exp2. * * @param exp2 Base-2 exponent of the requested prefix. * @param exp The exponent of the unit. * @returns A prefix or NULL if not found. */ BinaryPrefix *getExactBinaryPrefix(int exp2, int exp = 1) const; /** Returns a prefix with exactly the provided value, that fulfils the condition prefix->value(exp) == o. * * @param o Value of the requested prefix. * @param exp The exponent of the unit. * @returns A prefix or NULL if not found. */ Prefix *getExactPrefix(const Number &o, int exp = 1) const; /** Returns the nearest decimal prefix for a value. * * @param exp10 Base-10 exponent of the value. * @param exp The exponent of the unit. * @returns A prefix or NULL if no decimal prefix is available. */ DecimalPrefix *getNearestDecimalPrefix(int exp10, int exp = 1) const; /** Returns the best suited decimal prefix for a value. * * @param exp10 Base-10 exponent of the value. * @param exp The exponent of the unit. * @param all_prefixes If false, prefixes which is not a multiple of thousand (centi, deci, deka, hekto) will be skipped. * @returns A prefix or NULL if the unit should be left without prefix. */ DecimalPrefix *getBestDecimalPrefix(int exp10, int exp = 1, bool all_prefixes = true) const; /** Returns the best suited decimal prefix for a value. * * @param exp10 Base-10 exponent of the value. * @param exp The exponent of the unit. * @param all_prefixes If false, prefixes which is not a multiple of thousand (centi, deci, deka, hekto) will be skipped. * @returns A prefix or NULL if the unit should be left without prefix. */ DecimalPrefix *getBestDecimalPrefix(const Number &exp10, const Number &exp, bool all_prefixes = true) const; /** Returns the nearest binary prefix for a value. * * @param exp10 Base-2 exponent of the value. * @param exp The exponent of the unit. * @returns A prefix or NULL if no binary prefix is available. */ BinaryPrefix *getNearestBinaryPrefix(int exp2, int exp = 1) const; /** Returns the best suited binary prefix for a value. * * @param exp10 Base-2 exponent of the value. * @param exp The exponent of the unit. * @returns A prefix or NULL if the unit should be left without prefix. */ BinaryPrefix *getBestBinaryPrefix(int exp2, int exp = 1) const; /** Returns the best suited binary prefix for a value. * * @param exp10 Base-2 exponent of the value. * @param exp The exponent of the unit. * @returns A prefix or NULL if the unit should be left without prefix. */ BinaryPrefix *getBestBinaryPrefix(const Number &exp2, const Number &exp) const; /** Add a new prefix to the calculator. */ Prefix *addPrefix(Prefix *p); /** Used internally. */ void prefixNameChanged(Prefix *p, bool new_item = false); //@} /** @name Functions for managing functions, variables, units, prefixes and data sets. */ //@{ void expressionItemActivated(ExpressionItem *item); void expressionItemDeactivated(ExpressionItem *item); void expressionItemDeleted(ExpressionItem *item); void nameChanged(ExpressionItem *item, bool new_item = false); void deleteName(string name_, ExpressionItem *object = NULL); void deleteUnitName(string name_, Unit *object = NULL); Unit* addUnit(Unit *u, bool force = true, bool check_names = true); void delPrefixUFV(Prefix *object); void delUFV(ExpressionItem *object); /** Checks if a variable exists/is registered in the calculator. */ bool hasVariable(Variable *v); /** Checks if a unit exists/is registered in the calculator. */ bool hasUnit(Unit *u); /** Checks if a function exists/is registered in the calculator. */ bool hasFunction(MathFunction *f); /** Checks if a pointer points to a variable that still exists in the calculator. * As opposed to hasFunction(), this function only checks if the mathematical function has been deleted. */ bool stillHasVariable(Variable *v); /** Checks if a pointer points to a unit that still exists in the calculator. * As opposed to hasUnit(), this function only checks if the unit has been deleted. */ bool stillHasUnit(Unit *u); /** Checks if a pointer points to a mathematical function that still exists in the calculator. * As opposed to hasFunction(), this function only checks if the mathematical function has been deleted. */ bool stillHasFunction(MathFunction *f); void saveFunctionCalled(); bool checkSaveFunctionCalled(); ExpressionItem *getActiveExpressionItem(string name, ExpressionItem *item = NULL); ExpressionItem *getInactiveExpressionItem(string name, ExpressionItem *item = NULL); ExpressionItem *getActiveExpressionItem(ExpressionItem *item); ExpressionItem *getExpressionItem(string name, ExpressionItem *item = NULL); Unit* getUnit(string name_); Unit* getActiveUnit(string name_); Unit* getCompositeUnit(string internal_name_); /** Returns prefix for an index (starting at zero). All prefixes can be traversed by starting at index zero and increasing the index until NULL is returned. * * @param index Index of prefix. * @returns Prefix for index or NULL if not found. */ Prefix *getPrefix(size_t index) const; /** Returns prefix with provided name. * * @param name_ Name of prefix to retrieve. * @returns Prefix with provided name or NULL if not found. */ Prefix *getPrefix(string name_) const; Variable* addVariable(Variable *v, bool force = true, bool check_names = true); void variableNameChanged(Variable *v, bool new_item = false); void functionNameChanged(MathFunction *f, bool new_item = false); void unitNameChanged(Unit *u, bool new_item = false); Variable* getVariable(string name_); Variable* getActiveVariable(string name_); ExpressionItem *addExpressionItem(ExpressionItem *item, bool force = true); MathFunction* addFunction(MathFunction *f, bool force = true, bool check_names = true); DataSet* addDataSet(DataSet *dc, bool force = true, bool check_names = true); DataSet* getDataSet(size_t index); DataSet* getDataSet(string name); MathFunction* getFunction(string name_); MathFunction* getActiveFunction(string name_); /** Returns variable for an index (starting at zero). All variables can be traversed by starting at index zero and increasing the index until NULL is returned. * * @param index Index of variable. * @returns Variable for index or NULL if not found. */ Variable *getVariable(size_t index) const; /** Returns unit for an index (starting at zero). All units can be traversed by starting at index zero and increasing the index until NULL is returned. * * @param index Index of unit. * @returns Unit for index or NULL if not found. */ Unit *getUnit(size_t index) const; /** Returns function for an index (starting at zero). All functions can be traversed by starting at index zero and increasing the index until NULL is returned. * * @param index Index of function. * @returns Function for index or NULL if not found. */ MathFunction *getFunction(size_t index) const; bool unitIsUsedByOtherUnits(const Unit *u) const; //@} /** @name Functions for handling of builtin expression items */ //@{ /** Unloads all non-builtin variables. */ void resetVariables(); /** Unloads all non-builtin functions. */ void resetFunctions(); /** Unloads all non-builtin units. */ void resetUnits(); /** Unloads all non-builtin variables, functions and units. */ void reset(); /** Adds builtin variables. Called automatically when the calculator is created. */ void addBuiltinVariables(); /** Adds builtin functions. Called automatically when the calculator is created. */ void addBuiltinFunctions(); /** Adds builtin units. Called automatically when the calculator is created. */ void addBuiltinUnits(); //@} /** @name Functions for testing validity of functions, variable and unit names. */ //@{ /** Tests if a name is valid for a variable. * * @param name_ Variable name. * @returns true if the name is valid for a variable. */ bool variableNameIsValid(const string &name_); /** Tests if a name is valid for a variable. * * @param name_ Variable name. * @returns true if the name is valid for a variable. */ bool variableNameIsValid(const char *name_); bool variableNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs); bool variableNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs); string convertToValidVariableName(string name_); bool functionNameIsValid(const string &name_); bool functionNameIsValid(const char *name_); bool functionNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs); bool functionNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs); string convertToValidFunctionName(string name_); bool unitNameIsValid(const string &name_); bool unitNameIsValid(const char *name_); bool unitNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs); bool unitNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs); bool utf8_pos_is_valid_in_name(char *pos); string convertToValidUnitName(string name_); /** Checks if a name is used by another object which is not allowed to have the same name. * * @param name Name. * @param object Object to exclude from check. * @returns true if the name is used. */ bool nameTaken(string name, ExpressionItem *object = NULL); bool variableNameTaken(string name, Variable *object = NULL); bool unitNameTaken(string name, Unit *object = NULL); bool functionNameTaken(string name, MathFunction *object = NULL); string getName(string name = "", ExpressionItem *object = NULL, bool force = false, bool always_append = false); //@} /** @name Functions for message handling. */ //@{ void error(bool critical, const char *TEMPLATE,...); /** Put a message in the message queue. */ void message(MessageType mtype, const char *TEMPLATE,...); /** Returns the first message in queue. */ CalculatorMessage *message(); /** Removes the first message in queue and returns the next. */ CalculatorMessage *nextMessage(); bool showArgumentErrors() const; void beginTemporaryStopMessages(); int endTemporaryStopMessages(int *message_count = NULL, int *warning_count = NULL); //@} /** @name Functions for loading and saving definitions (variables, functions, units, etc.). */ //@{ /** Load all standard global (system wide) definitions from the global data directory ($PREFIX/share/qalculate). * * @returns true if the definitions were successfully loaded. */ bool loadGlobalDefinitions(); /** Load global (system wide) definitions from a file in the global data directory ($PREFIX/share/qalculate). * * @param filename Name of the file in the global data directory. * @returns true if the definitions were successfully loaded. */ bool loadGlobalDefinitions(string filename); /** Load prefixes. * * @returns true if the definitions were successfully loaded. */ bool loadGlobalPrefixes(); /** Load currencies. * * @returns true if the definitions were successfully loaded. */ bool loadGlobalCurrencies(); /** Load units. * * @returns true if the definitions were successfully loaded. */ bool loadGlobalUnits(); /** Load variables. * * @returns true if the definitions were successfully loaded. */ bool loadGlobalVariables(); /** Load functions. * * @returns true if the definitions were successfully loaded. */ bool loadGlobalFunctions(); /** Load data sets. * * @returns true if the definitions were successfully loaded. */ bool loadGlobalDataSets(); /** Load local, user specific, definitions from the local definitions directory (~/.qalculate/definitions). * All files in the directory and in the datasets subdirectory are loaded. * * @returns true if the definitions were successfully loaded. */ bool loadLocalDefinitions(); /** Load definitions from a file. * * @param file_name The path to the file to load. * @param is_user_defs true if the definitions are local, false if they are global. * @returns true if the definitions were successfully loaded. */ int loadDefinitions(const char *file_name, bool is_user_defs = true); /** Save local definitions to ~/.qalculate/definitions/ * * @returns true if definitions was successfully saved. */ bool saveDefinitions(); int saveDataObjects(); int savePrefixes(const char *file_name, bool save_global = false); int saveVariables(const char *file_name, bool save_global = false); int saveUnits(const char *file_name, bool save_global = false); int saveFunctions(const char *file_name, bool save_global = false); int saveDataSets(const char *file_name, bool save_global = false); //@} /** @name Functions for CSV file import/export. */ //@{ bool importCSV(MathStructure &mstruct, const char *file_name, int first_row = 1, string delimiter = ",", vector *headers = NULL); bool importCSV(const char *file_name, int first_row = 1, bool headers = true, string delimiter = ",", bool to_matrix = false, string name = "", string title = "", string category = ""); bool exportCSV(const MathStructure &mstruct, const char *file_name, string delimiter = ","); //@} /** @name Functions for exchange rates. */ //@{ /** Checks if gnomevfs-copy or wget is available for downloading exchange rates from the Internet. * * @returns true if gnomevfs-copy or wget was found. */ bool canFetch(); /** Checks if gnomevfs-copy available. * * @returns true if gnomevfs-copy was found. */ bool hasGnomeVFS(); /** Load saved (local) currency units and exchange rates. * * @returns true if operation successful. */ bool loadExchangeRates(); /** Name of the exchange rates file on local disc. * * @returns name of local exchange rates file. */ string getExchangeRatesFileName(); /** Url of the exchange rates file on the Internet. * * @returns Url of exchange rates file. */ string getExchangeRatesUrl(); /** Download current exchange rates from the Internet to local disc. * * @param timeout Timeout for donwload try (only used by wget) * @param wget_args Extra arguments to pass to wget. * @returns true if operation was successful. */ bool fetchExchangeRates(int timeout, string wget_args); /** Download current exchange rates from the Internet to local disc with default wget arguments. * * @param timeout Timeout for donwload try (only used by wget) * @returns true if operation was successful. */ bool fetchExchangeRates(int timeout = 15); /** Returns true if the exchange rates on local disc is older than one week. */ bool checkExchangeRatesDate(); //@} /** @name Functions for plotting */ //@{ /** Checks if gnuplot is available. * * @returns true if gnuplot was found. */ bool canPlot(); MathStructure expressionToPlotVector(string expression, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector = NULL, string x_var = "\\x", const ParseOptions &po = default_parse_options); MathStructure expressionToPlotVector(string expression, float min, float max, int steps, MathStructure *x_vector = NULL, string x_var = "\\x", const ParseOptions &po = default_parse_options); MathStructure expressionToPlotVector(string expression, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector = NULL, string x_var = "\\x", const ParseOptions &po = default_parse_options); MathStructure expressionToPlotVector(string expression, float min, float max, float step, MathStructure *x_vector = NULL, string x_var = "\\x", const ParseOptions &po = default_parse_options); MathStructure expressionToPlotVector(string expression, const MathStructure &x_vector, string x_var = "\\x", const ParseOptions &po = default_parse_options); bool plotVectors(PlotParameters *param, const vector &y_vectors, const vector &x_vectors, vector &pdps, bool persistent = false); bool invokeGnuplot(string commands, string commandline_extra = "", bool persistent = false); bool closeGnuplot(); bool gnuplotOpen(); //@} /** @name Functions for global precision */ //@{ /** Set default precision for approximate calculations. * * @param precision Precision. */ void setPrecision(int precision = DEFAULT_PRECISION); /** Returns default precision for approximate calculations. */ int getPrecision() const; //@} /** @name Functions for localization */ //@{ /** Returns the preferred decimal point character. */ const string &getDecimalPoint() const; /** Returns the preferred comma character for separating arguments.*/ const string &getComma() const; /** Sets argument separator and decimal sign from the current locale. Mainly for internal use. */ void setLocale(); void useDecimalComma(); void useDecimalPoint(); /** Resets argument separator and decimal sign. Mainly for internal use. */ void unsetLocale(); /** Returns the translated text string used in expressions for converting to a specific unit expression (ex "5 meters to feet.*/ string localToString() const; //@} /** @name Functions adding alternative symbols for operators and such */ //@{ void addStringAlternative(string replacement, string standard); bool delStringAlternative(string replacement, string standard); void addDefaultStringAlternative(string replacement, string standard); bool delDefaultStringAlternative(string replacement, string standard); //@} /** @name Functions for storing values with associated identifiers */ //@{ /** Stores a value with an associated id. Mainly for internal use. * * @param mstruct The value to store. * @param persistent If false the values will be removed from storage when retrieved with getId(). * @returns Storage id. */ size_t addId(MathStructure *mstruct, bool persistent = false); /** Stores a function value with arguments parsed from a text string using Function::parse(), with an associated id. Mainly for internal use. * * @param f Mathematical function. * @param str Arguments. * @param po Parse options. * @param persistent If false the values will be removed from storage when retrieved with getId(). * @returns Storage id. */ size_t parseAddId(MathFunction *f, const string &str, const ParseOptions &po, bool persistent = false); size_t parseAddIdAppend(MathFunction *f, const MathStructure &append_mstruct, const string &str, const ParseOptions &po, bool persistent = false); size_t parseAddVectorId(const string &str, const ParseOptions &po, bool persistent = false); /** Returns a stored value. Mainly for internal use. * * @param id Storage id. * @returns A stored value. */ MathStructure *getId(size_t id); /** Removes and unreferences (value->unref() will be called) a value from storage. Mainly for internal use. * * @param id Storage id. */ void delId(size_t id); //@} }; #endif libqalculate-0.9.7/libqalculate/ExpressionItem.cc0000644000175100017510000003661411305546372017063 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #include "support.h" #include "ExpressionItem.h" #include "Calculator.h" #include "util.h" ExpressionName::ExpressionName(string sname) : suffix(false), unicode(false), plural(false), reference(false), avoid_input(false) { name = sname; if(text_length_is_one(sname)) { abbreviation = true; case_sensitive = true; } else { abbreviation = false; case_sensitive = false; } } ExpressionName::ExpressionName() : abbreviation(false), suffix(false), unicode(false), plural(false), reference(false), avoid_input(false), case_sensitive(false) { } void ExpressionName::operator = (const ExpressionName &ename) { name = ename.name; abbreviation = ename.abbreviation; case_sensitive = ename.case_sensitive; suffix = ename.suffix; unicode = ename.unicode; plural = ename.plural; reference = ename.reference; avoid_input = ename.avoid_input; } bool ExpressionName::operator == (const ExpressionName &ename) const { return name == ename.name && abbreviation == ename.abbreviation && case_sensitive == ename.case_sensitive && suffix == ename.suffix && unicode == ename.unicode && plural == ename.plural && reference == ename.reference && avoid_input == ename.avoid_input; } bool ExpressionName::operator != (const ExpressionName &ename) const { return name != ename.name || abbreviation != ename.abbreviation || case_sensitive != ename.case_sensitive || suffix != ename.suffix || unicode != ename.unicode || plural != ename.plural || reference != ename.reference || avoid_input != ename.avoid_input; } ExpressionItem::ExpressionItem(string cat_, string name_, string title_, string descr_, bool is_local, bool is_builtin, bool is_active) { b_local = is_local; b_builtin = is_builtin; remove_blank_ends(name_); remove_blank_ends(cat_); remove_blank_ends(title_); if(!name_.empty()) { names.resize(1); names[0].name = name_; names[0].unicode = false; names[0].abbreviation = false; names[0].case_sensitive = text_length_is_one(names[0].name); names[0].suffix = false; names[0].avoid_input = false; names[0].reference = true; names[0].plural = false; } stitle = title_; scat = cat_; sdescr = descr_; b_changed = false; b_approx = false; i_precision = -1; b_active = is_active; b_registered = false; b_hidden = false; b_destroyed = false; i_ref = 0; } ExpressionItem::ExpressionItem() { b_changed = false; b_approx = false; i_precision = -1; b_active = true; b_local = true; b_builtin = false; b_registered = false; b_hidden = false; b_destroyed = false; i_ref = 0; } ExpressionItem::~ExpressionItem() { } void ExpressionItem::set(const ExpressionItem *item) { b_changed = item->hasChanged(); b_approx = item->isApproximate(); i_precision = item->precision(); b_active = item->isActive(); for(size_t i = 1; i <= item->countNames(); i++) { names.push_back(item->getName(1)); } stitle = item->title(false); scat = item->category(); sdescr = item->description(); b_local = item->isLocal(); b_builtin = item->isBuiltin(); b_hidden = item->isHidden(); } bool ExpressionItem::destroy() { CALCULATOR->expressionItemDeleted(this); if(v_refs.size() > 0) { return false; } else if(i_ref > 0) { b_destroyed = true; } else { delete this; } return true; } bool ExpressionItem::isRegistered() const { return b_registered; } void ExpressionItem::setRegistered(bool is_registered) { b_registered = is_registered; } const string &ExpressionItem::title(bool return_name_if_no_title, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { if(return_name_if_no_title && stitle.empty()) { return preferredName(false, use_unicode, false, false, can_display_unicode_string_function, can_display_unicode_string_arg).name; } return stitle; } void ExpressionItem::setTitle(string title_) { remove_blank_ends(title_); if(stitle != title_) { stitle = title_; b_changed = true; } } const string &ExpressionItem::description() const { return sdescr; } void ExpressionItem::setDescription(string descr_) { remove_blank_ends(descr_); if(sdescr != descr_) { sdescr = descr_; b_changed = true; } } const string &ExpressionItem::name(bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { bool undisplayable_uni = false; for(size_t i = 0; i < names.size(); i++) { if(names[i].unicode == use_unicode) { if(use_unicode && can_display_unicode_string_function && !((*can_display_unicode_string_function) (names[i].name.c_str(), can_display_unicode_string_arg))) { undisplayable_uni = true; } else { return names[i].name; } } } if(undisplayable_uni) return name(false); if(names.size() > 0) return names[0].name; return empty_string; } const string &ExpressionItem::referenceName() const { for(size_t i = 0; i < names.size(); i++) { if(names[i].reference) { return names[i].name; } } if(names.size() > 0) return names[0].name; return empty_string; } const ExpressionName &ExpressionItem::preferredName(bool abbreviation, bool use_unicode, bool plural, bool reference, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { if(names.size() == 1) return names[0]; int index = -1; for(size_t i = 0; i < names.size(); i++) { if((!reference || names[i].reference) && names[i].abbreviation == abbreviation && names[i].unicode == use_unicode && names[i].plural == plural && (!use_unicode || !can_display_unicode_string_function || (*can_display_unicode_string_function) (names[i].name.c_str(), can_display_unicode_string_arg))) return names[i]; if(index < 0) { index = i; } else if(reference && names[i].reference != names[index].reference) { if(names[i].reference) index = i; } else if(!use_unicode && names[i].unicode != names[index].unicode) { if(!names[i].unicode) index = i; } else if(names[i].abbreviation != names[index].abbreviation) { if(names[i].abbreviation == abbreviation) index = i; } else if(names[i].plural != names[index].plural) { if(names[i].plural == plural) index = i; } else if(use_unicode && names[i].unicode != names[index].unicode) { if(names[i].unicode) index = i; } } if(use_unicode && names[index].unicode && can_display_unicode_string_function && !((*can_display_unicode_string_function) (names[index].name.c_str(), can_display_unicode_string_arg))) { return preferredName(abbreviation, false, plural, reference, can_display_unicode_string_function, can_display_unicode_string_arg); } if(index >= 0) return names[index]; return empty_expression_name; } const ExpressionName &ExpressionItem::preferredInputName(bool abbreviation, bool use_unicode, bool plural, bool reference, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { if(names.size() == 1) return names[0]; int index = -1; for(size_t i = 0; i < names.size(); i++) { if((!reference || names[i].reference) && names[i].abbreviation == abbreviation && names[i].unicode == use_unicode && names[i].plural == plural && !names[i].avoid_input) return names[i]; if(index < 0) { index = i; } else if(reference && names[i].reference != names[index].reference) { if(names[i].reference) index = i; } else if(!use_unicode && names[i].unicode != names[index].unicode) { if(!names[i].unicode) index = i; } else if(names[i].avoid_input != names[index].avoid_input) { if(!names[i].avoid_input) index = i; } else if(abbreviation && names[i].abbreviation != names[index].abbreviation) { if(names[i].abbreviation) index = i; } else if(plural && names[i].plural != names[index].plural) { if(names[i].plural) index = i; } else if(!abbreviation && names[i].abbreviation != names[index].abbreviation) { if(!names[i].abbreviation) index = i; } else if(!plural && names[i].plural != names[index].plural) { if(!names[i].plural) index = i; } else if(use_unicode && names[i].unicode != names[index].unicode) { if(names[i].unicode) index = i; } } if(use_unicode && names[index].unicode && can_display_unicode_string_function && !((*can_display_unicode_string_function) (names[index].name.c_str(), can_display_unicode_string_arg))) { return preferredInputName(abbreviation, false, plural, reference, can_display_unicode_string_function, can_display_unicode_string_arg); } if(index >= 0) return names[index]; return empty_expression_name; } const ExpressionName &ExpressionItem::preferredDisplayName(bool abbreviation, bool use_unicode, bool plural, bool reference, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { return preferredName(abbreviation, use_unicode, plural, reference, can_display_unicode_string_function, can_display_unicode_string_arg); } const ExpressionName &ExpressionItem::getName(size_t index) const { if(index > 0 && index <= names.size()) return names[index - 1]; return empty_expression_name; } void ExpressionItem::setName(const ExpressionName &ename, size_t index, bool force) { if(index < 1) addName(ename, 1); if(index > names.size()) addName(ename); if(b_registered && names[index - 1].name != ename.name) { names[index - 1] = ename; names[index - 1].name = CALCULATOR->getName(ename.name, this, force); b_changed = true; CALCULATOR->nameChanged(this); } else if(ename != names[index - 1]) { names[index - 1] = ename; b_changed = true; } } void ExpressionItem::setName(string sname, size_t index, bool force) { if(index < 1) addName(sname, 1); if(index > names.size()) addName(sname); if(b_registered && names[index - 1].name != sname) { names[index - 1].name = CALCULATOR->getName(sname, this, force); b_changed = true; CALCULATOR->nameChanged(this); } else if(sname != names[index - 1].name) { names[index - 1].name = sname; b_changed = true; } } void ExpressionItem::addName(const ExpressionName &ename, size_t index, bool force) { if(index < 1 || index > names.size()) { names.push_back(ename); index = names.size(); } else { names.insert(names.begin() + (index - 1), ename); } if(b_registered) { names[index - 1].name = CALCULATOR->getName(names[index - 1].name, this, force); CALCULATOR->nameChanged(this); } b_changed = true; } void ExpressionItem::addName(string sname, size_t index, bool force) { if(index < 1 || index > names.size()) { names.push_back(ExpressionName(sname)); index = names.size(); } else { names.insert(names.begin() + (index - 1), ExpressionName(sname)); } if(b_registered) { names[index - 1].name = CALCULATOR->getName(names[index - 1].name, this, force); CALCULATOR->nameChanged(this); } b_changed = true; } size_t ExpressionItem::countNames() const { return names.size(); } void ExpressionItem::clearNames() { if(names.size() > 0) { names.clear(); if(b_registered) { CALCULATOR->nameChanged(this); } b_changed = true; } } void ExpressionItem::clearNonReferenceNames() { bool b = false; for(vector::iterator it = names.begin(); it != names.end(); ++it) { if(!it->reference) { it = names.erase(it); --it; b = true; } } if(b) { if(b_registered) { CALCULATOR->nameChanged(this); } b_changed = true; } } void ExpressionItem::removeName(size_t index) { if(index > 0 && index <= names.size()) { names.erase(names.begin() + (index - 1)); if(b_registered) { CALCULATOR->nameChanged(this); } b_changed = true; } } size_t ExpressionItem::hasName(const string &sname, bool case_sensitive) const { for(size_t i = 0; i < names.size(); i++) { if(case_sensitive && names[i].case_sensitive && sname == names[i].name) return i + 1; if((!case_sensitive || !names[i].case_sensitive) && equalsIgnoreCase(names[i].name, sname)) return i + 1; } return 0; } size_t ExpressionItem::hasNameCaseSensitive(const string &sname) const { for(size_t i = 0; i < names.size(); i++) { if(sname == names[i].name) return i + 1; } return 0; } const ExpressionName &ExpressionItem::findName(int abbreviation, int use_unicode, int plural, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { for(size_t i = 0; i < names.size(); i++) { if((abbreviation < 0 || names[i].abbreviation == abbreviation) && (use_unicode < 0 || names[i].unicode == use_unicode) && (plural < 0 || names[i].plural == plural) && (!names[i].unicode || !can_display_unicode_string_function || ((*can_display_unicode_string_function) (names[i].name.c_str(), can_display_unicode_string_arg)))) return names[i]; } return empty_expression_name; } const string &ExpressionItem::category() const { return scat; } void ExpressionItem::setCategory(string cat_) { remove_blank_ends(cat_); if(scat != cat_) { scat = cat_; b_changed = true; } } bool ExpressionItem::isLocal() const { return b_local; } bool ExpressionItem::setLocal(bool is_local, int will_be_active) { if(is_local != b_local) { if(!b_local) { bool was_active = b_active; b_active = false; ExpressionItem *item = copy(); b_local = is_local; b_active = was_active; if(will_be_active) { setActive(true); } else if(will_be_active == 0) { setActive(false); } CALCULATOR->addExpressionItem(item); if(was_active != item->isActive()) { item->setChanged(true); } if(was_active && will_be_active == 0) { item->setActive(true); } } b_local = is_local; } else if(will_be_active >= 0) { setActive(will_be_active); } return true; } bool ExpressionItem::isBuiltin() const { return b_builtin; } bool ExpressionItem::hasChanged() const { return b_changed; } void ExpressionItem::setChanged(bool has_changed) { b_changed = has_changed; } bool ExpressionItem::isApproximate() const { return b_approx; } void ExpressionItem::setApproximate(bool is_approx) { if(is_approx != b_approx) { b_approx = is_approx; b_changed = true; } } int ExpressionItem::precision() const { return i_precision; } void ExpressionItem::setPrecision(int prec) { if(i_precision != prec) { i_precision = prec; if(i_precision > 0) b_approx = true; b_changed = true; } } bool ExpressionItem::isActive() const { return b_active; } void ExpressionItem::setActive(bool is_active) { if(is_active != b_active) { b_active = is_active; if(b_registered) { if(is_active) { CALCULATOR->expressionItemActivated(this); } else { CALCULATOR->expressionItemDeactivated(this); } } b_changed = true; } } bool ExpressionItem::isHidden() const { return b_hidden; } void ExpressionItem::setHidden(bool is_hidden) { if(is_hidden != b_hidden) { b_hidden = is_hidden; b_changed = true; } } int ExpressionItem::refcount() const { return i_ref; } void ExpressionItem::ref() { i_ref++; } void ExpressionItem::unref() { i_ref--; if(b_destroyed && i_ref <= 0) { delete this; } } void ExpressionItem::ref(ExpressionItem *o) { i_ref++; v_refs.push_back(o); } void ExpressionItem::unref(ExpressionItem *o) { for(size_t i = 0; i < v_refs.size(); i++) { if(v_refs[i] == o) { i_ref--; v_refs.erase(v_refs.begin() + i); break; } } } ExpressionItem *ExpressionItem::getReferencer(size_t index) const { if(index > 0 && index <= v_refs.size()) { return v_refs[index - 1]; } return NULL; } bool ExpressionItem::changeReference(ExpressionItem*, ExpressionItem*) { return false; } libqalculate-0.9.7/libqalculate/Makefile.in0000644000175100017510000004716111320655032015631 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ # # src/libqalculate/Makefile.am for qalculate # VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = libqalculate DIST_COMMON = $(libqalculateinclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/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)$(libqalculateincludedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libqalculate_la_DEPENDENCIES = am_libqalculate_la_OBJECTS = Function.lo Calculator.lo DataSet.lo \ Variable.lo ExpressionItem.lo Number.lo MathStructure.lo \ Prefix.lo util.lo Unit.lo BuiltinFunctions.lo libqalculate_la_OBJECTS = $(am_libqalculate_la_OBJECTS) libqalculate_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libqalculate_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libqalculate_la_SOURCES) DIST_SOURCES = $(libqalculate_la_SOURCES) libqalculateincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(libqalculateinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_CPPFLAGS = @CLN_CPPFLAGS@ CLN_LIBS = @CLN_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@ INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@ INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@ INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@ INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@ INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@ INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@ INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@ INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@ INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@ INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@ INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@ INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NMEDIT = @NMEDIT@ 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@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libqalculate.la libqalculate_la_SOURCES = \ Function.cc Calculator.cc DataSet.cc \ Variable.cc ExpressionItem.cc Number.cc MathStructure.cc \ Prefix.cc support.h util.cc Unit.cc BuiltinFunctions.cc libqalculateincludedir = $(includedir)/libqalculate libqalculateinclude_HEADERS = \ Function.h Calculator.h DataSet.h Variable.h \ ExpressionItem.h Number.h MathStructure.h Prefix.h \ util.h includes.h Unit.h BuiltinFunctions.h \ qalculate.h libqalculate_la_LDFLAGS = -version-info $(QALCULATE_CURRENT):$(QALCULATE_REVISION):$(QALCULATE_AGE) -no-undefined libqalculate_la_LIBADD = \ @GLIB_LIBS@ INCLUDES = \ -I../ \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ @GLIB_CFLAGS@ all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 libqalculate/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu libqalculate/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 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) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --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 libqalculate.la: $(libqalculate_la_OBJECTS) $(libqalculate_la_DEPENDENCIES) $(libqalculate_la_LINK) -rpath $(libdir) $(libqalculate_la_OBJECTS) $(libqalculate_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BuiltinFunctions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Calculator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DataSet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ExpressionItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Function.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MathStructure.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Number.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Prefix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Unit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Variable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libqalculateincludeHEADERS: $(libqalculateinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(libqalculateincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libqalculateincludedir)" @list='$(libqalculateinclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(libqalculateincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libqalculateincludedir)/$$f'"; \ $(libqalculateincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libqalculateincludedir)/$$f"; \ done uninstall-libqalculateincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(libqalculateinclude_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(libqalculateincludedir)/$$f'"; \ rm -f "$(DESTDIR)$(libqalculateincludedir)/$$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; nonemtpy = 1; } \ END { if (nonempty) { 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; nonempty = 1; } \ END { if (nonempty) { 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=; \ 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; nonempty = 1; } \ END { if (nonempty) { 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libqalculateincludedir)"; 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-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-libqalculateincludeHEADERS install-dvi: install-dvi-am install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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-libLTLIBRARIES \ uninstall-libqalculateincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-libqalculateincludeHEADERS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am 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-libLTLIBRARIES \ uninstall-libqalculateincludeHEADERS # 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: libqalculate-0.9.7/libqalculate/BuiltinFunctions.h0000644000175100017510000002474711305546372017252 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #ifndef BUILTIN_FUNCTIONS_H #define BUILTIN_FUNCTIONS_H #include #include #define DECLARE_BUILTIN_FUNCTION(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ }; #define DECLARE_BUILTIN_FUNCTION_B(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ bool representsBoolean(const MathStructure&) const {return true;}\ }; #define DECLARE_BUILTIN_FUNCTION_PI(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ bool representsInteger(const MathStructure&, bool) const {return true;}\ bool representsPositive(const MathStructure&, bool) const {return true;}\ }; #define DECLARE_BUILTIN_FUNCTION_RPI(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ bool representsReal(const MathStructure&, bool) const;\ bool representsInteger(const MathStructure&) const;\ bool representsNonNegative(const MathStructure&) const;\ }; #define DECLARE_BUILTIN_FUNCTION_R(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ bool representsPositive(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNegative(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNonNegative(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNonPositive(const MathStructure &vargs, bool allow_units = false) const;\ bool representsInteger(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNumber(const MathStructure &vargs, bool allow_units = false) const;\ bool representsRational(const MathStructure &vargs, bool allow_units = false) const;\ bool representsReal(const MathStructure &vargs, bool allow_units = false) const;\ bool representsComplex(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNonZero(const MathStructure &vargs, bool allow_units = false) const;\ bool representsEven(const MathStructure &vargs, bool allow_units = false) const;\ bool representsOdd(const MathStructure &vargs, bool allow_units = false) const;\ bool representsUndefined(const MathStructure &vargs) const;\ }; #define DECLARE_BUILTIN_FUNCTION_R2(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ bool representsNumber(const MathStructure &vargs, bool allow_units = false) const;\ bool representsReal(const MathStructure &vargs, bool allow_units = false) const;\ }; #define DECLARE_BUILTIN_FUNCTION_R1(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ bool representsNumber(const MathStructure &vargs, bool allow_units = false) const;\ }; DECLARE_BUILTIN_FUNCTION(VectorFunction) DECLARE_BUILTIN_FUNCTION(LimitsFunction) DECLARE_BUILTIN_FUNCTION(RankFunction) DECLARE_BUILTIN_FUNCTION(SortFunction) DECLARE_BUILTIN_FUNCTION(ComponentFunction) DECLARE_BUILTIN_FUNCTION_PI(DimensionFunction) DECLARE_BUILTIN_FUNCTION(MatrixFunction) DECLARE_BUILTIN_FUNCTION(MergeVectorsFunction) DECLARE_BUILTIN_FUNCTION(MatrixToVectorFunction) DECLARE_BUILTIN_FUNCTION(AreaFunction) DECLARE_BUILTIN_FUNCTION_PI(RowsFunction) DECLARE_BUILTIN_FUNCTION_PI(ColumnsFunction) DECLARE_BUILTIN_FUNCTION(RowFunction) DECLARE_BUILTIN_FUNCTION(ColumnFunction) DECLARE_BUILTIN_FUNCTION_PI(ElementsFunction) DECLARE_BUILTIN_FUNCTION(ElementFunction) DECLARE_BUILTIN_FUNCTION(TransposeFunction) DECLARE_BUILTIN_FUNCTION(IdentityFunction) DECLARE_BUILTIN_FUNCTION(DeterminantFunction) DECLARE_BUILTIN_FUNCTION(PermanentFunction) DECLARE_BUILTIN_FUNCTION(AdjointFunction) DECLARE_BUILTIN_FUNCTION(CofactorFunction) DECLARE_BUILTIN_FUNCTION(InverseFunction) DECLARE_BUILTIN_FUNCTION_R(FactorialFunction) DECLARE_BUILTIN_FUNCTION_R(DoubleFactorialFunction) DECLARE_BUILTIN_FUNCTION_R(MultiFactorialFunction) DECLARE_BUILTIN_FUNCTION(BinomialFunction) DECLARE_BUILTIN_FUNCTION(BitXorFunction) DECLARE_BUILTIN_FUNCTION_B(XorFunction) DECLARE_BUILTIN_FUNCTION_B(OddFunction) DECLARE_BUILTIN_FUNCTION_B(EvenFunction) DECLARE_BUILTIN_FUNCTION(ShiftFunction) DECLARE_BUILTIN_FUNCTION_R(AbsFunction) DECLARE_BUILTIN_FUNCTION(GcdFunction) DECLARE_BUILTIN_FUNCTION(LcmFunction) DECLARE_BUILTIN_FUNCTION(SignumFunction) DECLARE_BUILTIN_FUNCTION_R(RoundFunction) DECLARE_BUILTIN_FUNCTION_R(FloorFunction) DECLARE_BUILTIN_FUNCTION_R(CeilFunction) DECLARE_BUILTIN_FUNCTION_R(TruncFunction) DECLARE_BUILTIN_FUNCTION(NumeratorFunction) DECLARE_BUILTIN_FUNCTION(DenominatorFunction) DECLARE_BUILTIN_FUNCTION(IntFunction) DECLARE_BUILTIN_FUNCTION(FracFunction) DECLARE_BUILTIN_FUNCTION(RemFunction) DECLARE_BUILTIN_FUNCTION(ModFunction) DECLARE_BUILTIN_FUNCTION(PolynomialUnitFunction) DECLARE_BUILTIN_FUNCTION(PolynomialPrimpartFunction) DECLARE_BUILTIN_FUNCTION(PolynomialContentFunction) DECLARE_BUILTIN_FUNCTION(CoeffFunction) DECLARE_BUILTIN_FUNCTION(LCoeffFunction) DECLARE_BUILTIN_FUNCTION(TCoeffFunction) DECLARE_BUILTIN_FUNCTION(DegreeFunction) DECLARE_BUILTIN_FUNCTION(LDegreeFunction) DECLARE_BUILTIN_FUNCTION_R(ReFunction) DECLARE_BUILTIN_FUNCTION_R(ImFunction) DECLARE_BUILTIN_FUNCTION(ArgFunction) DECLARE_BUILTIN_FUNCTION(SqrtFunction) DECLARE_BUILTIN_FUNCTION(SquareFunction) DECLARE_BUILTIN_FUNCTION(ExpFunction) DECLARE_BUILTIN_FUNCTION_R(LogFunction) DECLARE_BUILTIN_FUNCTION(LognFunction) DECLARE_BUILTIN_FUNCTION(LambertWFunction) DECLARE_BUILTIN_FUNCTION_R2(SinFunction) DECLARE_BUILTIN_FUNCTION_R2(CosFunction) DECLARE_BUILTIN_FUNCTION(TanFunction) DECLARE_BUILTIN_FUNCTION_R1(AsinFunction) DECLARE_BUILTIN_FUNCTION_R1(AcosFunction) DECLARE_BUILTIN_FUNCTION_R2(AtanFunction) DECLARE_BUILTIN_FUNCTION_R2(SinhFunction) DECLARE_BUILTIN_FUNCTION_R2(CoshFunction) DECLARE_BUILTIN_FUNCTION_R2(TanhFunction) DECLARE_BUILTIN_FUNCTION_R2(AsinhFunction) DECLARE_BUILTIN_FUNCTION_R1(AcoshFunction) DECLARE_BUILTIN_FUNCTION(AtanhFunction) DECLARE_BUILTIN_FUNCTION(RadiansToDefaultAngleUnitFunction) DECLARE_BUILTIN_FUNCTION(ZetaFunction) DECLARE_BUILTIN_FUNCTION(GammaFunction) DECLARE_BUILTIN_FUNCTION(BetaFunction) DECLARE_BUILTIN_FUNCTION(TotalFunction) DECLARE_BUILTIN_FUNCTION(PercentileFunction) DECLARE_BUILTIN_FUNCTION(MinFunction) DECLARE_BUILTIN_FUNCTION(MaxFunction) DECLARE_BUILTIN_FUNCTION(ModeFunction) DECLARE_BUILTIN_FUNCTION_RPI(RandFunction) DECLARE_BUILTIN_FUNCTION(ISODateFunction) DECLARE_BUILTIN_FUNCTION(LocalDateFunction) DECLARE_BUILTIN_FUNCTION(TimestampFunction) DECLARE_BUILTIN_FUNCTION(TimestampToDateFunction) DECLARE_BUILTIN_FUNCTION(DaysFunction) DECLARE_BUILTIN_FUNCTION(YearFracFunction) DECLARE_BUILTIN_FUNCTION(WeekFunction) DECLARE_BUILTIN_FUNCTION(WeekdayFunction) DECLARE_BUILTIN_FUNCTION(MonthFunction) DECLARE_BUILTIN_FUNCTION(DayFunction) DECLARE_BUILTIN_FUNCTION(YearFunction) DECLARE_BUILTIN_FUNCTION(YeardayFunction) DECLARE_BUILTIN_FUNCTION(TimeFunction) DECLARE_BUILTIN_FUNCTION(AddDaysFunction) DECLARE_BUILTIN_FUNCTION(AddMonthsFunction) DECLARE_BUILTIN_FUNCTION(AddYearsFunction) DECLARE_BUILTIN_FUNCTION(BinFunction) DECLARE_BUILTIN_FUNCTION(OctFunction) DECLARE_BUILTIN_FUNCTION(HexFunction) DECLARE_BUILTIN_FUNCTION(BaseFunction) DECLARE_BUILTIN_FUNCTION(RomanFunction) DECLARE_BUILTIN_FUNCTION_PI(AsciiFunction) DECLARE_BUILTIN_FUNCTION(CharFunction) DECLARE_BUILTIN_FUNCTION_PI(LengthFunction) DECLARE_BUILTIN_FUNCTION(ConcatenateFunction) DECLARE_BUILTIN_FUNCTION(ReplaceFunction) DECLARE_BUILTIN_FUNCTION(StripUnitsFunction) DECLARE_BUILTIN_FUNCTION(GenerateVectorFunction) DECLARE_BUILTIN_FUNCTION(ForFunction) DECLARE_BUILTIN_FUNCTION(SumFunction) DECLARE_BUILTIN_FUNCTION(ProductFunction) DECLARE_BUILTIN_FUNCTION(ProcessFunction) DECLARE_BUILTIN_FUNCTION(ProcessMatrixFunction) DECLARE_BUILTIN_FUNCTION(CustomSumFunction) DECLARE_BUILTIN_FUNCTION(FunctionFunction) DECLARE_BUILTIN_FUNCTION(SelectFunction) DECLARE_BUILTIN_FUNCTION(TitleFunction) DECLARE_BUILTIN_FUNCTION(IFFunction) DECLARE_BUILTIN_FUNCTION(IsNumberFunction) DECLARE_BUILTIN_FUNCTION(IsRealFunction) DECLARE_BUILTIN_FUNCTION(IsRationalFunction) DECLARE_BUILTIN_FUNCTION(IsIntegerFunction) DECLARE_BUILTIN_FUNCTION(RepresentsNumberFunction) DECLARE_BUILTIN_FUNCTION(RepresentsRealFunction) DECLARE_BUILTIN_FUNCTION(RepresentsRationalFunction) DECLARE_BUILTIN_FUNCTION(RepresentsIntegerFunction) DECLARE_BUILTIN_FUNCTION(ErrorFunction) DECLARE_BUILTIN_FUNCTION(WarningFunction) DECLARE_BUILTIN_FUNCTION(MessageFunction) DECLARE_BUILTIN_FUNCTION(SaveFunction) DECLARE_BUILTIN_FUNCTION(LoadFunction) DECLARE_BUILTIN_FUNCTION(ExportFunction) DECLARE_BUILTIN_FUNCTION(RegisterFunction) DECLARE_BUILTIN_FUNCTION(StackFunction) DECLARE_BUILTIN_FUNCTION(DeriveFunction) DECLARE_BUILTIN_FUNCTION(IntegrateFunction) DECLARE_BUILTIN_FUNCTION(SolveFunction) DECLARE_BUILTIN_FUNCTION(SolveMultipleFunction) DECLARE_BUILTIN_FUNCTION(UncertaintyFunction) #endif libqalculate-0.9.7/libqalculate/util.cc0000644000175100017510000004566211305546373015066 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #include "support.h" #include "util.h" #include #include "Number.h" #include #include #include #include #include bool eqstr::operator()(const char *s1, const char *s2) const { return strcmp(s1, s2) == 0; } char buffer[20000]; string date2s(int year, int month, int day) { string str = i2s(year); str += "-"; if(month < 10) { str += "0"; } str += i2s(month); str += "-"; if(day < 10) { str += "0"; } str += i2s(day); return str; } bool s2date(string str, GDate *gtime) { /* if(strptime(str.c_str(), "%x", time) || strptime(str.c_str(), "%Ex", time) || strptime(str.c_str(), "%Y-%m-%d", time) || strptime(str.c_str(), "%m/%d/%Y", time) || strptime(str.c_str(), "%m/%d/%y", time)) { return true; }*/ //char *date_format = nl_langinfo(D_FMT); g_date_set_parse(gtime, str.c_str()); return g_date_valid(gtime); } void now(int &hour, int &min, int &sec) { time_t t = time(NULL); struct tm *lt = localtime(&t); hour = lt->tm_hour; min = lt->tm_min; sec = lt->tm_sec; } void today(int &year, int &month, int &day) { GDate *gtime = g_date_new(); g_date_set_time(gtime, time(NULL)); year = g_date_get_year(gtime); month = g_date_get_month(gtime); day = g_date_get_day(gtime); g_date_free(gtime); } bool addDays(GDate *gtime, int days) { if(days < 0) g_date_subtract_days(gtime, (guint) -days); else if(days > 0) g_date_add_days(gtime, (guint) days); if(!g_date_valid(gtime)) return false; return true; } bool addDays(int &year, int &month, int &day, int days) { GDate *gtime = g_date_new_dmy((GDateDay) day, (GDateMonth) month, (GDateYear) year); if(!addDays(gtime, days)) { g_date_free(gtime); return false; } year = (int) g_date_year(gtime); month = (int) g_date_month(gtime); day = (int) g_date_day(gtime); g_date_free(gtime); return true; } string addDays(string str, int days) { GDate *gtime = g_date_new(); if(!s2date(str, gtime) || !addDays(gtime, days)) { g_date_free(gtime); return empty_string; } int y = (int) g_date_year(gtime); int m = (int) g_date_month(gtime); int d = (int) g_date_day(gtime); g_date_free(gtime); return date2s(y, m, d); } bool addMonths(GDate *gtime, int months) { if(months < 0) g_date_subtract_months(gtime, (guint) -months); else if(months > 0) g_date_add_months(gtime, (guint) months); if(!g_date_valid(gtime)) return false; return true; } bool addMonths(int &year, int &month, int &day, int months) { GDate *gtime = g_date_new_dmy((GDateDay) day, (GDateMonth) month, (GDateYear) year); if(!addMonths(gtime, months)) { g_date_free(gtime); return false; } year = (int) g_date_year(gtime); month = (int) g_date_month(gtime); day = (int) g_date_day(gtime); g_date_free(gtime); return true; } string addMonths(string str, int months) { GDate *gtime = g_date_new(); if(!s2date(str, gtime) || !addMonths(gtime, months)) { g_date_free(gtime); return empty_string; } int y = (int) g_date_year(gtime); int m = (int) g_date_month(gtime); int d = (int) g_date_day(gtime); g_date_free(gtime); return date2s(y, m, d); } bool addYears(GDate *gtime, int years) { if(years < 0) g_date_subtract_years(gtime, (guint) -years); else if(years > 0) g_date_add_years(gtime, (guint) years); if(!g_date_valid(gtime)) return false; return true; } bool addYears(int &year, int &month, int &day, int years) { GDate *gtime = g_date_new_dmy((GDateDay) day, (GDateMonth) month, (GDateYear) year); if(!addYears(gtime, years)) { g_date_free(gtime); return false; } year = (int) g_date_year(gtime); month = (int) g_date_month(gtime); day = (int) g_date_day(gtime); g_date_free(gtime); return true; } string addYears(string str, int years) { GDate *gtime = g_date_new(); if(!s2date(str, gtime) || !addYears(gtime, years)) { g_date_free(gtime); return empty_string; } int y = (int) g_date_year(gtime); int m = (int) g_date_month(gtime); int d = (int) g_date_day(gtime); g_date_free(gtime); return date2s(y, m, d); } int week(string str, bool start_sunday) { remove_blank_ends(str); GDate *gtime = g_date_new(); bool b = false; if(str == _("today") || str == "today") { g_date_set_time(gtime, time(NULL)); b = true; } else if(str == _("now") || str == "now") { g_date_set_time(gtime, time(NULL)); b = true; } else { b = s2date(str, gtime); } int week = -1; if(b) { if(start_sunday) { week = g_date_get_sunday_week_of_year(gtime); } else { if(g_date_get_month(gtime) == G_DATE_DECEMBER && g_date_get_day(gtime) >= 29 && g_date_get_weekday(gtime) <= g_date_get_day(gtime) - 28) { week = 1; } else { calc_week_1: int day = g_date_get_day_of_year(gtime); g_date_set_day(gtime, 1); g_date_set_month(gtime, G_DATE_JANUARY); int wday = g_date_get_weekday(gtime); day -= (8 - wday); if(wday <= 4) { week = 1; } else { week = 0; } if(day > 0) { day--; week += day / 7 + 1; } if(week == 0) { int year = g_date_get_year(gtime); g_date_set_dmy(gtime, 31, G_DATE_DECEMBER, year - 1); goto calc_week_1; } } } } g_date_free(gtime); return week; } int weekday(string str) { remove_blank_ends(str); GDate *gtime = g_date_new(); bool b = false; if(str == _("today") || str == "today") { g_date_set_time(gtime, time(NULL)); b = true; } else if(str == _("now") || str == "now") { g_date_set_time(gtime, time(NULL)); b = true; } else { b = s2date(str, gtime); } int day = -1; if(b) { day = g_date_get_weekday(gtime); } g_date_free(gtime); return day; } int yearday(string str) { remove_blank_ends(str); GDate *gtime = g_date_new(); bool b = false; if(str == _("today") || str == "today") { g_date_set_time(gtime, time(NULL)); b = true; } else if(str == _("now") || str == "now") { g_date_set_time(gtime, time(NULL)); b = true; } else { b = s2date(str, gtime); } int day = -1; if(b) { day = g_date_get_day_of_year(gtime); } g_date_free(gtime); return day; } bool s2date(string str, int &year, int &month, int &day) { //struct tm time; remove_blank_ends(str); if(str == _("today") || str == "today") { today(year, month, day); return true; } else if(str == _("now") || str == "now") { today(year, month, day); return true; } GDate *gtime = g_date_new(); bool b = s2date(str, gtime); if(b) { /* year = time.tm_year + 1900; month = time.tm_mon + 1; day = time.tm_mday; */ year = g_date_get_year(gtime); month = g_date_get_month(gtime); day = g_date_get_day(gtime); g_date_free(gtime); return true; } g_date_free(gtime); return false; } bool isLeapYear(int year) { return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0); } int daysPerYear(int year, int basis) { switch(basis) { case 0: { return 360; } case 1: { if(isLeapYear(year)) { return 366; } else { return 365; } } case 2: { return 360; } case 3: { return 365; } case 4: { return 360; } } return -1; } int daysPerMonth(int month, int year) { switch(month) { case 1: {} case 3: {} case 5: {} case 7: {} case 8: {} case 10: {} case 12: { return 31; } case 2: { if(isLeapYear(year)) return 29; else return 28; } default: { return 30; } } } Number yearsBetweenDates(string date1, string date2, int basis, bool date_func) { if(basis < 0 || basis > 4) return -1; if(basis == 1) { int day1, day2, month1, month2, year1, year2; if(!s2date(date1, year1, month1, day1)) { return -1; } if(!s2date(date2, year2, month2, day2)) { return -1; } if(year1 > year2 || (year1 == year2 && month1 > month2) || (year1 == year2 && month1 == month2 && day1 > day2)) { int year3 = year1, month3 = month1, day3 = day1; year1 = year2; month1 = month2; day1 = day2; year2 = year3; month2 = month3; day2 = day3; } int days = 0; if(year1 == year2) { days = daysBetweenDates(year1, month1, day1, year2, month2, day2, basis, date_func); if(days < 0) return -1; return Number(days, daysPerYear(year1, basis)); } for(int month = 12; month > month1; month--) { days += daysPerMonth(month, year1); } days += daysPerMonth(month1, year1) - day1 + 1; /* Number *nr = new Number(days, daysPerYear(year1, basis)); year1++; if(year1 != year2) { Number yfr(year2 - year1); nr->add(&yfr); } days = 0;*/ for(int month = 1; month < month2; month++) { days += daysPerMonth(month, year2); } days += day2 - 1; int days_of_years = 0; for(int year = year1; year <= year2; year++) { days_of_years += daysPerYear(year, basis); if(year != year1 && year != year2) { days += daysPerYear(year, basis); } } Number year_frac(days_of_years, year2 + 1 - year1); /* if(days > 0) { Number nr2(days, daysPerYear(year2, basis)); nr->add(&nr2); }*/ Number nr(days); nr /= year_frac; return nr; } else { int days = daysBetweenDates(date1, date2, basis, date_func); if(days < 0) return -1; return Number(days, daysPerYear(0, basis)); } return -1; } int daysBetweenDates(string date1, string date2, int basis, bool date_func) { int day1, day2, month1, month2, year1, year2; if(!s2date(date1, year1, month1, day1)) { return -1; } if(!s2date(date2, year2, month2, day2)) { return -1; } return daysBetweenDates(year1, month1, day1, year2, month2, day2, basis, date_func); } int daysBetweenDates(int year1, int month1, int day1, int year2, int month2, int day2, int basis, bool date_func) { if(basis < 0 || basis > 4) return -1; bool isleap = false; int days, months, years; if(year1 > year2 || (year1 == year2 && month1 > month2) || (year1 == year2 && month1 == month2 && day1 > day2)) { int year3 = year1, month3 = month1, day3 = day1; year1 = year2; month1 = month2; day1 = day2; year2 = year3; month2 = month3; day2 = day3; } years = year2 - year1; months = month2 - month1 + years * 12; days = day2 - day1; isleap = isLeapYear(year1); switch(basis) { case 0: { if(date_func) { if(month1 == 2 && ((day1 == 28 && !isleap) || (day1 == 29 && isleap)) && !(month2 == month1 && day1 == day2 && year1 == year2)) { if(isleap) return months * 30 + days - 1; else return months * 30 + days - 2; } if(day1 == 31 && day2 < 31) days++; } else { if(month1 == 2 && month2 != 2 && year1 == year2) { if(isleap) return months * 30 + days - 1; else return months * 30 + days - 2; } } return months * 30 + days; } case 1: {} case 2: {} case 3: { int month4 = month2; bool b; if(years > 0) { month4 = 12; b = true; } else { b = false; } for(; month1 < month4 || b; month1++) { if(month1 > month4 && b) { b = false; month1 = 1; month4 = month2; if(month1 == month2) break; } if(!b) { days += daysPerMonth(month1, year2); } else { days += daysPerMonth(month1, year1); } } if(years == 0) return days; //if(basis == 1) { for(year1 += 1; year1 < year2; year1++) { if(isLeapYear(year1)) days += 366; else days += 365; } return days; //} //if(basis == 2) return (years - 1) * 360 + days; //if(basis == 3) return (years - 1) * 365 + days; } case 4: { if(date_func) { if(day2 == 31 && day1 < 31) days--; if(day1 == 31 && day2 < 31) days++; } return months * 30 + days; } } return -1; } string& gsub(const string &pattern, const string &sub, string &str) { size_t i = str.find(pattern); while(i != string::npos) { str.replace(i, pattern.length(), sub); i = str.find(pattern, i + sub.length()); } return str; } string& gsub(const char *pattern, const char *sub, string &str) { size_t i = str.find(pattern); while(i != string::npos) { str.replace(i, strlen(pattern), string(sub)); i = str.find(pattern, i + strlen(sub)); } return str; } string& remove_blanks(string &str) { size_t i = str.find_first_of(SPACES, 0); while(i != string::npos) { str.erase(i, 1); i = str.find_first_of(SPACES, i); } return str; } string& remove_duplicate_blanks(string &str) { size_t i = str.find_first_of(SPACES, 0); while(i != string::npos) { if(i == 0 || is_in(SPACES, str[i - 1])) { str.erase(i, 1); } else { i++; } i = str.find_first_of(SPACES, i); } return str; } string& remove_blank_ends(string &str) { size_t i = str.find_first_not_of(SPACES); size_t i2 = str.find_last_not_of(SPACES); if(i != string::npos && i2 != string::npos) { if(i > 0 || i2 < str.length() - 1) { str = str.substr(i, i2 - i + 1); } } else { str.resize(0); } return str; } string& remove_parenthesis(string &str) { if(str[0] == LEFT_PARENTHESIS_CH && str[str.length() - 1] == RIGHT_PARENTHESIS_CH) { str = str.substr(1, str.length() - 2); return remove_parenthesis(str); } return str; } string d2s(double value, int precision) { // qgcvt(value, precision, buffer); sprintf(buffer, "%.*G", precision, value); string stmp = buffer; // gsub("e", "E", stmp); return stmp; } string p2s(void *o) { sprintf(buffer, "%p", o); string stmp = buffer; return stmp; } string i2s(int value) { // char buffer[10]; sprintf(buffer, "%i", value); string stmp = buffer; return stmp; } string i2s(long int value) { sprintf(buffer, "%li", value); string stmp = buffer; return stmp; } string i2s(unsigned int value) { sprintf(buffer, "%u", value); string stmp = buffer; return stmp; } string i2s(unsigned long int value) { sprintf(buffer, "%lu", value); string stmp = buffer; return stmp; } const char *b2yn(bool b, bool capital) { if(capital) { if(b) return _("Yes"); return _("No"); } if(b) return _("yes"); return _("no"); } const char *b2tf(bool b, bool capital) { if(capital) { if(b) return _("True"); return _("False"); } if(b) return _("true"); return _("false"); } const char *b2oo(bool b, bool capital) { if(capital) { if(b) return _("On"); return _("Off"); } if(b) return _("on"); return _("off"); } int s2i(const string& str) { return strtol(str.c_str(), NULL, 10); } int s2i(const char *str) { return strtol(str, NULL, 10); } void *s2p(const string& str) { void *p; sscanf(str.c_str(), "%p", &p); return p; } void *s2p(const char *str) { void *p; sscanf(str, "%p", &p); return p; } size_t find_ending_bracket(const string &str, size_t start, int *missing) { int i_l = 1; while(true) { start = str.find_first_of(LEFT_PARENTHESIS RIGHT_PARENTHESIS, start); if(start == string::npos) { if(missing) *missing = i_l; return string::npos; } if(str[start] == LEFT_PARENTHESIS_CH) { i_l++; } else { i_l--; if(!i_l) { if(missing) *missing = i_l; return start; } } start++; } } char op2ch(MathOperation op) { switch(op) { case OPERATION_ADD: return PLUS_CH; case OPERATION_SUBTRACT: return MINUS_CH; case OPERATION_MULTIPLY: return MULTIPLICATION_CH; case OPERATION_DIVIDE: return DIVISION_CH; case OPERATION_RAISE: return POWER_CH; case OPERATION_EXP10: return EXP_CH; default: return ' '; } } string& wrap_p(string &str) { str.insert(str.begin(), 1, LEFT_PARENTHESIS_CH); str += RIGHT_PARENTHESIS_CH; return str; } bool is_in(const char *str, char c) { for(size_t i = 0; i < strlen(str); i++) { if(str[i] == c) return true; } return false; } bool is_not_in(const char *str, char c) { for(size_t i = 0; i < strlen(str); i++) { if(str[i] == c) return false; } return true; } bool is_in(const string &str, char c) { for(size_t i = 0; i < str.length(); i++) { if(str[i] == c) return true; } return false; } bool is_not_in(const string &str, char c) { for(size_t i = 0; i < str.length(); i++) { if(str[i] == c) return false; } return true; } int sign_place(string *str, size_t start) { size_t i = str->find_first_of(OPERATORS, start); if(i != string::npos) return i; else return -1; } int gcd(int i1, int i2) { if(i1 < 0) i1 = -i1; if(i2 < 0) i2 = -i2; if(i1 == i2) return i2; int i3; if(i2 > i1) { i3 = i2; i2 = i1; i1 = i3; } while((i3 = i1 % i2) != 0) { i1 = i2; i2 = i3; } return i2; } size_t unicode_length(const string &str) { size_t l = str.length(), l2 = 0; for(size_t i = 0; i < l; i++) { if(str[i] > 0 || (unsigned char) str[i] >= 0xC2) { l2++; } } return l2; } size_t unicode_length(const char *str) { size_t l = strlen(str), l2 = 0; for(size_t i = 0; i < l; i++) { if(str[i] > 0 || (unsigned char) str[i] >= 0xC2) { l2++; } } return l2; } bool text_length_is_one(const string &str) { if(str.empty()) return false; if(str.length() == 1) return true; if(str[0] >= 0) return false; for(size_t i = 1; i < str.length(); i++) { if(str[i] > 0 || (unsigned char) str[i] >= 0xC2) { return false; } } return true; } bool equalsIgnoreCase(const string &str1, const string &str2) { if(str1.length() != str2.length()) return false; for(size_t i = 0; i < str1.length(); i++) { if(str1[i] < 0 && i + 1 < str1.length()) { if(str2[i] >= 0) return false; int i2 = 1; while(i2 + i < str1.length() && str1[i2 + i] < 0) { if(str2[i2 + i] >= 0) return false; i2++; } gchar *gstr1 = g_utf8_strdown(str1.c_str() + (sizeof(char) * i), i2); gchar *gstr2 = g_utf8_strdown(str2.c_str() + (sizeof(char) * i), i2); if(strcmp(gstr1, gstr2) != 0) return false; g_free(gstr1); g_free(gstr2); i += i2 - 1; } else if(str1[i] != str2[i] && !((str1[i] >= 'a' && str1[i] <= 'z') && str1[i] - 32 == str2[i]) && !((str1[i] <= 'Z' && str1[i] >= 'A') && str1[i] + 32 == str2[i])) { return false; } } return true; } bool equalsIgnoreCase(const string &str1, const char *str2) { if(str1.length() != strlen(str2)) return false; for(size_t i = 0; i < str1.length(); i++) { if(str1[i] < 0 && i + 1 < str1.length()) { if(str2[i] >= 0) return false; int i2 = 1; while(i2 + i < str1.length() && str1[i2 + i] < 0) { if(str2[i2 + i] >= 0) return false; i2++; } gchar *gstr1 = g_utf8_strdown(str1.c_str() + (sizeof(char) * i), i2); gchar *gstr2 = g_utf8_strdown(str2 + (sizeof(char) * i), i2); if(strcmp(gstr1, gstr2) != 0) return false; g_free(gstr1); g_free(gstr2); i += i2 - 1; } else if(str1[i] != str2[i] && !((str1[i] >= 'a' && str1[i] <= 'z') && str1[i] - 32 == str2[i]) && !((str1[i] <= 'Z' && str1[i] >= 'A') && str1[i] + 32 == str2[i])) { return false; } } return true; } void parse_qalculate_version(string qalculate_version, int *qalculate_version_numbers) { for(size_t i = 0; i < 3; i++) { size_t dot_i = qalculate_version.find("."); if(dot_i == string::npos) { qalculate_version_numbers[i] = s2i(qalculate_version); break; } qalculate_version_numbers[i] = s2i(qalculate_version.substr(0, dot_i)); qalculate_version = qalculate_version.substr(dot_i + 1, qalculate_version.length() - (dot_i + 1)); } } string getLocalDir() { string homedir = ""; struct passwd *pw = getpwuid(getuid()); if(pw) { homedir = pw->pw_dir; homedir += "/"; } homedir += ".qalculate/"; return homedir; } libqalculate-0.9.7/libqalculate/Function.h0000644000175100017510000006203411305546372015527 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #ifndef FUNCTION_H #define FUNCTION_H #include #include /** @file */ ///Argument types typedef enum { ARGUMENT_TYPE_FREE, ARGUMENT_TYPE_SYMBOLIC, ARGUMENT_TYPE_TEXT, ARGUMENT_TYPE_DATE, ARGUMENT_TYPE_FILE, ARGUMENT_TYPE_INTEGER, ARGUMENT_TYPE_NUMBER, ARGUMENT_TYPE_VECTOR, ARGUMENT_TYPE_MATRIX, ARGUMENT_TYPE_EXPRESSION_ITEM, ARGUMENT_TYPE_FUNCTION, ARGUMENT_TYPE_UNIT, ARGUMENT_TYPE_BOOLEAN, ARGUMENT_TYPE_VARIABLE, ARGUMENT_TYPE_ANGLE, ARGUMENT_TYPE_SET, ARGUMENT_TYPE_DATA_OBJECT, ARGUMENT_TYPE_DATA_PROPERTY } ArgumentType; ///Predefined max and min values for number and integer arguments. typedef enum { ARGUMENT_MIN_MAX_NONE, ARGUMENT_MIN_MAX_POSITIVE, ARGUMENT_MIN_MAX_NONZERO, ARGUMENT_MIN_MAX_NONNEGATIVE, ARGUMENT_MIN_MAX_NEGATIVE } ArgumentMinMaxPreDefinition; /// Type of mathematical function typedef enum { /// class MathFunction SUBTYPE_FUNCTION, /// class UseFunction SUBTYPE_USER_FUNCTION, /// class DataSet SUBTYPE_DATA_SET } FunctionSubtype; /// Abstract base class for mathematical functions. /** * A mathemical function, subclassed from MathFunction, should at least reimplement * calculate(MathStructure&, const MathStructure&, const EvaluationOptions&) and copy(), and preferably also the represents* functions. * Argument definitions should be added in the constructor. */ class MathFunction : public ExpressionItem { protected: int argc; int max_argc; vector default_values; Sgi::hash_map argdefs; size_t last_argdef_index; bool testArguments(MathStructure &vargs); virtual MathStructure createFunctionMathStructureFromVArgs(const MathStructure &vargs); virtual MathStructure createFunctionMathStructureFromSVArgs(vector &svargs); string scondition; public: MathFunction(string name_, int argc_, int max_argc_ = 0, string cat_ = "", string title_ = "", string descr_ = "", bool is_active = true); MathFunction(const MathFunction *function); MathFunction(); virtual ~MathFunction(); virtual ExpressionItem *copy() const = 0; virtual void set(const ExpressionItem *item); virtual int type() const; /** Returns the subtype of the mathematical function, corresponding to which subsubclass the object belongs to. * * @returns ::FunctionSubtype. */ virtual int subtype() const; bool testArgumentCount(int itmp); virtual MathStructure calculate(const string &eq, const EvaluationOptions &eo = default_evaluation_options); virtual MathStructure parse(const string &eq, const ParseOptions &po = default_parse_options); virtual int parse(MathStructure &mstruct, const string &eq, const ParseOptions &po = default_parse_options); virtual MathStructure calculate(MathStructure &vargs, const EvaluationOptions &eo = default_evaluation_options); /** * The main function for subclasses to reimplement. * Calculates a value from arguments in vargs and puts it in mstruct. * * This function expects the number of arguments to be equal to the maximum number of arguments, and checked by the argument definitions. * * If the return value is negative, then argument -(return value) has been evaluated in mstruct. * If -(return value) is greater than max arguments, then mstruct is a vector of evaluated argument values. * * @param[out] mstruct Structure that is set with the result of the calculation. * @param vargs Arguments passed to the mathematical function. * @param eo Evaluation options. * @returns 1 if the calculation was successful. */ virtual int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); /** Returns the functions condition expression. * * @returns The function's condition expression */ string condition() const; /** Print the function's condition expression with argument names. * * @returns The printed condition */ string printCondition(); /** Sets the functions condition expression. * * @param expression The function's new condition expression */ void setCondition(string expression); /** Test if arguments fulfil the function's condition expression. * * @param vargs Vector with arguments. * @returns true if the arguments fulfil the function's condition expression */ bool testCondition(const MathStructure &vargs); /** Returns the maximum number of arguments that the function accepts or -1 if the number of arguments is unlimited. */ int args() const; /** Returns the minimum number of arguments for the function. */ int minargs() const; /** Returns the maximum number of arguments that the function accepts or -1 if the number of arguments is unlimited. */ int maxargs() const; /** Parses arguments from a text string and places them in a vector. The text string should be a comma separated list of arguments. * * @param str The argument string to parse. * @param vargs Vector to store parsed arguments in. * @param po Parse options. * @returns The number of parsed arguments. */ int args(const string &str, MathStructure &vargs, const ParseOptions &po = default_parse_options); /** Returns the index of the last argument definition. * * @returns The index of the last argument definition */ size_t lastArgumentDefinitionIndex() const; /** Returns the argument definition for an argument index. * * @param index Argument index. * @returns The argument definition for the index or NULL if no the argument was not defined for the index */ Argument *getArgumentDefinition(size_t index); /** Removes all argument definitions for the function. */ void clearArgumentDefinitions(); /** Set the argument definition for an argument index. * * @param index Argument index. * @param argdef A newly allocated argument definition */ void setArgumentDefinition(size_t index, Argument *argdef); int stringArgs(const string &str, vector &svargs); void setDefaultValue(size_t arg_, string value_); const string &getDefaultValue(size_t arg_) const; void appendDefaultValues(MathStructure &vargs); MathStructure produceVector(const MathStructure &vargs, int begin = -1, int end = -1); MathStructure produceArgumentsVector(const MathStructure &vargs, int begin = -1, int end = -1); virtual bool representsPositive(const MathStructure&, bool = false) const; virtual bool representsNegative(const MathStructure&, bool = false) const; virtual bool representsNonNegative(const MathStructure&, bool = false) const; virtual bool representsNonPositive(const MathStructure&, bool = false) const; virtual bool representsInteger(const MathStructure&, bool = false) const; virtual bool representsNumber(const MathStructure&, bool = false) const; virtual bool representsRational(const MathStructure&, bool = false) const; virtual bool representsReal(const MathStructure&, bool = false) const; virtual bool representsComplex(const MathStructure&, bool = false) const; virtual bool representsNonZero(const MathStructure&, bool = false) const; virtual bool representsEven(const MathStructure&, bool = false) const; virtual bool representsOdd(const MathStructure&, bool = false) const; virtual bool representsUndefined(const MathStructure&) const; virtual bool representsBoolean(const MathStructure&) const; virtual bool representsNonMatrix(const MathStructure&) const; }; /// A user defined mathematical function. /** * User functions are functions defined using expression strings, representing mathematical formulas. * * The expression/formula of a function is basically a normal expression with placeholders for arguments. * These placeholders consists of a backslash and a letter — x, y, z for the 1st, 2nd and 3rd arguments and a to u for argument 4 to 24. * They are replaced by entered arguments when a function is calculated. * The placeholders naturally also decide the number of arguments that a function requires. * For example the function for triangle area ("base * height / 2") has the name triangle and the formula "(\x*\y)/2", * which gives that "triangle(2, 3)" equals "(2*3) / 2" and returns "3" as result. * An argument can be used more than one time and all arguments must not necessarily be in order in the formula. * * Additionally, optional arguments can be put in the formula with upper-case (X, Y, Z, ...) instead of lower-case letters (x, y, z, ...). * The default value can be put in brackets after the letter (ex. "\X{2}"). * The default value may be omitted and is then zero. All additional arguments after an optional argument must also be optional. * * To simplify the formula and make it more efficient, subfunctions can be used. * These works just like the main formula, using the arguments of it. * Subfunctions are referenced in the formula using \index ('\2', '\2', '\3', ...). * Even though it would be quite meaningless, the formula for triangle function could for example have a subfunction "\x*\y" and the formula "\1/2". * Subfunctions must be added before the main formula is set. */ class UserFunction : public MathFunction { protected: string sformula, sformula_calc; vector v_subs; vector v_precalculate; public: UserFunction(string cat_, string name_, string formula_, bool is_local = true, int argc_ = -1, string title_ = "", string descr_ = "", int max_argc_ = 0, bool is_active = true); UserFunction(const UserFunction *function); void set(const ExpressionItem *item); ExpressionItem *copy() const; /** Returns the external representation of the formula. */ string formula() const; /** Returns the internal representation of the formula. */ string internalFormula() const; int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); /** Sets the formula of the mathematical function. * * @param new_formula Formula/expression. * @param arc_ Minimum number of arguments or -1 to read from formula. * @param max_argc_ Maximum number of arguments (ignored if argc_ < 0) */ void setFormula(string new_formula, int argc_ = -1, int max_argc_ = 0); void addSubfunction(string subfunction, bool precalculate = true); /** Sets the formula for a subfunction. * * @param index Index (starting at 1). * @param subfunction Formula/expression. */ void setSubfunction(size_t index, string subfunction); void delSubfunction(size_t index); void clearSubfunctions(); size_t countSubfunctions() const; void setSubfunctionPrecalculated(size_t index, bool precalculate); const string &getSubfunction(size_t index) const; bool subfunctionPrecalculated(size_t index) const; int subtype() const; }; /// A mathematical function argument definition with free value and base class for all argument definitions. /** Free arguments accepts any value. */ class Argument { protected: string sname, scondition; bool b_zero, b_test, b_matrix, b_text, b_error, b_rational; /** This function is called from Argument::test() and performs validation specific to the argument definition type. * Should be reimplemented by all subclasses. * * @param value Value to test. * @param eo Evaluation options to use if the value needs to be evaluated. * @returns true if the value is valid for the argument definition. */ virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; /** This function is called from Argument::printlong() and returns description specific the argument definition type. * Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" * and Argument::printlong() might append " that fulfills the condition: even(\x)". * * @returns Long description. */ virtual string subprintlong() const; public: /** Creates a new argument definition. * * @param name Name/title of the argument definition. * @param does_test If argument values will be tested. * @param does_error If an error will issued if the value tests false. */ Argument(string name_ = "", bool does_test = true, bool does_error = true); /** Creates a copy of an argument definition. * * @param arg Argument to copy. */ Argument(const Argument *arg); /** Destructor */ virtual ~Argument(); /** Sets the argument to a copy of an argument definition. * * @param arg Argument to copy. */ virtual void set(const Argument *arg); /** Returns a copy of the argument definition. * * @returns A copy. */ virtual Argument *copy() const; /** Resturns a short description of the argument definition. * Ex. "number" for NumberArgument. * * @returns Short description. */ virtual string print() const; /** Resturns a long description of the argument definition. * Ex. "A real number > 2". * * @returns Long description. */ string printlong() const; /** Tests if a value fulfils the requirements of the argument definition. * The value might change if it has not been fully evaluated. * * @param value Value to test. * @param f Mathematical function that the value is an argument for. * @param eo Evaluation options to use if the value needs to be evaluated. * @returns true if the value is valid for the argument definition. */ bool test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo = default_evaluation_options) const; /** Parses an expression for an argument value. * The default behavior is to use Calculator::parse() directly. * * @param str Expression. * @param po Parse options. * @returns A new mathematical structure with the parsed expression. */ virtual MathStructure parse(const string &str, const ParseOptions &po = default_parse_options) const; /** Parses an expression for an argument value. * The default behavior is to use Calculator::parse() directly. * * @param mstruct Mathematical structure to set with the parsed expression. * @param str Expression. * @param po Parse options. */ virtual void parse(MathStructure *mstruct, const string &str, const ParseOptions &po = default_parse_options) const; /** Returns the name/title of the argument definition. * * @returns Name/title. */ string name() const; /** Sets the name/title of the argument definition. * * @param name_ New name/title. */ void setName(string name_); /** Sets a custom condition for argument values. * '\x' is replaced by the argument value in the expression. * * @param condition Condition expression. */ void setCustomCondition(string condition); /** Returns the custom condition expression set for argument values. * * @returns Custom condition for argument values. */ string getCustomCondition() const; /** If the value for the argument will be tested. If not, the argument only works as an suggestion and any value is allowed. * * @returns true if the argument value will be tested. */ bool tests() const; void setTests(bool does_error); /** If an error message will be presented to the user if the value for the argument is not allowed. * * @returns true if error messages will be shown. */ bool alerts() const; void setAlerts(bool does_error); /** If an argument value of zero is forbidden. * * @returns true if zero argument value is forbidden. */ bool zeroForbidden() const; /** Sets if a value of zero is forbidden for the argument value. * * @param forbid_zero If zero shall be forbidden. */ void setZeroForbidden(bool forbid_zero); bool matrixAllowed() const; void setMatrixAllowed(bool allow_matrix); /** If only rational polynomials are allowed as argument value. * * @see MathStructure::isRationalPolynomial() * @returns true if only rational polynomials is allowed. */ bool rationalPolynomial() const; void setRationalPolynomial(bool rational_polynomial); virtual bool suggestsQuotes() const; /** Returns the type of the argument, corresponding to which subclass the object belongs to. * * @returns ::ArgumentType. */ virtual int type() const; }; /// A definition for numerical arguments. /** These arguments allows numerical values. The value can be restricted to real or rational numbers (defaults to allow all numbers, including complex), and a max and/or min value. */ class NumberArgument : public Argument { protected: Number *fmin, *fmax; bool b_incl_min, b_incl_max; bool b_complex, b_rational_number; protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: NumberArgument(string name_ = "", ArgumentMinMaxPreDefinition minmax = ARGUMENT_MIN_MAX_NONE, bool does_test = true, bool does_error = true); NumberArgument(const NumberArgument *arg); virtual ~NumberArgument(); virtual void set(const Argument *arg); virtual Argument *copy() const; virtual string print() const; void setMin(const Number *nmin); void setIncludeEqualsMin(bool include_equals); bool includeEqualsMin() const; const Number *min() const; void setMax(const Number *nmax); void setIncludeEqualsMax(bool include_equals); bool includeEqualsMax() const; const Number *max() const; bool complexAllowed() const; void setComplexAllowed(bool allow_complex); bool rationalNumber() const; void setRationalNumber(bool rational_number); virtual int type() const; }; /// A definition for integer arguments. /** These arguments allows numerical integer values. The value can be restricted to a max and/or min value. */ class IntegerArgument : public Argument { protected: Number *imin, *imax; protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: IntegerArgument(string name_ = "", ArgumentMinMaxPreDefinition minmax = ARGUMENT_MIN_MAX_NONE, bool does_test = true, bool does_error = true); IntegerArgument(const IntegerArgument *arg); virtual ~IntegerArgument(); virtual void set(const Argument *arg); virtual Argument *copy() const; virtual string print() const; void setMin(const Number *nmin); const Number *min() const; void setMax(const Number *nmax); const Number *max() const; virtual int type() const; }; /// A symbolic argument. /** Accepts variables and symbolic structures. */ class SymbolicArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: SymbolicArgument(string name_ = "", bool does_test = true, bool does_error = true); SymbolicArgument(const SymbolicArgument *arg); virtual ~SymbolicArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; /// A text argument. /** Accepts text (symbolic) structures. Argument values are parsed as text, unless surrounded by back slashes (which are then removed). Surrounding Parentheses and first quotation marks are removed. */ class TextArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: TextArgument(string name_ = "", bool does_test = true, bool does_error = true); TextArgument(const TextArgument *arg); virtual ~TextArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; virtual bool suggestsQuotes() const; }; /// A date argument. /** A text argument representing a date. */ class DateArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: DateArgument(string name_ = "", bool does_test = true, bool does_error = true); DateArgument(const DateArgument *arg); virtual ~DateArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; /// A vector argument. /** */ class VectorArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; vector subargs; bool b_argloop; public: VectorArgument(string name_ = "", bool does_test = true, bool allow_matrix = false, bool does_error = true); VectorArgument(const VectorArgument *arg); virtual ~VectorArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; bool reoccuringArguments() const; void setReoccuringArguments(bool reocc); void addArgument(Argument *arg); void delArgument(size_t index); size_t countArguments() const; Argument *getArgument(size_t index) const; }; /// A matrix argument. /** */ class MatrixArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; bool b_square; public: MatrixArgument(string name_ = "", bool does_test = true, bool does_error = true); MatrixArgument(const MatrixArgument *arg); virtual bool squareDemanded() const; virtual void setSquareDemanded(bool square); virtual ~MatrixArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; /// Argument for functions, variables and units. /** Text string representing a function, variable or unit name. */ class ExpressionItemArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: ExpressionItemArgument(string name_ = "", bool does_test = true, bool does_error = true); ExpressionItemArgument(const ExpressionItemArgument *arg); virtual ~ExpressionItemArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; /// A function argument. /** */ class FunctionArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: FunctionArgument(string name_ = "", bool does_test = true, bool does_error = true); FunctionArgument(const FunctionArgument *arg); virtual ~FunctionArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; /// A boolean argument. /** Accepts zero or one. */ class BooleanArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: BooleanArgument(string name_ = "", bool does_test = true, bool does_error = true); BooleanArgument(const BooleanArgument *arg); virtual ~BooleanArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; class UnitArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: UnitArgument(string name_ = "", bool does_test = true, bool does_error = true); UnitArgument(const UnitArgument *arg); virtual ~UnitArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; class AngleArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: AngleArgument(string name_ = "", bool does_test = true, bool does_error = true); AngleArgument(const AngleArgument *arg); virtual ~AngleArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; virtual void parse(MathStructure *mstruct, const string &str, const ParseOptions &po = default_parse_options) const; }; class VariableArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: VariableArgument(string name_ = "", bool does_test = true, bool does_error = true); VariableArgument(const VariableArgument *arg); virtual ~VariableArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; class FileArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: FileArgument(string name_ = "", bool does_test = true, bool does_error = true); FileArgument(const FileArgument *arg); virtual ~FileArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; /// A set of accepted arguments. /** This is used when several different type of argments shall be accepted by a function. */ class ArgumentSet : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; vector subargs; public: ArgumentSet(string name_ = "", bool does_test = true, bool does_error = true); ArgumentSet(const ArgumentSet *arg); virtual ~ArgumentSet(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; void addArgument(Argument *arg); void delArgument(size_t index); size_t countArguments() const; Argument *getArgument(size_t index) const; }; #endif libqalculate-0.9.7/libqalculate/Prefix.h0000644000175100017510000001661711305546373015206 00000000000000/* Qalculate Copyright (C) 2003-2006 Niklas Knutsson (nq@altern.org) 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. */ #ifndef PREFIX_H #define PREFIX_H #include #include /** @file */ ///Types for prefix classes. typedef enum { PREFIX_DECIMAL, PREFIX_BINARY, PREFIX_NUMBER } PrefixType; ///Abstract class for prefixes. /** A prefix is prepended to a unit to specificy a quantity multiplicator. A prefix has a numerical value which raised to the units power defines the quantity. In for example the expression "3 kilometers", meter is the unit, 3 is regular quantity, and kilo is a prefix with a value 1000, thus the example equals "3000 meters". If the unit instead had been squared, the value of the prefix would have been raised by two and the total quantity would have been 3.000.000. Prefixes can have up to free different three names -- a long name, a short name and a short unicode name. The unicode name is an alternative to the short name that is preferred if unicode characters can be displayed. The names or used to reference the prefix in mathematical expressions and to display a prefix in a result. */ class Prefix { protected: string l_name, s_name, u_name; public: /** Create a prefix. * * @param long_name Long name. * @param short_name Short name. * @param unicode_name Unicode name. */ Prefix(string long_name, string short_name = "", string unicode_name = ""); virtual ~Prefix(); /** Returns the short name of the prefix. * * @param return_long_if_no_short If the long name shall be returned if the prefix has not got a short name (if it is empty). * @param use_unicode If a unicode version of the name is allowed and preferred. * @returns The short name of the prefix. */ const string &shortName(bool return_long_if_no_short = true, bool use_unicode = false) const; /** Returns the long name of the prefix. * * @param return_short_if_no_long If the short name shall be returned if the prefix has not got a long name (if it is empty). * @param use_unicode If a unicode version of the name is allowed and preferred. * @returns The long name of the prefix. */ const string &longName(bool return_short_if_no_long = true, bool use_unicode = false) const; /** Returns the unicode name of the prefix. * * @param return_short_if_no_uni If the short name shall be returned if the prefix has not got a unicode name (if it is empty). * @returns The unicode name of the prefix. */ const string &unicodeName(bool return_short_if_no_uni = true) const; /** Sets the short name of the prefix. * * @param short_name The new short name for the prefix. */ void setShortName(string short_name); /** Sets the long name of the prefix. * * @param long_name The new long name for the prefix. */ void setLongName(string long_name); /** Sets the unicode name of the prefix. The unicode name is an alternative to the short name that is preferred if unicode characters can be displayed. * * @param unicode_name The new unicode name for the prefix. */ void setUnicodeName(string unicode_name); /** Returns a preferred name of the prefix. * * @param short_default If a short name is preferred. * @param use_unicode If a unicode name is preferred. * @param can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected. * @param can_display_unicode_string_arg Argument to pass to the above test function. * @returns A preferred name. */ const string &name(bool short_default = true, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; /** Returns the value of the prefix. * * @param nexp The power of the prefixed unit. * @returns The value of the prefix. */ virtual Number value(const Number &nexp) const = 0; /** Returns the value of the prefix. * * @param iexp The power of the prefixed unit. * @returns The value of the prefix. */ virtual Number value(int iexp) const = 0; /** Returns the value of the prefix. * * @returns The value of the prefix. */ virtual Number value() const = 0; /** Returns type, subclass, of the prefix. This can be PREFIX_DECIMAL for prefixes of the class DecimalPrefix, PREFIX_BINARY for BinaryPrefix, or PREFIX_NUMBER for NumberPrefix. * * @returns The type of the prefix. */ virtual int type() const = 0; }; ///A decimal (metric) prefix. /** A metric or decimal prefix has an integer exponent which with a base of ten constitutes the value of the prefix (value=10^exponent). */ class DecimalPrefix : public Prefix { protected: int exp; public: /** Create a decimal prefix. * * @param exp10 Exponent for the value. * @param long_name Long name. * @param short_name Short name. * @param unicode_name Unicode name. */ DecimalPrefix(int exp10, string long_name, string short_name = "", string unicode_name = ""); ~DecimalPrefix(); /** Returns the exponent. * * @param iexp Exponent of the unit. * @returns The exponent of the prefix. */ int exponent(int iexp = 1) const; /** Returns the exponent. * * @param nexp Exponent of the unit. * @returns The exponent of the prefix. */ Number exponent(const Number &nexp) const; /** Sets the exponent of the prefix. * * @param iexp New exponent for the prefix. */ void setExponent(int iexp); Number value(const Number &nexp) const; Number value(int iexp) const; Number value() const; int type() const; }; ///A binary prefix. /** A Binary prefix has an integer exponent which with a base of two constitutes the value of the prefix (value=2^exponent). */ class BinaryPrefix : public Prefix { protected: int exp; public: /** Create a binary prefix. * * @param exp2 Exponent for the value. * @param long_name Long name. * @param short_name Short name. * @param unicode_name Unicode name. */ BinaryPrefix(int exp2, string long_name, string short_name = "", string unicode_name = ""); ~BinaryPrefix(); /** Returns the exponent. * * @param iexp Exponent of the unit. * @returns The exponent of the prefix. */ int exponent(int iexp = 1) const; /** Returns the exponent. * * @param nexp Exponent of the unit. * @returns The exponent of the prefix. */ Number exponent(const Number &nexp) const; /** Sets the exponent of the prefix. * * @param iexp New exponent for the prefix. */ void setExponent(int iexp); Number value(const Number &nexp) const; Number value(int iexp) const; Number value() const; int type() const; }; ///A prefix with a free numerical value. /** A prefix without any predefined base, which can use any number. */ class NumberPrefix : public Prefix { protected: Number o_number; public: /** Create a number prefix. * * @param nr Value of the prefix. * @param long_name Long name. * @param short_name Short name. * @param unicode_name Unicode name. */ NumberPrefix(const Number &nr, string long_name, string short_name = "", string unicode_name = ""); ~NumberPrefix(); /** Sets the value of the prefix. * * @param nr New value for the prefix. */ void setValue(const Number &nr); Number value(const Number &nexp) const; Number value(int iexp) const; Number value() const; int type() const; }; #endif libqalculate-0.9.7/libqalculate/Unit.h0000644000175100017510000003023511305546373014660 00000000000000/* Qalculate Copyright (C) 2003-2007 Niklas Knutsson (nq@altern.org) 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. */ #ifndef UNIT_H #define UNIT_H /** @file */ /// Type of unit typedef enum { /// class Unit SUBTYPE_BASE_UNIT, /// class AliasUnit SUBTYPE_ALIAS_UNIT, /// class CompositeUnit SUBTYPE_COMPOSITE_UNIT } UnitSubtype; #include #include /// A unit for measurement. /** * The Unit class both represents a base unit and is the base class for other unit types. * Base units are units defined as basis for other units. Meters and seconds are typical base units. * * For base units, a name is all that is needed. * Base units do however normally have three different names defined for use in expressions - abbreviation (ex. "m"), singular ("meter") and plural ("meters"). */ class Unit : public ExpressionItem { protected: string ssystem; bool b_si; public: Unit(string cat_, string name_, string plural_ = "", string singular_ = "", string title_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); Unit(); Unit(const Unit *unit); virtual ~Unit(); virtual ExpressionItem *copy() const; virtual void set(const ExpressionItem *item); /** Returns if the unit is part of the SI standard. * * @returns true if the unit is part of the SI standard. */ bool isSIUnit() const; /** State that the unit is part of the SI standard. * Sets system to "SI". */ void setAsSIUnit(); /** Sets which system/standard ("SI", "SGC", etc.) the unit is part of. * Setting system to "SI" (case-insensitive), is equivalent to setAsSIUnit(). */ void setSystem(string s_system); /** Returns the system/standard that the unit is part of. * * @returns System string. */ const string &system() const; /** Returns if the unit is a currency (Euro is base unit). * * @returns true if the unit is a currency. */ bool isCurrency() const; /** Returns a display string representing the unit in an expression. * * Equivalent to preferredName() for Unit and AliasUnit, but closer to MathStructure::print() for CompositeUnit (prints out base expression). */ virtual string print(bool plural_, bool short_, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual const string &plural(bool return_singular_if_no_plural = true, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual const string &singular(bool return_abbreviation_if_no_singular = true, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual const string &abbreviation(bool return_singular_if_no_abbreviation = true, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual bool isUsedByOtherUnits() const; virtual Unit* baseUnit() const; virtual MathStructure &convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertToBaseUnit(MathStructure &mvalue) const; virtual MathStructure &convertFromBaseUnit(MathStructure &mvalue) const; virtual MathStructure convertToBaseUnit() const; virtual MathStructure convertFromBaseUnit() const; virtual int baseExponent(int exp = 1) const; virtual int type() const; /** Returns the subtype of the unit, corresponding to which subsubclass the object belongs to. * * @returns ::UnitSubtype. */ virtual int subtype() const; /** If specified unit is a base unit for this unit, directly or with other units in between. * Equivalent to u->isParentOf(this). */ virtual bool isChildOf(Unit *u) const; /** If this unit is a base unit for specified unit, directly or with other units in between. * Equivalent to u->isChildOf(this). */ virtual bool isParentOf(Unit *u) const; virtual bool hasComplexRelationTo(Unit *u) const; /** Converts a value from specified unit and exponent to this unit. * value * (unit^exponent) = new value * (this^new exponent) * This function cannot convert to or from CompositeUnit. * * @param u Unit to convert from. * @param[in,out] mvalue Quantity value. * @param[in,out] exp Exponent. * @returns true if the value was successfully converted. */ bool convert(Unit *u, MathStructure &mvalue, MathStructure &exp) const; /** Converts a value from specified unit and exponent to this unit. * value * unit = new value * this * This function cannot convert to or from CompositeUnit. * * @param u Unit to convert from. * @param[in,out] mvalue Quantity value. * @returns true if the value was successfully converted. */ bool convert(Unit *u, MathStructure &mvalue) const; MathStructure convert(Unit *u, bool *converted = NULL) const; }; /// An unit with relation to another unit /** * Alias units is defined in relation to another unit. * For example, hour are defined as an alias unit that equals 60 minutes which in turn is defined in relation to seconds. * * Alias units have an associated base unit, exponent and relation expression. * For more complex relations an inverse relation can also be specified for conversion back from the base unit. * The base unit must not necessarily be of the base unit class and it is recommended that an alias unit is defined in relation to the closest unit * (ex. 1ft = 3 hands, 1 hand = 4 in, and 1 in = 0.0254 m). * * The relation is usually just a number that tells how large quantity of the base unit is needed to get the alias unit (alias unit = base unit * relation). * More complex units can specify the relation as a full-blown expression where '\x' is replaced by the quantity of the base unit and * '\y' is the exponent. * For example, Degrees Celsius has the relation "\x + 273.15" and the inverse relation "\x - 273.15" to the base unit Kelvin. * For simple relations, the reversion is automatic and ought not be defined separately. * * The precision property inherited from ExpressionItem defines the precision of the relation. * * The exponent defines the exponential relation to the base unit, so that the alias unit equals the base unit raised to the exponent. * For simple unit relations this gives: alias unit = relation * base unit^exponent. * * Alias units normally have three different names defined for use in expressions - abbreviation (ex. "m"), singular ("meter") and plural ("meters"). */ class AliasUnit : public Unit { protected: string svalue, sinverse; int i_exp; Unit *o_unit; public: AliasUnit(string cat_, string name_, string plural_, string singular_, string title_, Unit *alias, string relation = "1", int exp = 1, string inverse = "", bool is_local = true, bool is_builtin = false, bool is_active = true); AliasUnit(const AliasUnit *unit); AliasUnit(); virtual ~AliasUnit(); virtual ExpressionItem *copy() const; virtual void set(const ExpressionItem *item); virtual Unit* baseUnit() const; virtual Unit* firstBaseUnit() const; virtual void setBaseUnit(Unit *alias); virtual string expression() const; virtual string inverseExpression() const; /** * Sets the relation expression. */ virtual void setExpression(string relation); /** * Sets the inverse relation expression. */ virtual void setInverseExpression(string inverse); virtual MathStructure &convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertToBaseUnit(MathStructure &mvalue) const; virtual MathStructure &convertFromBaseUnit(MathStructure &mvalue) const; virtual MathStructure convertToBaseUnit() const; virtual MathStructure convertFromBaseUnit() const; virtual int baseExponent(int exp = 1) const; virtual void setExponent(int exp); virtual int firstBaseExponent() const; virtual int subtype() const; virtual bool isChildOf(Unit *u) const; virtual bool isParentOf(Unit *u) const; virtual bool hasComplexExpression() const; virtual bool hasComplexRelationTo(Unit *u) const; }; /// A subunit in a CompositeUnit /** * Should normally not be used directly. */ class AliasUnit_Composite : public AliasUnit { protected: Prefix *prefixv; public: AliasUnit_Composite(Unit *alias, int exp = 1, Prefix *prefix_ = NULL); AliasUnit_Composite(const AliasUnit_Composite *unit); virtual ~AliasUnit_Composite(); virtual ExpressionItem *copy() const; virtual void set(const ExpressionItem *item); virtual string print(bool plural_, bool short_, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual Prefix *prefix() const; virtual int prefixExponent() const; virtual void set(Unit *u, int exp = 1, Prefix *prefix_ = NULL); virtual MathStructure &convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; }; /// A unit consisting of a number of other units /** * Composite units are defined by a unit expression with multiple units. * Composite units often have an alias unit associated with them, as they do not have a reference name on their own. * For example, a joule is defined as an alias defined in relation to a composite unit defined as "Newton * meter". * * The names of composite units is only used to reference the unit in definitions of other units. * They can not be used in expressions. * * Composite units is definited as a composition of units. * The units, with prefixes and exponents, can either be added one by one with add() or * parsed from an expression (ex. "cm^3/g) with setBaseExpression(). */ class CompositeUnit : public Unit { protected: string sshort; vector units; public: CompositeUnit(string cat_, string name_, string title_ = "", string base_expression_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); CompositeUnit(const CompositeUnit *unit); virtual ~CompositeUnit(); virtual ExpressionItem *copy() const; virtual void set(const ExpressionItem *item); /** Adds a sub/base unit with specified exponent and an optional prefix. * * @param u Unit. * @param exp Exponent. * @param prefix Prefix. */ virtual void add(Unit *u, int exp = 1, Prefix *prefix = NULL); /** Retrieves information about a sub/base unit * * @param index Index starting at 1. * @param[out] exp Exponent. * @param[out] prefix Prefix. * @returns Sub/base unit (AliasUnit_Composite::firstBaseUnit()). */ virtual Unit *get(size_t index, int *exp = NULL, Prefix **prefix = NULL) const; virtual void setExponent(size_t index, int exp); virtual void setPrefix(size_t index, Prefix *prefix); /** Returns the number of sub/base units */ virtual size_t countUnits() const; virtual size_t find(Unit *u) const; virtual void del(size_t index); /** Prints out the sub/base units with prefixes and exponents. * This is the representation of the unit in expressions. */ virtual string print(bool plural_, bool short_, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual int subtype() const; /** If this unit contains a sub/base unit with a relation to the specified unit. */ virtual bool containsRelativeTo(Unit *u) const; /** Creates a MathStructure with the sub/base units of the unit. */ virtual MathStructure generateMathStructure(bool make_division = false) const; virtual void setBaseExpression(string base_expression_); /** Removes all sub/base units. */ virtual void clear(); }; #endif libqalculate-0.9.7/NEWS0000644000175100017510000000001511305546371011614 00000000000000see changeloglibqalculate-0.9.7/README0000644000175100017510000000004711305546371012002 00000000000000Visit http://qalculate.sourceforge.net/libqalculate-0.9.7/omf.make0000644000175100017510000000404311305546371012542 00000000000000# # No modifications of this Makefile should be necessary. # # This file contains the build instructions for installing OMF files. It is # generally called from the makefiles for particular formats of documentation. # # Note that you must configure your package with --localstatedir=/var/lib # so that the scrollkeeper-update command below will update the database # in the standard scrollkeeper directory. # # If it is impossible to configure with --localstatedir=/var/lib, then # modify the definition of scrollkeeper_localstate_dir so that # it points to the correct location. Note that you must still use # $(localstatedir) in this or when people build RPMs it will update # the real database on their system instead of the one under RPM_BUILD_ROOT. # # Note: This make file is not incorporated into xmldocs.make because, in # general, there will be other documents install besides XML documents # and the makefiles for these formats should also include this file. # # About this file: # This file was taken from scrollkeeper_example2, a package illustrating # how to install documentation and OMF files for use with ScrollKeeper # 0.3.x and 0.4.x. For more information, see: # http://scrollkeeper.sourceforge.net/ # Version: 0.1.2 (last updated: March 20, 2002) # omf_dest_dir=$(datadir)/omf/@PACKAGE@ scrollkeeper_localstate_dir = $(localstatedir)/scrollkeeper CLEANFILES += *.out omf: omf_timestamp omf_timestamp: $(omffile) -for file in $(omffile); do \ scrollkeeper-preinstall $(docdir)/$(docname).xml $(srcdir)/$$file $$file.out; \ done touch omf_timestamp install-data-hook-omf: $(mkinstalldirs) $(DESTDIR)$(omf_dest_dir) for file in $(omffile); do \ $(INSTALL_DATA) $$file.out $(DESTDIR)$(omf_dest_dir)/$$file; \ done -scrollkeeper-update -p $(scrollkeeper_localstate_dir) -o $(DESTDIR)$(omf_dest_dir) uninstall-local-omf: -for file in $(srcdir)/*.omf; do \ basefile=`basename $$file`; \ rm -f $(DESTDIR)$(omf_dest_dir)/$$basefile; \ done -rmdir $(DESTDIR)$(omf_dest_dir) -scrollkeeper-update -p $(scrollkeeper_localstate_dir) libqalculate-0.9.7/TODO0000644000175100017510000000067511305546371011621 00000000000000* Implement signals for deleted variables etc. * Sort out when small floats really are zero due to limited precision * Quoted ")" in function * Plot-functions * Replace pointers to unit when unit type has changed (a different object must be created) * Sort out percentile and provide alternative methods * More functions * More units * Increase support for non-glibc systems * Sane and stable API * Script/code plugins for advanced functionslibqalculate-0.9.7/po/0000777000175100017510000000000011320655052011615 500000000000000libqalculate-0.9.7/po/fr.po0000644000175100017510000015341511306001256012504 00000000000000# translation of fr.po to Français # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Nicolas Laug , 2006. msgid "" msgstr "" "Project-Id-Version: fr\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-05-08 14:49+0200\n" "PO-Revision-Date: 2006-11-08 21:13-0500\n" "Last-Translator: Nicolas Laug \n" "Language-Team: Français \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" #: ../src/qalc.cc:94 ../src/qalc.cc:144 ../src/qalc.cc:1686 #: ../src/qalc.cc:1687 ../libqalculate/util.cc:562 msgid "yes" msgstr "oui" #: ../src/qalc.cc:95 ../src/qalc.cc:146 ../src/qalc.cc:1686 #: ../src/qalc.cc:1687 ../libqalculate/util.cc:563 msgid "no" msgstr "non" #: ../src/qalc.cc:96 ../libqalculate/util.cc:570 msgid "true" msgstr "vrai" #: ../src/qalc.cc:97 ../libqalculate/util.cc:571 msgid "false" msgstr "faux" #: ../src/qalc.cc:98 ../src/qalc.cc:610 ../src/qalc.cc:625 ../src/qalc.cc:1230 #: ../src/qalc.cc:1648 ../src/qalc.cc:1650 ../src/qalc.cc:1653 #: ../src/qalc.cc:1654 ../src/qalc.cc:1659 ../src/qalc.cc:1660 #: ../src/qalc.cc:1661 ../src/qalc.cc:1662 ../src/qalc.cc:1664 #: ../src/qalc.cc:1665 ../src/qalc.cc:1666 ../src/qalc.cc:1668 #: ../src/qalc.cc:1669 ../src/qalc.cc:1671 ../src/qalc.cc:1672 #: ../src/qalc.cc:1673 ../src/qalc.cc:1674 ../src/qalc.cc:1675 #: ../src/qalc.cc:1679 ../src/qalc.cc:1681 ../src/qalc.cc:1682 #: ../src/qalc.cc:1683 ../src/qalc.cc:1684 ../src/qalc.cc:1685 #: ../src/qalc.cc:1688 ../src/qalc.cc:1689 ../src/qalc.cc:1690 #: ../src/qalc.cc:1691 ../src/qalc.cc:1692 ../src/qalc.cc:1693 #: ../src/qalc.cc:1694 ../src/qalc.cc:1695 ../src/qalc.cc:1696 #: ../src/qalc.cc:1697 ../libqalculate/util.cc:578 msgid "on" msgstr "marche" #: ../src/qalc.cc:99 ../src/qalc.cc:557 ../src/qalc.cc:583 ../src/qalc.cc:595 #: ../src/qalc.cc:608 ../src/qalc.cc:623 ../src/qalc.cc:1218 #: ../src/qalc.cc:1228 ../src/qalc.cc:1250 ../src/qalc.cc:1257 #: ../src/qalc.cc:1272 ../src/qalc.cc:1648 ../src/qalc.cc:1650 #: ../src/qalc.cc:1653 ../src/qalc.cc:1654 ../src/qalc.cc:1659 #: ../src/qalc.cc:1660 ../src/qalc.cc:1661 ../src/qalc.cc:1662 #: ../src/qalc.cc:1664 ../src/qalc.cc:1665 ../src/qalc.cc:1666 #: ../src/qalc.cc:1667 ../src/qalc.cc:1668 ../src/qalc.cc:1669 #: ../src/qalc.cc:1671 ../src/qalc.cc:1672 ../src/qalc.cc:1673 #: ../src/qalc.cc:1674 ../src/qalc.cc:1675 ../src/qalc.cc:1676 #: ../src/qalc.cc:1677 ../src/qalc.cc:1679 ../src/qalc.cc:1681 #: ../src/qalc.cc:1682 ../src/qalc.cc:1683 ../src/qalc.cc:1684 #: ../src/qalc.cc:1685 ../src/qalc.cc:1688 ../src/qalc.cc:1689 #: ../src/qalc.cc:1690 ../src/qalc.cc:1691 ../src/qalc.cc:1692 #: ../src/qalc.cc:1693 ../src/qalc.cc:1694 ../src/qalc.cc:1695 #: ../src/qalc.cc:1696 ../src/qalc.cc:1697 ../libqalculate/util.cc:579 msgid "off" msgstr "arrêt" #: ../src/qalc.cc:149 msgid "Please answer yes or no" msgstr "Merci de répondre oui ou non" #: ../src/qalc.cc:156 ../src/qalc.cc:1179 ../src/qalc.cc:1604 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "unknown" msgstr "inconnue" #: ../src/qalc.cc:162 ../src/qalc.cc:414 ../src/qalc.cc:445 ../src/qalc.cc:499 #: ../src/qalc.cc:513 ../src/qalc.cc:1137 ../src/qalc.cc:1148 #: ../src/qalc.cc:1183 ../src/qalc.cc:1198 ../src/qalc.cc:1649 #: ../src/qalc.cc:1651 ../src/qalc.cc:1656 ../src/qalc.cc:1658 msgid "none" msgstr "aucun" #: ../src/qalc.cc:164 ../src/qalc.cc:1176 ../src/qalc.cc:1601 #: ../src/qalc.cc:1704 msgid "non-matrix" msgstr "non-matriciel" #: ../src/qalc.cc:166 ../src/qalc.cc:1174 ../src/qalc.cc:1599 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "complex" msgstr "complexe" #: ../src/qalc.cc:168 ../src/qalc.cc:1173 ../src/qalc.cc:1598 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "real" msgstr "réel" #: ../src/qalc.cc:170 ../src/qalc.cc:1175 ../src/qalc.cc:1600 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 ../libqalculate/Function.cc:1499 msgid "number" msgstr "nombre" #: ../src/qalc.cc:172 ../src/qalc.cc:1172 ../src/qalc.cc:1597 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "rational" msgstr "rationnel" #: ../src/qalc.cc:174 ../src/qalc.cc:1171 ../src/qalc.cc:1596 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 ../libqalculate/Function.cc:1654 msgid "integer" msgstr "entier" #: ../src/qalc.cc:176 ../src/qalc.cc:1166 ../src/qalc.cc:1591 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "non-zero" msgstr "non nul" #: ../src/qalc.cc:178 ../src/qalc.cc:1162 ../src/qalc.cc:1587 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "positive" msgstr "strictement positif" #: ../src/qalc.cc:180 ../src/qalc.cc:1165 ../src/qalc.cc:1590 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "non-negative" msgstr "positif" #: ../src/qalc.cc:182 msgid "negatve" msgstr "strictement négatif" #: ../src/qalc.cc:184 ../src/qalc.cc:1163 ../src/qalc.cc:1588 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "non-positive" msgstr "négatif" #: ../src/qalc.cc:187 msgid "Unrecognized assumption." msgstr "Hypothèse non reconnue" #: ../src/qalc.cc:319 ../src/qalc.cc:320 msgid "" "\n" "Press Enter to continue." msgstr "" "\n" "Appuyez sur Entrée pour continuer" #: ../src/qalc.cc:328 ../src/qalc.cc:329 ../src/qalc.cc:330 ../src/qalc.cc:429 #: ../src/qalc.cc:432 ../src/qalc.cc:529 ../src/qalc.cc:540 ../src/qalc.cc:549 msgid "Illegal value" msgstr "Valeur illégale" #. qalc command #: ../src/qalc.cc:344 ../src/qalc.cc:501 ../src/qalc.cc:1064 #: ../src/qalc.cc:1115 ../src/qalc.cc:1185 ../src/qalc.cc:1188 #: ../src/qalc.cc:1304 ../src/qalc.cc:1656 ../src/qalc.cc:1657 #: ../src/qalc.cc:1740 msgid "base" msgstr "-" #: ../src/qalc.cc:344 ../src/qalc.cc:346 ../src/qalc.cc:1235 #: ../src/qalc.cc:1670 msgid "input base" msgstr "base de la saisie" #: ../src/qalc.cc:344 msgid "output base" msgstr "base de la sortie" #: ../src/qalc.cc:347 ../src/qalc.cc:1190 ../src/qalc.cc:1237 #: ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "roman" msgstr "-" #: ../src/qalc.cc:348 ../src/qalc.cc:1192 ../src/qalc.cc:1657 msgid "time" msgstr "temps" #: ../src/qalc.cc:349 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "hex" msgstr "-" #: ../src/qalc.cc:349 msgid "hexadecimal" msgstr "hexadécimal" #: ../src/qalc.cc:350 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "bin" msgstr "-" #: ../src/qalc.cc:350 msgid "binary" msgstr "binaire" #: ../src/qalc.cc:351 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "oct" msgstr "-" #: ../src/qalc.cc:351 msgid "octal" msgstr "-" #: ../src/qalc.cc:352 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "dec" msgstr "-" #: ../src/qalc.cc:352 msgid "decimal" msgstr "décimal" #: ../src/qalc.cc:353 ../src/qalc.cc:1657 msgid "sex" msgstr "-" #: ../src/qalc.cc:353 ../src/qalc.cc:1191 msgid "sexagesimal" msgstr "sexagésimal" #: ../src/qalc.cc:370 ../src/qalc.cc:412 ../src/qalc.cc:1196 #: ../src/qalc.cc:1658 msgid "base display" msgstr "affichage de la base" #: ../src/qalc.cc:374 msgid "Illegal base." msgstr "Base illégale." #: ../src/qalc.cc:382 ../src/qalc.cc:1180 ../src/qalc.cc:1655 msgid "assumptions" msgstr "hypothèses" #: ../src/qalc.cc:392 ../src/qalc.cc:1142 ../src/qalc.cc:1650 msgid "all prefixes" msgstr "tous les préfixes" #: ../src/qalc.cc:393 ../src/qalc.cc:1205 ../src/qalc.cc:1661 msgid "complex numbers" msgstr "nombres complexes" #: ../src/qalc.cc:394 ../src/qalc.cc:1215 ../src/qalc.cc:1666 msgid "excessive parenthesis" msgstr "parenthèses en excès" #: ../src/qalc.cc:395 ../src/qalc.cc:1234 ../src/qalc.cc:1669 msgid "functions" msgstr "fonctions" #: ../src/qalc.cc:396 ../src/qalc.cc:1242 ../src/qalc.cc:1671 msgid "infinite numbers" msgstr "nombres infinis" #: ../src/qalc.cc:397 ../src/qalc.cc:1283 ../src/qalc.cc:1689 msgid "show negative exponents" msgstr "afficher les exposants négatifs" #: ../src/qalc.cc:398 ../src/qalc.cc:1158 ../src/qalc.cc:1653 msgid "assume nonzero denominators" msgstr "supposer que les dénominateurs sont non nuls" #: ../src/qalc.cc:399 ../src/qalc.cc:1159 ../src/qalc.cc:1654 msgid "warn nonzero denominators" msgstr "avertir des dénominateurs non nuls" #: ../src/qalc.cc:400 ../src/qalc.cc:1269 ../src/qalc.cc:1681 msgid "prefixes" msgstr "préfixes" #: ../src/qalc.cc:401 ../src/qalc.cc:1206 ../src/qalc.cc:1662 msgid "denominator prefixes" msgstr "préfixes des dénominateurs" #: ../src/qalc.cc:402 ../src/qalc.cc:1267 ../src/qalc.cc:1679 msgid "place units separately" msgstr "placer les unités séparément" #: ../src/qalc.cc:403 ../src/qalc.cc:1204 ../src/qalc.cc:1660 msgid "calculate variables" msgstr "calculer les variables" #: ../src/qalc.cc:404 ../src/qalc.cc:1203 ../src/qalc.cc:1659 msgid "calculate functions" msgstr "calculer les fonctions" #: ../src/qalc.cc:405 ../src/qalc.cc:1287 ../src/qalc.cc:1693 msgid "sync units" msgstr "synchroniser les unités" #: ../src/qalc.cc:406 ../src/qalc.cc:1277 ../src/qalc.cc:1683 msgid "round to even" msgstr "arrondir au nombre inférieur" #. qalc command #: ../src/qalc.cc:407 ../src/qalc.cc:1067 ../src/qalc.cc:1278 #: ../src/qalc.cc:1316 ../src/qalc.cc:1684 ../src/qalc.cc:1728 msgid "rpn" msgstr "npi" #: ../src/qalc.cc:408 ../src/qalc.cc:1279 ../src/qalc.cc:1685 msgid "rpn syntax" msgstr "syntaxe npi" #: ../src/qalc.cc:409 ../src/qalc.cc:1284 ../src/qalc.cc:1690 msgid "short multiplication" msgstr "multiplication courte" #: ../src/qalc.cc:410 ../src/qalc.cc:1244 ../src/qalc.cc:1674 msgid "lowercase e" msgstr "e minuscule" #: ../src/qalc.cc:411 ../src/qalc.cc:1245 ../src/qalc.cc:1675 msgid "lowercase numbers" msgstr "nombres en minuscules" #: ../src/qalc.cc:415 ../src/qalc.cc:1199 ../src/qalc.cc:1658 msgid "normal" msgstr "-" #: ../src/qalc.cc:416 ../src/qalc.cc:1200 ../src/qalc.cc:1658 msgid "alternative" msgstr "-" #: ../src/qalc.cc:421 ../src/qalc.cc:450 ../src/qalc.cc:464 ../src/qalc.cc:478 #: ../src/qalc.cc:492 ../src/qalc.cc:506 ../src/qalc.cc:520 ../src/qalc.cc:567 #: ../src/qalc.cc:576 ../src/qalc.cc:616 ../src/qalc.cc:630 msgid "Illegal value." msgstr "Valeur illégale." #: ../src/qalc.cc:426 ../src/qalc.cc:1286 ../src/qalc.cc:1692 msgid "spell out logical" msgstr "déchiffrement logique" #: ../src/qalc.cc:427 ../src/qalc.cc:1214 ../src/qalc.cc:1664 msgid "dot as separator" msgstr "point comme séparateur" #: ../src/qalc.cc:428 ../src/qalc.cc:1243 ../src/qalc.cc:1673 msgid "limit implicit multiplication" msgstr "limiter les multiplications implicites" #: ../src/qalc.cc:430 ../src/qalc.cc:1285 ../src/qalc.cc:1691 msgid "spacious" msgstr "spacieux" #: ../src/qalc.cc:431 ../src/qalc.cc:1288 ../src/qalc.cc:1694 msgid "unicode" msgstr "-" #: ../src/qalc.cc:434 ../src/qalc.cc:1289 ../src/qalc.cc:1695 msgid "units" msgstr "unités" #: ../src/qalc.cc:435 ../src/qalc.cc:1290 ../src/qalc.cc:1696 msgid "unknowns" msgstr "inconnues" #: ../src/qalc.cc:436 ../src/qalc.cc:1291 ../src/qalc.cc:1697 msgid "variables" msgstr "-" #: ../src/qalc.cc:437 ../src/qalc.cc:1134 ../src/qalc.cc:1648 msgid "abbreviations" msgstr "abréviations" #: ../src/qalc.cc:438 ../src/qalc.cc:1282 ../src/qalc.cc:1688 msgid "show ending zeroes" msgstr "afficher les zéros de fin" #: ../src/qalc.cc:439 ../src/qalc.cc:1241 ../src/qalc.cc:1672 msgid "indicate infinite series" msgstr "indiquer les séries infinies" #: ../src/qalc.cc:440 ../src/qalc.cc:1143 ../src/qalc.cc:1651 msgid "angle unit" msgstr "unité d'angle" #: ../src/qalc.cc:442 ../src/qalc.cc:1145 ../src/qalc.cc:1146 msgid "rad" msgstr "-" #: ../src/qalc.cc:442 ../src/qalc.cc:1651 msgid "radians" msgstr "-" #: ../src/qalc.cc:443 msgid "deg" msgstr "-" #: ../src/qalc.cc:443 ../src/qalc.cc:1651 msgid "degrees" msgstr "degrés" #: ../src/qalc.cc:444 ../src/qalc.cc:1147 msgid "gra" msgstr "gr" #: ../src/qalc.cc:444 ../src/qalc.cc:1651 msgid "gradians" msgstr "grades" #: ../src/qalc.cc:455 ../src/qalc.cc:1260 ../src/qalc.cc:1678 msgid "multiplication sign" msgstr "signe de multiplication" #: ../src/qalc.cc:469 ../src/qalc.cc:1207 ../src/qalc.cc:1663 msgid "division sign" msgstr "signe de division" #: ../src/qalc.cc:483 ../src/qalc.cc:1151 ../src/qalc.cc:1652 msgid "approximation" msgstr "approximation" #. qalc command #: ../src/qalc.cc:485 ../src/qalc.cc:526 ../src/qalc.cc:609 #: ../src/qalc.cc:1097 ../src/qalc.cc:1153 ../src/qalc.cc:1229 #: ../src/qalc.cc:1307 ../src/qalc.cc:1652 ../src/qalc.cc:1665 #: ../src/qalc.cc:1668 ../src/qalc.cc:1744 msgid "exact" msgstr "-" #: ../src/qalc.cc:486 ../src/qalc.cc:1154 ../src/qalc.cc:1652 msgid "try exact" msgstr "essayer le calcul exact" #. qalc command #: ../src/qalc.cc:487 ../src/qalc.cc:1103 ../src/qalc.cc:1155 #: ../src/qalc.cc:1302 ../src/qalc.cc:1516 ../src/qalc.cc:1526 #: ../src/qalc.cc:1614 ../src/qalc.cc:1652 ../src/qalc.cc:1748 msgid "approximate" msgstr "approximer" #: ../src/qalc.cc:497 ../src/qalc.cc:1181 ../src/qalc.cc:1656 msgid "autoconversion" msgstr "-" #: ../src/qalc.cc:500 ../src/qalc.cc:1112 ../src/qalc.cc:1184 #: ../src/qalc.cc:1656 msgid "best" msgstr "meilleur" #: ../src/qalc.cc:511 ../src/qalc.cc:1135 ../src/qalc.cc:1649 msgid "algebra mode" msgstr "mode algébrique" #. qalc command #: ../src/qalc.cc:514 ../src/qalc.cc:1126 ../src/qalc.cc:1138 #: ../src/qalc.cc:1319 ../src/qalc.cc:1635 ../src/qalc.cc:1649 msgid "simplify" msgstr "simplifier" #: ../src/qalc.cc:515 ../src/qalc.cc:1139 ../src/qalc.cc:1649 msgid "factorize" msgstr "factoriser" #: ../src/qalc.cc:537 ../src/qalc.cc:1281 ../src/qalc.cc:1687 msgid "save mode" msgstr "enregistrer le mode" #: ../src/qalc.cc:546 ../src/qalc.cc:1280 ../src/qalc.cc:1686 msgid "save definitions" msgstr "enregistrer les définitions" #: ../src/qalc.cc:555 ../src/qalc.cc:1216 ../src/qalc.cc:1667 msgid "exp mode" msgstr "mode exp" #: ../src/qalc.cc:558 ../src/qalc.cc:1219 ../src/qalc.cc:1667 msgid "auto" msgstr "-" #: ../src/qalc.cc:559 ../src/qalc.cc:1220 ../src/qalc.cc:1667 msgid "pure" msgstr "pur" #: ../src/qalc.cc:560 ../src/qalc.cc:1221 ../src/qalc.cc:1667 msgid "scientific" msgstr "scientifique" #: ../src/qalc.cc:561 ../src/qalc.cc:1222 ../src/qalc.cc:1667 msgid "engineering" msgstr "" #: ../src/qalc.cc:572 ../src/qalc.cc:1268 ../src/qalc.cc:1680 msgid "precision" msgstr "précision" #: ../src/qalc.cc:581 ../src/qalc.cc:1246 ../src/qalc.cc:1676 msgid "max decimals" msgstr "décimales max" #: ../src/qalc.cc:593 ../src/qalc.cc:1253 ../src/qalc.cc:1677 msgid "min decimals" msgstr "décimales min" #: ../src/qalc.cc:606 ../src/qalc.cc:1226 ../src/qalc.cc:1668 msgid "fractions" msgstr "-" #: ../src/qalc.cc:611 ../src/qalc.cc:1231 ../src/qalc.cc:1668 msgid "combined" msgstr "combiné" #: ../src/qalc.cc:621 ../src/qalc.cc:1270 ../src/qalc.cc:1682 msgid "read precision" msgstr "précision de saisie" #: ../src/qalc.cc:624 ../src/qalc.cc:1273 ../src/qalc.cc:1682 msgid "always" msgstr "toujours" #: ../src/qalc.cc:625 ../src/qalc.cc:1274 ../src/qalc.cc:1682 msgid "when decimals" msgstr "si décimales" #: ../src/qalc.cc:649 msgid "Unrecognized option." msgstr "Option inconnue" #: ../src/qalc.cc:670 msgid "usage: qalc [options] [expression]" msgstr "-" #: ../src/qalc.cc:672 msgid "where options are:" msgstr "où les options sont :" #: ../src/qalc.cc:674 msgid "turn on/off unicode support" msgstr "activer/désactiver le support de l'unicode" #: ../src/qalc.cc:675 ../src/qalc.cc:1318 msgid "OPTION" msgstr "-" #: ../src/qalc.cc:675 ../src/qalc.cc:1318 msgid "VALUE" msgstr "VALEUR" #: ../src/qalc.cc:676 msgid "as set command in interactive program session (ex. -set \"base 16\")" msgstr "" "comme une commande set (définition) dans une session de programme " "interactive (ex. -set \"base 16\")" #: ../src/qalc.cc:677 msgid "FILE" msgstr "FICHIER" #: ../src/qalc.cc:678 msgid "executes commands from a file first" msgstr "commencer par exécuter les commandes dans un fichier" #: ../src/qalc.cc:680 msgid "reduces output to just the result of the input expression" msgstr "" #: ../src/qalc.cc:682 #, fuzzy msgid "do not load any functions, units, or variables from file" msgstr "une fonction, une unité ou un nom de variable valide" #: ../src/qalc.cc:684 msgid "do not load any global currencies from file" msgstr "" #: ../src/qalc.cc:686 msgid "do not load any global data sets from file" msgstr "" #: ../src/qalc.cc:688 #, fuzzy msgid "do not load any global functions from file" msgstr "Échec du chargement des définitions globales!" #: ../src/qalc.cc:690 msgid "do not load any global units from file" msgstr "" #: ../src/qalc.cc:692 msgid "do not load any global variables from file" msgstr "" #: ../src/qalc.cc:694 msgid "" "The program will start in interactive mode if no expression is specified." msgstr "" "Le programme démarrera en mode interactif si aucune expression n'est " "indiquée." #: ../src/qalc.cc:720 msgid "No option and value specified for set command." msgstr "Pas de fonction et valeur spécifiée pour une commande set." #: ../src/qalc.cc:728 msgid "No file specified." msgstr "Aucun fichier indiqué." #: ../src/qalc.cc:780 msgid "" "You need the download exchange rates to be able to convert between different " "currencies.\n" "You can later get current exchange rates with the \"exchange rates\" " "command.\n" "Do you want to fetch exchange rates now from the Internet (default yes)?" msgstr "" "Vous devez télécharger les taux d'échange pour pouvoir effectuer des " "conversions entre les différentes devises.\n" "Vous pouvez par la suite obtenir les taux d'échange actuels avec la commande " "\"taux d'échange\"\n" "Voulez-vous récupérer les taux d'échange sur Internet (défaut : oui) ?" #: ../src/qalc.cc:789 msgid "ans" msgstr "-" #: ../src/qalc.cc:790 ../src/qalc.cc:793 ../src/qalc.cc:794 ../src/qalc.cc:795 #: ../src/qalc.cc:796 ../src/qalc.cc:1006 ../libqalculate/Calculator.cc:7054 msgid "Temporary" msgstr "Temporaire" #: ../src/qalc.cc:790 msgid "Last Answer" msgstr "Dernière réponse" #: ../src/qalc.cc:791 msgid "answer" msgstr "réponse" #: ../src/qalc.cc:793 msgid "Answer 2" msgstr "Réponse 2" #: ../src/qalc.cc:794 msgid "Answer 3" msgstr "Réponse 3" #: ../src/qalc.cc:795 msgid "Answer 4" msgstr "Réponse 4" #: ../src/qalc.cc:796 msgid "Answer 5" msgstr "Réponse 5" #: ../src/qalc.cc:807 msgid "Failed to load global definitions!" msgstr "Échec du chargement des définitions globales!" #: ../src/qalc.cc:840 #, c-format msgid "Could not open \"%s\".\n" msgstr "Impossible d'ouvrir \"%s\".\n" #: ../src/qalc.cc:859 ../src/qalc.cc:905 ../src/qalc.cc:1783 #, c-format msgid "Illegal character, '%c', in expression." msgstr "Caractère illégal, '%c', dans l'expression" #. The qalc command "set" as in "set precision 10". The original text string for commands is kept in addition to the translation. #: ../src/qalc.cc:968 ../src/qalc.cc:1318 ../src/qalc.cc:1639 msgid "set" msgstr "définir" #. qalc command #: ../src/qalc.cc:972 ../src/qalc.cc:1317 ../src/qalc.cc:1707 msgid "save" msgstr "enregistrer" #: ../src/qalc.cc:972 ../src/qalc.cc:1317 ../src/qalc.cc:1707 msgid "store" msgstr "stocker" #. qalc command #: ../src/qalc.cc:975 ../src/qalc.cc:1129 ../src/qalc.cc:1315 #: ../src/qalc.cc:1714 msgid "mode" msgstr "-" #: ../src/qalc.cc:977 msgid "mode saved" msgstr "mode enregistré" #: ../src/qalc.cc:979 msgid "definitions" msgstr "définitions" #: ../src/qalc.cc:981 msgid "definitions saved" msgstr "définitions enregistrées" #: ../src/qalc.cc:1028 ../src/qalc.cc:1030 #, c-format msgid "Illegal name. Save as %s instead?" msgstr "Nom illégal. Enregistrer comme %s à la place ?" #: ../src/qalc.cc:1037 msgid "" "An unit or variable with the same name already exists.\n" "Do you want to overwrite it?" msgstr "" "Une unité ou une variable du même nom existe déjà.\n" "Voulez-vous l'écraser?" #. qalc command #: ../src/qalc.cc:1060 ../src/qalc.cc:1303 ../src/qalc.cc:1701 msgid "assume" msgstr "supposer" #. qalc command #: ../src/qalc.cc:1070 ../src/qalc.cc:1076 ../src/qalc.cc:1308 #: ../src/qalc.cc:1724 msgid "exrates" msgstr "taux d'échange" #. qalc command #: ../src/qalc.cc:1080 ../src/qalc.cc:1320 ../src/qalc.cc:1736 msgid "stack" msgstr "pile" #: ../src/qalc.cc:1082 msgid "The RPN stack is empty." msgstr "La pile NPI est vide." #. qalc command #: ../src/qalc.cc:1094 ../src/qalc.cc:1305 ../src/qalc.cc:1732 msgid "clear stack" msgstr "vider la pile" #. qalc command #: ../src/qalc.cc:1109 ../src/qalc.cc:1306 ../src/qalc.cc:1752 msgid "convert" msgstr "convertir" #: ../src/qalc.cc:1109 ../src/qalc.cc:1306 ../src/qalc.cc:1752 msgid "to" msgstr "vers" #. qalc command #: ../src/qalc.cc:1123 ../src/qalc.cc:1313 ../src/qalc.cc:1631 msgid "factor" msgstr "facteur" #: ../src/qalc.cc:1164 ../src/qalc.cc:1589 ../src/qalc.cc:1655 #: ../src/qalc.cc:1704 msgid "negative" msgstr "négatif" #. qalc command #: ../src/qalc.cc:1294 ../src/qalc.cc:1628 msgid "help" msgstr "aide" #: ../src/qalc.cc:1296 msgid "Enter a mathematical expression or a command." msgstr "Entrez une expression mathématique ou une commande." #: ../src/qalc.cc:1298 msgid "Complete functions, units and variables with the tabulator key." msgstr "Fonctions, unités et variables complètes avec la touche de tabulation." #: ../src/qalc.cc:1300 msgid "Available commands are:" msgstr "Les commandes disponibles sont :" #: ../src/qalc.cc:1303 msgid "ASSUMPTIONS" msgstr "HYPOTHÈSES" #: ../src/qalc.cc:1304 msgid "BASE" msgstr "-" #: ../src/qalc.cc:1306 msgid "UNIT" msgstr "UNITÉ" #: ../src/qalc.cc:1310 msgid "WGET ARGUMENTS" msgstr "ARGUMENTS DE WGET" #: ../src/qalc.cc:1314 ../src/qalc.cc:1326 ../src/qalc.cc:1718 #: ../libqalculate/Calculator.cc:7680 ../libqalculate/DataSet.cc:354 #: ../libqalculate/DataSet.cc:381 ../libqalculate/DataSet.cc:992 msgid "info" msgstr "-" #: ../src/qalc.cc:1316 msgid "ON/OFF" msgstr "MARCHE/ARRÊT" #: ../src/qalc.cc:1317 msgid "NAME" msgstr "NOM" #: ../src/qalc.cc:1317 msgid "CATEGORY" msgstr "CATÉGORIE" #: ../src/qalc.cc:1317 msgid "TITLE" msgstr "TITRE" #. qalc command #: ../src/qalc.cc:1321 ../src/qalc.cc:1765 ../src/qalc.cc:1773 msgid "quit" msgstr "quitter" #: ../src/qalc.cc:1321 ../src/qalc.cc:1765 ../src/qalc.cc:1773 msgid "exit" msgstr "sortir" #: ../src/qalc.cc:1323 msgid "Type help COMMAND for more help (example: help save)." msgstr "Tapez help COMMANDE pour plus d'aide (exemple : help save)." #: ../src/qalc.cc:1324 msgid "" "Type info NAME for info about a function, variable or unit (example: info " "sin)." msgstr "" "Tapez info NOM pour obtenir de l'information sur une fonction, variable ou " "unité (exemple : info sin)." #: ../src/qalc.cc:1334 msgid "No function, variable or unit with specified name exist." msgstr "Aucune fonction, variable ou unité avec le nom indiqué n'existe." #: ../src/qalc.cc:1344 msgid "Function" msgstr "Fonction" #: ../src/qalc.cc:1371 ../libqalculate/Function.cc:149 msgid "argument" msgstr "-" #: ../src/qalc.cc:1395 #, c-format msgid "" "Retrieves data from the %s data set for a given object and property. If " "\"info\" is typed as property, all properties of the object will be listed." msgstr "" "Récupère les informations de l'ensemble de données %s pour un objet et une " "propriété donnés. Si \"info\" est tapé pour la propriété, toutes les " "propriétés de l'objet seront listées." #: ../src/qalc.cc:1408 msgid "Arguments" msgstr "-" #. optional argument, in description #: ../src/qalc.cc:1425 msgid "optional" msgstr "optionnel" #. argument default, in description #: ../src/qalc.cc:1429 msgid "default: " msgstr "défaut :" #: ../src/qalc.cc:1440 msgid "Requirement" msgstr "Exigences" #: ../src/qalc.cc:1448 msgid "Properties" msgstr "Propiétés" #: ../src/qalc.cc:1463 msgid "key" msgstr "touche" #: ../src/qalc.cc:1481 ../src/qalc.cc:1484 msgid "Unit" msgstr "Unité" #: ../src/qalc.cc:1487 ../src/qalc.cc:1555 msgid "Names" msgstr "Noms" #: ../src/qalc.cc:1505 msgid "Base Unit" msgstr "Unité de base" #: ../src/qalc.cc:1512 msgid "Relation" msgstr "-" #: ../src/qalc.cc:1522 msgid "Inverse Relation" msgstr "Relation Inverse" #: ../src/qalc.cc:1534 msgid "Base Units" msgstr "Unités de base" #: ../src/qalc.cc:1549 ../src/qalc.cc:1552 msgid "Variable" msgstr "-" #: ../src/qalc.cc:1567 msgid "a previous result" msgstr "un résultat précédent" #: ../src/qalc.cc:1577 ../libqalculate/Function.cc:1823 msgid "matrix" msgstr "matrice" #: ../src/qalc.cc:1579 ../libqalculate/Function.cc:1762 msgid "vector" msgstr "vecteur" #: ../src/qalc.cc:1606 msgid "default assumptions" msgstr "hypothèses par défaut" #: ../src/qalc.cc:1610 msgid "Value" msgstr "Valeur" #: ../src/qalc.cc:1633 msgid "Factorizes the current result." msgstr "Factorise le résultat courant." #: ../src/qalc.cc:1637 msgid "Simplifies the current result." msgstr "Simplifie le résultat courant." #: ../src/qalc.cc:1644 msgid "Sets the value of an option." msgstr "Définit la valeur d'une option." #: ../src/qalc.cc:1646 msgid "Available options and accepted values are:" msgstr "Les options disponibles et les valeurs acceptées sont :" #: ../src/qalc.cc:1699 msgid "Example: set base 16." msgstr "Exemple : set base 16." #: ../src/qalc.cc:1703 msgid "Set default assumptions for unknown variables." msgstr "Définit les hypothèses par défaut pour les variables inconnues." #: ../src/qalc.cc:1709 msgid "" "Saves the current result in a variable with the specified name. You may " "optionally also provide a category (default \"Temporary\") and a title." msgstr "" "Enregistre le résultat courant dans une variable avec le nom indiqué. Vous " "pouvez éventuellement préciser aussi une catégorie (défaut \"Temporaire\") " "et un titre." #: ../src/qalc.cc:1710 msgid "" "If name equals \"mode\" or \"definitions\", the current mode and " "definitions, respectively, will be saved." msgstr "" "Si le nom est \"mode\" ou \"définitions\", le mode ou la définition " "courants, respectivement, seront enregistrés." #: ../src/qalc.cc:1712 msgid "Example: store var1." msgstr "Exemple : store var1" #: ../src/qalc.cc:1716 msgid "Displays the current mode." msgstr "Affiche le mode courant." #: ../src/qalc.cc:1720 msgid "Displays information about a function, variable or unit." msgstr "Affiche l'information sur une fonction, une variable ou une unité." #: ../src/qalc.cc:1722 msgid "Example: info sin." msgstr "Exemple : info sin" #: ../src/qalc.cc:1726 msgid "Downloads current exchange rates from the Internet." msgstr "Télécharge les taux d'échange courants sur Internet." #: ../src/qalc.cc:1730 msgid "(De)activates the Reverse Polish Notation mode." msgstr "(Dés)active le mode Notation Polonaise Inversée." #: ../src/qalc.cc:1734 msgid "Clears the RPN stack." msgstr "Vide la pile NPI." #: ../src/qalc.cc:1738 msgid "Displays the RPN stack." msgstr "Affiche la pile NPI." #: ../src/qalc.cc:1742 msgid "Sets the result base (equivalent to set base)." msgstr "" #: ../src/qalc.cc:1746 msgid "Equivalent to set approximation exact." msgstr "" #: ../src/qalc.cc:1750 msgid "Equivalent to set approximation try exact." msgstr "" #: ../src/qalc.cc:1754 msgid "Converts units in current result." msgstr "Convertit les unités dans le résultat courant." #: ../src/qalc.cc:1756 msgid "Possible unit values are:" msgstr "Les valeurs d'unité possibles sont :" #: ../src/qalc.cc:1758 msgid "a unit (example meter)" msgstr "une unité (exemple : mètre)" #: ../src/qalc.cc:1759 msgid "a unit expression (example km/h)" msgstr "une expression d'unités (exemple : km/h)" #: ../src/qalc.cc:1760 msgid "base (convert to base units)" msgstr "base (convertit en unités de base)" #: ../src/qalc.cc:1761 msgid "best (convert best unit)" msgstr "meilleur (convertit dans la meilleure unité)" #: ../src/qalc.cc:1763 msgid "Example: convert best." msgstr "Exemple : convert best" #: ../src/qalc.cc:1767 msgid "Terminates this program." msgstr "Termine ce programme." #: ../src/qalc.cc:1818 msgid "error" msgstr "erreur" #: ../src/qalc.cc:1820 msgid "warning" msgstr "avertissement" #: ../src/qalc.cc:1879 ../libqalculate/Calculator.cc:182 #: ../libqalculate/Calculator.cc:183 ../libqalculate/Calculator.cc:188 #: ../libqalculate/Calculator.cc:2146 msgid "aborted" msgstr "interrompu" #: ../src/qalc.cc:1908 msgid "RPN Register Moved" msgstr "Registre NPI déplacé" #: ../src/qalc.cc:1947 msgid "Processing (press Enter to abort)" msgstr "Calcul en cours (appuyez sur Entrée pour interrompre)" #: ../src/qalc.cc:2010 msgid "approx." msgstr "-" #: ../src/qalc.cc:2116 msgid "Factorizing (press Enter to abort)" msgstr "Factorisation en cours (appuyez sur Entrée pour interrompre)" #: ../src/qalc.cc:2120 msgid "Simplifying (press Enter to abort)" msgstr "Simplification en cours (appuyez sur Entrée pour interrompre)" #: ../src/qalc.cc:2315 msgid "Calculating (press Enter to abort)" msgstr "Calcul en cours (appuyez sur Entrée pour interrompre)" #: ../src/qalc.cc:2371 msgid "RPN Operation" msgstr "Opération NPI" #: ../src/qalc.cc:2669 #, c-format msgid "" "Couldn't write preferences to\n" "%s" msgstr "" "Impossible d'écrire les préférences pour\n" " %s" #: ../src/qalc.cc:2743 msgid "Couldn't write definitions" msgstr "Impossible d'écrire les définitions" #: ../libqalculate/BuiltinFunctions.cc:58 #, c-format msgid "Too many elements (%s) for the dimensions (%sx%s) of the matrix." msgstr "Trop d'éléments (%s) pour les dimensions (%sx%s) de la matrice." #: ../libqalculate/BuiltinFunctions.cc:120 #: ../libqalculate/BuiltinFunctions.cc:180 #, c-format msgid "Row %s does not exist in matrix." msgstr "La ligne %s n'existe pas dans la matrice." #: ../libqalculate/BuiltinFunctions.cc:133 #: ../libqalculate/BuiltinFunctions.cc:176 #, c-format msgid "Column %s does not exist in matrix." msgstr "La colonne %s n'existe pas dans la matrice." #: ../libqalculate/BuiltinFunctions.cc:191 #, c-format msgid "Argument 3, %s, is ignored for vectors." msgstr "Le troisième argument, %s, est ignoré pour les vecteurs." #: ../libqalculate/BuiltinFunctions.cc:195 #: ../libqalculate/BuiltinFunctions.cc:216 #, c-format msgid "Element %s does not exist in vector." msgstr "L'élément %s n'existe pas dans le vecteur." #: ../libqalculate/BuiltinFunctions.cc:404 #, c-format msgid "%s() does at the moment only support integers and fractions of two." msgstr "" "%s ne supporte pour le moment que les entiers et les fractions de deux " "entiers." #: ../libqalculate/BuiltinFunctions.cc:1242 #, c-format msgid "Argument for %s() must be a real number greater than or equal to -1/e." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:2112 #: ../libqalculate/BuiltinFunctions.cc:2155 #, c-format msgid "Unsolvable comparison in %s()." msgstr "Comparaison impossible à résoudre dans %s()." #: ../libqalculate/BuiltinFunctions.cc:2246 #: ../libqalculate/BuiltinFunctions.cc:2266 #: ../libqalculate/BuiltinFunctions.cc:2290 ../libqalculate/util.cc:164 #: ../libqalculate/util.cc:211 ../libqalculate/util.cc:231 #: ../libqalculate/util.cc:251 msgid "today" msgstr "aujourd'hui" #: ../libqalculate/BuiltinFunctions.cc:2285 ../libqalculate/util.cc:167 #: ../libqalculate/util.cc:214 ../libqalculate/util.cc:234 #: ../libqalculate/util.cc:254 msgid "now" msgstr "maintenant" #: ../libqalculate/BuiltinFunctions.cc:2301 #, c-format msgid "The timestamp value for the date %s is too large or small for %s()." msgstr "" "La valeur du timestamp pour la date %s est trop grande ou trop petite pour %s" "()." #: ../libqalculate/BuiltinFunctions.cc:2336 #: ../libqalculate/BuiltinFunctions.cc:2349 #: ../libqalculate/BuiltinFunctions.cc:2362 #: ../libqalculate/BuiltinFunctions.cc:2384 #: ../libqalculate/BuiltinFunctions.cc:2405 #, c-format msgid "Error in date format for function %s()." msgstr "Erreur dans le format de date pour la fonction %s()." #: ../libqalculate/BuiltinFunctions.cc:2659 msgid "" "The number of requested elements in generate vector function must be a " "positive integer." msgstr "" "Le nombre d'éléments requis pour générer une fonction vectorielle doit être " "un entier positif." #: ../libqalculate/BuiltinFunctions.cc:2953 #: ../libqalculate/BuiltinFunctions.cc:2970 msgid "Comparison failed." msgstr "La comparaison a échoué." #: ../libqalculate/BuiltinFunctions.cc:2958 #: ../libqalculate/BuiltinFunctions.cc:2988 msgid "No matching item found." msgstr "Aucun élément correspondant trouvé." #: ../libqalculate/BuiltinFunctions.cc:3070 #, c-format msgid "Object %s does not exist." msgstr "L'objet %s n'existe pas." #: ../libqalculate/BuiltinFunctions.cc:3097 #, c-format msgid "Register %s does not exist. Returning zero." msgstr "Le registre %s n'existe pas. Valeur renvoyée : zéro." #: ../libqalculate/BuiltinFunctions.cc:3155 msgid "" "Both the lower and upper limit must be set to get the definite integral." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:3290 msgid "" "No equality or inequality to solve. The entered expression to solve is not " "correct (ex. \"x + 5 = 3\" is correct)" msgstr "" "Pas d'égalité ou d'inégalité à résoudre. L'expression à résoudre que vous " "avez entrée est incorrecte (ex : \"x + 5 = 3\" est correcte)" #: ../libqalculate/BuiltinFunctions.cc:3337 #, c-format msgid "The comparison is true for all %s (with current assumptions)." msgstr "" "La comparaison est vraie pour tous les %s (avec les hypothèses courantes)." #: ../libqalculate/BuiltinFunctions.cc:3341 msgid "No possible solution was found (with current assumptions)." msgstr "" "Aucune solution possible n'a été trouvée (avec les hypothèses courantes)." #: ../libqalculate/BuiltinFunctions.cc:3345 #, c-format msgid "Was unable to completely isolate %s." msgstr "Impossible d'isoler complètement %s." #: ../libqalculate/BuiltinFunctions.cc:3349 #: ../libqalculate/BuiltinFunctions.cc:3477 #: ../libqalculate/BuiltinFunctions.cc:3572 #, c-format msgid "The comparison is true for all %s if %s." msgstr "La comparaison est vraie pour tous les %s si %s." #: ../libqalculate/BuiltinFunctions.cc:3353 #, c-format msgid "Was unable to isolate %s." msgstr "Impossible d'isoler %s." #: ../libqalculate/BuiltinFunctions.cc:3436 #: ../libqalculate/BuiltinFunctions.cc:3463 #: ../libqalculate/BuiltinFunctions.cc:3546 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed sign was " "therefor temporarily set as unknown." msgstr "" "Impossible d'isoler %s avec les hypothèses courantes. Le signe supposé a été " "temporairement défini comme inconnu." #: ../libqalculate/BuiltinFunctions.cc:3439 #: ../libqalculate/BuiltinFunctions.cc:3466 #: ../libqalculate/BuiltinFunctions.cc:3549 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed type and " "sign was therefor temporarily set as unknown." msgstr "" "Impossible d'isoler %s avec les hypothèses courantes. Le type et le signe " "supposés ont été temporairement définis comme inconnus." #: ../libqalculate/BuiltinFunctions.cc:3472 #: ../libqalculate/BuiltinFunctions.cc:3557 #, c-format msgid "The solution requires that %s." msgstr "La solution exige que %s." #: ../libqalculate/BuiltinFunctions.cc:3565 #, c-format msgid "Solution %s requires that %s." msgstr "La solution %s exige que %s." #: ../libqalculate/BuiltinFunctions.cc:3633 #, c-format msgid "" "Unable to isolate %s.\n" "\n" "You might need to place the equations and variables in an appropriate order " "so that so that each equation at least contains the corresponding variable " "(if automatic reordering failed)." msgstr "" "Impossible d'isoler %s.\n" "\n" "Vous pourriez placer les équations et les variables dans un ordre approprié " "pour que chaque équation contienne au moins la variable correspondante (si " "le réordonnement automatique a échoué)." #: ../libqalculate/BuiltinFunctions.cc:3635 #: ../libqalculate/BuiltinFunctions.cc:3649 #: ../libqalculate/BuiltinFunctions.cc:3658 #, c-format msgid "Unable to isolate %s." msgstr "Impossible d'isoler %s." #: ../libqalculate/BuiltinFunctions.cc:3642 #, c-format msgid "Inequalities is not allowed in %s()." msgstr "Les inégalités ne sont pas autorisées dans %s." #: ../libqalculate/Calculator.cc:277 msgid "per" msgstr "par" #: ../libqalculate/Calculator.cc:279 msgid "times" msgstr "fois" #: ../libqalculate/Calculator.cc:281 msgid "plus" msgstr "-" #: ../libqalculate/Calculator.cc:283 msgid "minus" msgstr "moins" #: ../libqalculate/Calculator.cc:285 ../libqalculate/MathStructure.cc:11274 #: ../libqalculate/Function.cc:1106 ../libqalculate/Function.cc:1114 #: ../libqalculate/Function.cc:1523 ../libqalculate/Function.cc:1667 msgid "and" msgstr "et" #: ../libqalculate/Calculator.cc:289 ../libqalculate/DataSet.cc:1026 #: ../libqalculate/DataSet.cc:1089 ../libqalculate/MathStructure.cc:11288 #: ../libqalculate/Function.cc:1977 ../libqalculate/Function.cc:1993 msgid "or" msgstr "ou" #: ../libqalculate/Calculator.cc:319 ../libqalculate/Calculator.cc:1038 #: ../libqalculate/Calculator.cc:2154 ../libqalculate/Calculator.cc:2155 msgid " to " msgstr " à " #: ../libqalculate/Calculator.cc:391 msgid "Gradians unit is missing. Creating one for this session." msgstr "L'unité grade manque. Création pour cette session." #: ../libqalculate/Calculator.cc:392 ../libqalculate/Calculator.cc:400 #: ../libqalculate/Calculator.cc:408 msgid "Angle/Plane Angle" msgstr "Angle Plan/Solide" #: ../libqalculate/Calculator.cc:399 msgid "Radians unit is missing. Creating one for this session." msgstr "L'unité radian manque. Création pour cette session." #: ../libqalculate/Calculator.cc:407 msgid "Degrees unit is missing. Creating one for this session." msgstr "L'unité degré manque. Création pour cette session." #: ../libqalculate/Calculator.cc:1377 ../libqalculate/Calculator.cc:8061 msgid "Currency" msgstr "Devise" #: ../libqalculate/Calculator.cc:2117 msgid "calculating..." msgstr "calculs en cours..." #: ../libqalculate/Calculator.cc:2243 msgid "timed out" msgstr "délai expiré" #: ../libqalculate/Calculator.cc:3144 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name of \"%s\", or " "the variable will be lost." msgstr "" "\"%s\" n'est plus autorisé dans les noms. Changez s'il vous plaît le nom de " "\"%s\", ou la variable sera perdue." #: ../libqalculate/Calculator.cc:3161 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the function will be lost." msgstr "" "\"%s\" n'est plus autorisé dans les noms. Changez s'il vous plaît le nom \"%s" "\", ou la fonction sera perdue." #: ../libqalculate/Calculator.cc:3177 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the unit will be lost." msgstr "" "\"%s\" n'est plus autorisé dans les noms. Changez s'il vous plaît le nom \"%s" "\", ou l'unité sera perdue." #: ../libqalculate/Calculator.cc:4156 ../libqalculate/Calculator.cc:4802 #: ../libqalculate/Calculator.cc:4814 ../libqalculate/Calculator.cc:4839 #: ../libqalculate/Calculator.cc:4865 #, c-format msgid "Misplaced operator(s) \"%s\" ignored" msgstr "Opérateur(s) mal placé(s), \"%s\" ignoré" #: ../libqalculate/Calculator.cc:4180 ../libqalculate/Calculator.cc:4889 #, c-format msgid "Misplaced '%c' ignored" msgstr "L'élément mal placé '%c' ignoré" #: ../libqalculate/Calculator.cc:4207 ../libqalculate/Function.cc:1253 #: ../libqalculate/Function.cc:1284 #, c-format msgid "Internal id %s does not exist." msgstr "L'identificateur interne %s n'existe pas." #: ../libqalculate/Calculator.cc:4225 #, c-format msgid "\"%s\" is not a valid variable/function/unit." msgstr "\"%s\" n'est pas une variable/fonction/unité valide." #: ../libqalculate/Calculator.cc:4240 #, c-format msgid "" "Trailing characters \"%s\" (not a valid variable/function/unit) in number \"%" "s\" was ignored." msgstr "" "Les caractères de fin \"%s\" (variable/fonction/unité non valide) dans le " "nombre \"%s\" ont été ignorés." #: ../libqalculate/Calculator.cc:4630 msgid "RPN syntax error. Values left at the end of the RPN expression." msgstr "" "Erreur de syntaxe NPI. Des valeurs subsistent à la fin de l'expression NPI." #: ../libqalculate/Calculator.cc:4633 msgid "Unused stack values." msgstr "Valeurs de pile inutilisées." #: ../libqalculate/Calculator.cc:4695 msgid "RPN syntax error. Stack is empty." msgstr "Erreur de syntaxe NPI. La pile est vide." #: ../libqalculate/Calculator.cc:4697 msgid "RPN syntax error. Operator ignored as there where only one stack value." msgstr "" "Erreur de syntaxe NPI. L'opérateur a été ignoré comme si il n'y avait qu'une " "seule valeur de pile." #: ../libqalculate/Calculator.cc:5056 #, c-format msgid "Name \"%s\" is in use. Replacing with \"%s\"." msgstr "Le nom \"%s\" est utilisé. Remplacement par \"%s\"." #: ../libqalculate/Calculator.cc:5715 ../libqalculate/DataSet.cc:498 #, c-format msgid "File not identified as Qalculate! definitions file: %s." msgstr "Fichier non identifié comme fichier de définitions Qalculate! : %s." #: ../libqalculate/Calculator.cc:7663 ../libqalculate/DataSet.cc:352 msgid "Object" msgstr "Objet" #: ../libqalculate/Calculator.cc:7672 ../libqalculate/DataSet.cc:353 msgid "Property" msgstr "Propriété" #: ../libqalculate/Calculator.cc:7965 msgid "column" msgstr "colonne" #: ../libqalculate/Calculator.cc:7968 msgid "Column " msgstr "Colonne" #: ../libqalculate/Calculator.cc:8132 msgid "Failed to download exchange rates from ECB." msgstr "Échec du téléchargement des taux d'échange sur ECB." #: ../libqalculate/Calculator.cc:8150 msgid "" "It has been more than one week since the exchange rates last were updated." msgstr "La dernière mise à jour des taux d'échange date de plus d'une semaine." #: ../libqalculate/Calculator.cc:8187 ../libqalculate/Calculator.cc:8201 msgid "Unable to generate plot data with current min, max and sampling rate." msgstr "" "Impossible de générer des données graphiques avec les valeurs actuelles min, " "max et taux d'échantillonage." #: ../libqalculate/Calculator.cc:8217 ../libqalculate/Calculator.cc:8231 msgid "Unable to generate plot data with current min, max and step size." msgstr "" "Impossible de générer des données graphiques avec les valeurs actuelles min, " "max et pas." #: ../libqalculate/Calculator.cc:8280 msgid "No extension in file name. Saving as PNG image." msgstr "" "Pas d'extension dans le nom de fichier. Enregistrement comme image PNG." #: ../libqalculate/Calculator.cc:8297 msgid "Unknown extension in file name. Saving as PNG image." msgstr "" "Extension inconnu dans le nom de fichier. Enregistrement comme fichier PNG." #: ../libqalculate/Calculator.cc:8489 #, c-format msgid "Could not create temporary file %s" msgstr "Impossible de créer le fichier temporaire %s" #: ../libqalculate/Calculator.cc:8525 #, c-format msgid "" "Series %s contains non-numerical data (\"%s\" first of %s) which can not be " "properly plotted." msgstr "" "La suite %s contient des données non numériques (\"%s\" premier de %s) qui " "ne peut pas être correctement tracé." #: ../libqalculate/Calculator.cc:8527 #, c-format msgid "" "Series %s contains non-real data (\"%s\" first of %s) which can not be " "properly plotted." msgstr "" "La suite %s contient des données non réelles (\"%s\" premier de %s) qui ne " "peut pas être correctement tracé." #: ../libqalculate/Calculator.cc:8552 msgid "" "Failed to invoke gnuplot. Make sure that you have gnuplot installed in your " "path." msgstr "" "Impossible d'appeler gnuplot. Assurez vous que gnuplot est installé dans " "votre path." #: ../libqalculate/DataSet.cc:378 #, c-format msgid "Object %s not available in data set." msgstr "L'objet %s n'est pas disponible dans l'ensemble de données." #: ../libqalculate/DataSet.cc:388 #, c-format msgid "Property %s not available in data set." msgstr "La propriété %s n'est pas disponible dans l'ensemble de données." #: ../libqalculate/DataSet.cc:393 #, c-format msgid "Property %s not defined for object %s." msgstr "La propriété %s n'est pas définie pour l'objet %s." #: ../libqalculate/DataSet.cc:476 ../libqalculate/DataSet.cc:484 #, c-format msgid "Unable to load data objects in %s." msgstr "Impossible de charger les objets de données dans %s." #: ../libqalculate/DataSet.cc:996 msgid "data property" msgstr "propriété des données" #: ../libqalculate/DataSet.cc:998 msgid "name of a data property" msgstr "nom d'une propriété de données" #: ../libqalculate/DataSet.cc:1006 ../libqalculate/DataSet.cc:1022 msgid "no properties available" msgstr "aucune propriété n'est disponible" #: ../libqalculate/DataSet.cc:1056 #, c-format msgid "" "Data set \"%s\" has no object key that supports the provided argument type." msgstr "" "L'ensemble de données \"%s\" n'a pas de clé d'objet qui supporte le type " "d'argument entré." #: ../libqalculate/DataSet.cc:1061 msgid "data object" msgstr "objet de données" #: ../libqalculate/DataSet.cc:1063 msgid "an object from" msgstr "un objet de" #: ../libqalculate/DataSet.cc:1092 msgid "use" msgstr "utilisation" #: ../libqalculate/MathStructure.cc:92 ../libqalculate/MathStructure.cc:113 #: ../libqalculate/MathStructure.cc:143 #, c-format msgid "To avoid division by zero, the following must be true: %s." msgstr "Pour éviter la division par zéro, ce qui suit doit être vrai : %s" #: ../libqalculate/MathStructure.cc:2450 #, c-format msgid "" "The second matrix must have as many rows (was %s) as the first has columns " "(was %s) for matrix multiplication." msgstr "" "La seconde matrice doit avoir autant de lignes (valeur actuelle : %s) que la " "première a de colonnes (valeur actuelle : %s) pour la multiplication " "matricielle." #. for(size_t i = 0; i < mcopy.size(); i++) { #. std::cout << "MCOPY " << i << ": " << mcopy[i].print() << std::endl; #. for(size_t i2 = 0; i2 < mcopy[i].size(); i2++) { #. std::cout << "MCOPY " << i << "-" << i2 << ": " << mcopy[i][i2].print() << std::endl; #. } #. } #. for(size_t i = 0; i < mcopy2.size(); i++) { #. std::cout << "MCOPY2 " << i << ": " << mcopy2[i].print() << std::endl; #. for(size_t i2 = 0; i2 < mcopy2[i].size(); i2++) { #. std::cout << "MCOPY2 " << i << "-" << i2 << ": " << mcopy2[i][i2].print() << std::endl; #. } #. } #. std::cout << "WRONG! this: " << print() << " copy: " << mcopy.print() << " copy2: " << mcopy2.print() << std::endl; #: ../libqalculate/MathStructure.cc:4980 ../libqalculate/MathStructure.cc:5021 #: ../libqalculate/MathStructure.cc:5054 ../libqalculate/MathStructure.cc:5110 #: ../libqalculate/MathStructure.cc:5130 ../libqalculate/MathStructure.cc:5149 #: ../libqalculate/MathStructure.cc:5168 ../libqalculate/MathStructure.cc:5187 #: ../libqalculate/MathStructure.cc:5276 ../libqalculate/MathStructure.cc:8486 #: ../libqalculate/MathStructure.cc:8497 ../libqalculate/MathStructure.cc:8576 msgid "This is a bug. Please report it." msgstr "Ceci est un bogue. Merci de le reporter." #: ../libqalculate/MathStructure.cc:11368 msgid "undefined" msgstr "indéfini" #: ../libqalculate/MathStructure.cc:11407 #, c-format msgid "Unsolvable comparison at element %s when trying to rank vector." msgstr "" "Comparaison impossible à l'élément %s en essayant de classer le vecteur." #: ../libqalculate/MathStructure.cc:11455 #, c-format msgid "Unsolvable comparison at element %s when trying to sort vector." msgstr "Comparaison impossible à l'élément %s en essayant de trier le vecteur." #: ../libqalculate/MathStructure.cc:11880 msgid "The determinant can only be calculated for square matrices." msgstr "Le déterminant ne peut être calculé que pour les matrices carrées." #: ../libqalculate/MathStructure.cc:11943 msgid "The permanent can only be calculated for square matrices." msgstr "Le permanent ne peut être calculé que pour les matrice carrées." #: ../libqalculate/MathStructure.cc:12032 msgid "Inverse of singular matrix." msgstr "Inverse d'une matrice singulière." #: ../libqalculate/Function.cc:113 #, c-format msgid "%s() requires that %s" msgstr "%s() exige que %s" #: ../libqalculate/Function.cc:266 ../libqalculate/Function.cc:323 #: ../libqalculate/Function.cc:382 #, c-format msgid "" "Additional arguments for function %s() was ignored. Function can only use %s " "argument(s)." msgstr "" "Les arguments supplémentaires de la fonction %s() ont été ignorés. La " "fonction ne peut utiliser que %s argument(s)." #: ../libqalculate/Function.cc:403 #, c-format msgid "You need at least %s argument(s) (%s) in function %s()." msgstr "" "Vous devez utiliser au moins %s argument(s) (%s) dans la fonction %s()." #: ../libqalculate/Function.cc:405 #, c-format msgid "You need at least %s argument(s) in function %s()." msgstr "Vous devez utiliser au moins %s argument(s) dans la fonction %s()." #: ../libqalculate/Function.cc:1096 msgid "a free value" msgstr "une valeur libre" #: ../libqalculate/Function.cc:1101 msgid "that is nonzero" msgstr "ceci est non nul" #: ../libqalculate/Function.cc:1109 msgid "that is rational (polynomial)" msgstr "ceci est rationnel (polynomial)" #: ../libqalculate/Function.cc:1117 msgid "that fulfills the condition:" msgstr "ceci remplit la condition :" #: ../libqalculate/Function.cc:1120 #, fuzzy msgid "Argument" msgstr "-" #: ../libqalculate/Function.cc:1175 #, c-format msgid "Argument %s in %s() must be %s." msgstr "L'argument %s de %s() doit être %s." #: ../libqalculate/Function.cc:1177 #, c-format msgid "Argument %s, %s, in %s() must be %s." msgstr "L'argument %s, %s, de %s() doit être %s." #: ../libqalculate/Function.cc:1504 msgid "a rational number" msgstr "un nombre rationnel" #: ../libqalculate/Function.cc:1506 msgid "a number" msgstr "un nombre" #: ../libqalculate/Function.cc:1508 msgid "a real number" msgstr "un nombre réel" #: ../libqalculate/Function.cc:1513 ../libqalculate/Function.cc:1660 msgid ">=" msgstr "-" #: ../libqalculate/Function.cc:1515 msgid ">" msgstr "-" #: ../libqalculate/Function.cc:1527 ../libqalculate/Function.cc:1670 msgid "<=" msgstr "-" #: ../libqalculate/Function.cc:1529 msgid "<" msgstr "-" #: ../libqalculate/Function.cc:1657 msgid "an integer" msgstr "un entier" #: ../libqalculate/Function.cc:1688 msgid "symbol" msgstr "symbole" #: ../libqalculate/Function.cc:1689 msgid "an unknown variable/symbol" msgstr "une variable / un symbole inconnu" #: ../libqalculate/Function.cc:1702 msgid "text" msgstr "texte" #: ../libqalculate/Function.cc:1703 msgid "a text string" msgstr "une chaîne de caractères" #: ../libqalculate/Function.cc:1718 msgid "date" msgstr "-" #: ../libqalculate/Function.cc:1719 msgid "a date" msgstr "une date" #: ../libqalculate/Function.cc:1765 msgid "a vector with " msgstr "en vecteur avec" #: ../libqalculate/Function.cc:1777 msgid "a vector" msgstr "un vecteur" #: ../libqalculate/Function.cc:1826 msgid "a square matrix" msgstr "une matrice carrée" #: ../libqalculate/Function.cc:1828 msgid "a matrix" msgstr "une matrice" #: ../libqalculate/Function.cc:1843 msgid "object" msgstr "objet" #: ../libqalculate/Function.cc:1844 msgid "a valid function, unit or variable name" msgstr "une fonction, une unité ou un nom de variable valide" #: ../libqalculate/Function.cc:1857 msgid "function" msgstr "fonction" #: ../libqalculate/Function.cc:1858 msgid "a valid function name" msgstr "un nom de fonction valide" #: ../libqalculate/Function.cc:1871 msgid "unit" msgstr "unité" #: ../libqalculate/Function.cc:1872 msgid "a valid unit name" msgstr "un nom d'unité valide" #: ../libqalculate/Function.cc:1885 msgid "variable" msgstr "-" #: ../libqalculate/Function.cc:1886 msgid "a valid variable name" msgstr "un nom de variable valide" #: ../libqalculate/Function.cc:1899 msgid "file" msgstr "fichier" #: ../libqalculate/Function.cc:1900 msgid "a valid file name" msgstr "un nom de fichier valide" #: ../libqalculate/Function.cc:1913 msgid "boolean" msgstr "booléen" #: ../libqalculate/Function.cc:1914 msgid "a boolean (0 or 1)" msgstr "un booléen (0 ou 1)" #: ../libqalculate/Function.cc:1924 msgid "angle" msgstr "-" #: ../libqalculate/Function.cc:1925 msgid "an angle or a number (using the default angle unit)" msgstr "un angle ou un nombre (en utilisant l'unité d'angle par défaut)" #: ../libqalculate/Number.cc:127 msgid "" "Cannot display numbers greater than 9999 or less than -9999 as roman " "numerals." msgstr "" "Impossible 'afficher des nombres plus grands que 9999 ou plus petits que -" "9999 en chiffres romains." #: ../libqalculate/Number.cc:215 msgid "" "Assuming the unusual practice of letting a last capital I mean 2 in a roman " "numeral." msgstr "" "Hypothèse qu'on applique la pratique inhabituelle de laisser I comme " "capitale finale signifie 2 en chiffres romains." #: ../libqalculate/Number.cc:293 #, c-format msgid "Error in roman numerals: %s." msgstr "Erreur dans les chiffres romains : %s." #: ../libqalculate/Number.cc:328 #, c-format msgid "Unknown roman numeral: %c." msgstr "Chiffre romain inconnu : %c." #: ../libqalculate/Number.cc:386 #, c-format msgid "" "Errors in roman numerals: \"%s\". Interpreted as %s, which should be written " "as %s." msgstr "" "Erreurs dans les chiffres romains : \"%s\". Interprété comme %s, qui devrait " "être écrit %s." #: ../libqalculate/Number.cc:471 msgid "':' in decimal number ignored (decimal point detected)." msgstr "':' dans les nombres décimaux ignoré (point décimal détecté)" #: ../libqalculate/Number.cc:487 msgid "Decimal point in sexagesimal number treated as ':'." msgstr "Point décimal dans les nombres sexagésimaux traité comme ':'." #: ../libqalculate/Number.cc:505 #, c-format msgid "Character '%c' was ignored in the number \"%s\" with base %s." msgstr "Le caractère '%c' a été ignoré dans le nombre \"%s\" avec la base %s." #: ../libqalculate/Number.cc:1427 msgid "Division by zero." msgstr "Division par zéro." #. 0^0 #: ../libqalculate/Number.cc:1433 msgid "0^0 might be considered undefined" msgstr "0^0 sera considéré comme indéfini" #: ../libqalculate/Number.cc:1732 msgid "Can only handle Riemann Zeta with an integer argument (s) >= 1" msgstr "" "La fonction Zeta de Riemann ne peut être supportée qu'avec un argument " "entier >= 1" #: ../libqalculate/Number.cc:1738 msgid "Cannot handle an argument (s) that large for Riemann Zeta." msgstr "" "Impossible de supporter la fonction Zeta de Riemann pour un argument aussi " "grand." #: ../libqalculate/Number.cc:2628 ../libqalculate/Number.cc:2636 #: ../libqalculate/Number.cc:2645 msgid "infinity" msgstr "infini" #: ../libqalculate/Unit.cc:760 msgid "Error(s) in unitexpression." msgstr "Erreur(s) dans l'expression d'unités." #: ../libqalculate/util.cc:559 msgid "Yes" msgstr "Oui" #: ../libqalculate/util.cc:560 msgid "No" msgstr "Non" #: ../libqalculate/util.cc:567 msgid "True" msgstr "Vrai" #: ../libqalculate/util.cc:568 msgid "False" msgstr "Faux" #: ../libqalculate/util.cc:575 msgid "On" msgstr "Marche" #: ../libqalculate/util.cc:576 msgid "Off" msgstr "Arrêt" libqalculate-0.9.7/po/nl.po0000644000175100017510000015473411305546372012527 00000000000000# translation of libqalculate.po to # This file is distributed under the same license as the PACKAGE package. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. # # Niklas Knutsson , 2003. # Rinse de Vries , 2006. # Jaap Woldringh , 2006, 2007. msgid "" msgstr "" "Project-Id-Version: libqalculate\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-06-10 19:47+0200\n" "PO-Revision-Date: 2007-05-18 16:19+0200\n" "Last-Translator: Jaap Woldringh \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/qalc.cc:94 ../src/qalc.cc:144 ../src/qalc.cc:1686 #: ../src/qalc.cc:1687 ../libqalculate/util.cc:562 msgid "yes" msgstr "ja" #: ../src/qalc.cc:95 ../src/qalc.cc:146 ../src/qalc.cc:1686 #: ../src/qalc.cc:1687 ../libqalculate/util.cc:563 msgid "no" msgstr "nee" #: ../src/qalc.cc:96 ../libqalculate/util.cc:570 msgid "true" msgstr "waar" #: ../src/qalc.cc:97 ../libqalculate/util.cc:571 msgid "false" msgstr "onwaar" #: ../src/qalc.cc:98 ../src/qalc.cc:610 ../src/qalc.cc:625 ../src/qalc.cc:1230 #: ../src/qalc.cc:1648 ../src/qalc.cc:1650 ../src/qalc.cc:1653 #: ../src/qalc.cc:1654 ../src/qalc.cc:1659 ../src/qalc.cc:1660 #: ../src/qalc.cc:1661 ../src/qalc.cc:1662 ../src/qalc.cc:1664 #: ../src/qalc.cc:1665 ../src/qalc.cc:1666 ../src/qalc.cc:1668 #: ../src/qalc.cc:1669 ../src/qalc.cc:1671 ../src/qalc.cc:1672 #: ../src/qalc.cc:1673 ../src/qalc.cc:1674 ../src/qalc.cc:1675 #: ../src/qalc.cc:1679 ../src/qalc.cc:1681 ../src/qalc.cc:1682 #: ../src/qalc.cc:1683 ../src/qalc.cc:1684 ../src/qalc.cc:1685 #: ../src/qalc.cc:1688 ../src/qalc.cc:1689 ../src/qalc.cc:1690 #: ../src/qalc.cc:1691 ../src/qalc.cc:1692 ../src/qalc.cc:1693 #: ../src/qalc.cc:1694 ../src/qalc.cc:1695 ../src/qalc.cc:1696 #: ../src/qalc.cc:1697 ../libqalculate/util.cc:578 msgid "on" msgstr "aan" #: ../src/qalc.cc:99 ../src/qalc.cc:557 ../src/qalc.cc:583 ../src/qalc.cc:595 #: ../src/qalc.cc:608 ../src/qalc.cc:623 ../src/qalc.cc:1218 #: ../src/qalc.cc:1228 ../src/qalc.cc:1250 ../src/qalc.cc:1257 #: ../src/qalc.cc:1272 ../src/qalc.cc:1648 ../src/qalc.cc:1650 #: ../src/qalc.cc:1653 ../src/qalc.cc:1654 ../src/qalc.cc:1659 #: ../src/qalc.cc:1660 ../src/qalc.cc:1661 ../src/qalc.cc:1662 #: ../src/qalc.cc:1664 ../src/qalc.cc:1665 ../src/qalc.cc:1666 #: ../src/qalc.cc:1667 ../src/qalc.cc:1668 ../src/qalc.cc:1669 #: ../src/qalc.cc:1671 ../src/qalc.cc:1672 ../src/qalc.cc:1673 #: ../src/qalc.cc:1674 ../src/qalc.cc:1675 ../src/qalc.cc:1676 #: ../src/qalc.cc:1677 ../src/qalc.cc:1679 ../src/qalc.cc:1681 #: ../src/qalc.cc:1682 ../src/qalc.cc:1683 ../src/qalc.cc:1684 #: ../src/qalc.cc:1685 ../src/qalc.cc:1688 ../src/qalc.cc:1689 #: ../src/qalc.cc:1690 ../src/qalc.cc:1691 ../src/qalc.cc:1692 #: ../src/qalc.cc:1693 ../src/qalc.cc:1694 ../src/qalc.cc:1695 #: ../src/qalc.cc:1696 ../src/qalc.cc:1697 ../libqalculate/util.cc:579 msgid "off" msgstr "uit" #: ../src/qalc.cc:149 msgid "Please answer yes or no" msgstr "Antwoord alstublieft met ja of nee" #: ../src/qalc.cc:156 ../src/qalc.cc:1179 ../src/qalc.cc:1604 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "unknown" msgstr "onbekend" #: ../src/qalc.cc:162 ../src/qalc.cc:414 ../src/qalc.cc:445 ../src/qalc.cc:499 #: ../src/qalc.cc:513 ../src/qalc.cc:1137 ../src/qalc.cc:1148 #: ../src/qalc.cc:1183 ../src/qalc.cc:1198 ../src/qalc.cc:1649 #: ../src/qalc.cc:1651 ../src/qalc.cc:1656 ../src/qalc.cc:1658 msgid "none" msgstr "geen" #: ../src/qalc.cc:164 ../src/qalc.cc:1176 ../src/qalc.cc:1601 #: ../src/qalc.cc:1704 msgid "non-matrix" msgstr "niet-matrix" #: ../src/qalc.cc:166 ../src/qalc.cc:1174 ../src/qalc.cc:1599 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "complex" msgstr "complex" #: ../src/qalc.cc:168 ../src/qalc.cc:1173 ../src/qalc.cc:1598 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "real" msgstr "reëel" #: ../src/qalc.cc:170 ../src/qalc.cc:1175 ../src/qalc.cc:1600 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 ../libqalculate/Function.cc:1499 msgid "number" msgstr "getal" #: ../src/qalc.cc:172 ../src/qalc.cc:1172 ../src/qalc.cc:1597 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "rational" msgstr "rationaal" #: ../src/qalc.cc:174 ../src/qalc.cc:1171 ../src/qalc.cc:1596 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 ../libqalculate/Function.cc:1654 msgid "integer" msgstr "geheel" #: ../src/qalc.cc:176 ../src/qalc.cc:1166 ../src/qalc.cc:1591 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "non-zero" msgstr "ongelijk nul" #: ../src/qalc.cc:178 ../src/qalc.cc:1162 ../src/qalc.cc:1587 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "positive" msgstr "positief" #: ../src/qalc.cc:180 ../src/qalc.cc:1165 ../src/qalc.cc:1590 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "non-negative" msgstr "niet-negatief" #: ../src/qalc.cc:182 msgid "negatve" msgstr "negatief" #: ../src/qalc.cc:184 ../src/qalc.cc:1163 ../src/qalc.cc:1588 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "non-positive" msgstr "niet-positief" #: ../src/qalc.cc:187 msgid "Unrecognized assumption." msgstr "Onbekende aanname." #: ../src/qalc.cc:319 ../src/qalc.cc:320 msgid "" "\n" "Press Enter to continue." msgstr "" "\n" "Druk op Enter om verder te gaan." #: ../src/qalc.cc:328 ../src/qalc.cc:329 ../src/qalc.cc:330 ../src/qalc.cc:429 #: ../src/qalc.cc:432 ../src/qalc.cc:529 ../src/qalc.cc:540 ../src/qalc.cc:549 msgid "Illegal value" msgstr "waarde niet toegestaan" #. qalc command #: ../src/qalc.cc:344 ../src/qalc.cc:501 ../src/qalc.cc:1064 #: ../src/qalc.cc:1115 ../src/qalc.cc:1185 ../src/qalc.cc:1188 #: ../src/qalc.cc:1304 ../src/qalc.cc:1656 ../src/qalc.cc:1657 #: ../src/qalc.cc:1740 msgid "base" msgstr "grondtal" #: ../src/qalc.cc:344 ../src/qalc.cc:346 ../src/qalc.cc:1235 #: ../src/qalc.cc:1670 msgid "input base" msgstr "Voer grondtal in" #: ../src/qalc.cc:344 msgid "output base" msgstr "Voer grondtal uit" #: ../src/qalc.cc:347 ../src/qalc.cc:1190 ../src/qalc.cc:1237 #: ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "roman" msgstr "Romeins" #: ../src/qalc.cc:348 ../src/qalc.cc:1192 ../src/qalc.cc:1657 msgid "time" msgstr "tijd" #: ../src/qalc.cc:349 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "hex" msgstr "hex" #: ../src/qalc.cc:349 msgid "hexadecimal" msgstr "hexadecimaal" #: ../src/qalc.cc:350 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "bin" msgstr "bin" #: ../src/qalc.cc:350 msgid "binary" msgstr "binair" #: ../src/qalc.cc:351 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "oct" msgstr "oct" #: ../src/qalc.cc:351 msgid "octal" msgstr "octaal" #: ../src/qalc.cc:352 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "dec" msgstr "dec" #: ../src/qalc.cc:352 msgid "decimal" msgstr "decimaal" #: ../src/qalc.cc:353 ../src/qalc.cc:1657 msgid "sex" msgstr "sex" #: ../src/qalc.cc:353 ../src/qalc.cc:1191 msgid "sexagesimal" msgstr "sexagesimaal" #: ../src/qalc.cc:370 ../src/qalc.cc:412 ../src/qalc.cc:1196 #: ../src/qalc.cc:1658 msgid "base display" msgstr "tonen van grondtal" #: ../src/qalc.cc:374 msgid "Illegal base." msgstr "Grondtal niet toegestaan." #: ../src/qalc.cc:382 ../src/qalc.cc:1180 ../src/qalc.cc:1655 msgid "assumptions" msgstr "aannames" #: ../src/qalc.cc:392 ../src/qalc.cc:1142 ../src/qalc.cc:1650 msgid "all prefixes" msgstr "alle voorvoegsels" #: ../src/qalc.cc:393 ../src/qalc.cc:1205 ../src/qalc.cc:1661 msgid "complex numbers" msgstr "complexe getallen" #: ../src/qalc.cc:394 ../src/qalc.cc:1215 ../src/qalc.cc:1666 msgid "excessive parenthesis" msgstr "te veel haakjes" #: ../src/qalc.cc:395 ../src/qalc.cc:1234 ../src/qalc.cc:1669 msgid "functions" msgstr "functies" #: ../src/qalc.cc:396 ../src/qalc.cc:1242 ../src/qalc.cc:1671 msgid "infinite numbers" msgstr "oneindige getallen" #: ../src/qalc.cc:397 ../src/qalc.cc:1283 ../src/qalc.cc:1689 msgid "show negative exponents" msgstr "toon negatieve exponenten" #: ../src/qalc.cc:398 ../src/qalc.cc:1158 ../src/qalc.cc:1653 msgid "assume nonzero denominators" msgstr "neem noemers aan ongelijk nul" #: ../src/qalc.cc:399 ../src/qalc.cc:1159 ../src/qalc.cc:1654 msgid "warn nonzero denominators" msgstr "waarschuwen noemers ongelijk nul" #: ../src/qalc.cc:400 ../src/qalc.cc:1269 ../src/qalc.cc:1681 msgid "prefixes" msgstr "voorvoegsels" #: ../src/qalc.cc:401 ../src/qalc.cc:1206 ../src/qalc.cc:1662 msgid "denominator prefixes" msgstr "voorvoegsels voor noemers" #: ../src/qalc.cc:402 ../src/qalc.cc:1267 ../src/qalc.cc:1679 msgid "place units separately" msgstr "eenheden apart plaatsen" #: ../src/qalc.cc:403 ../src/qalc.cc:1204 ../src/qalc.cc:1660 msgid "calculate variables" msgstr "variabelen berekenen" #: ../src/qalc.cc:404 ../src/qalc.cc:1203 ../src/qalc.cc:1659 msgid "calculate functions" msgstr "functies berekenen" #: ../src/qalc.cc:405 ../src/qalc.cc:1287 ../src/qalc.cc:1693 msgid "sync units" msgstr "sync eenheden" #: ../src/qalc.cc:406 ../src/qalc.cc:1277 ../src/qalc.cc:1683 msgid "round to even" msgstr "afronden naar even" #. qalc command #: ../src/qalc.cc:407 ../src/qalc.cc:1067 ../src/qalc.cc:1278 #: ../src/qalc.cc:1316 ../src/qalc.cc:1684 ../src/qalc.cc:1728 msgid "rpn" msgstr "rpn" #: ../src/qalc.cc:408 ../src/qalc.cc:1279 ../src/qalc.cc:1685 msgid "rpn syntax" msgstr "rpn-notatie" #: ../src/qalc.cc:409 ../src/qalc.cc:1284 ../src/qalc.cc:1690 msgid "short multiplication" msgstr "korte vermenigvuldiging" #: ../src/qalc.cc:410 ../src/qalc.cc:1244 ../src/qalc.cc:1674 msgid "lowercase e" msgstr "kleine letter e" #: ../src/qalc.cc:411 ../src/qalc.cc:1245 ../src/qalc.cc:1675 msgid "lowercase numbers" msgstr "onderkast getallen" #: ../src/qalc.cc:415 ../src/qalc.cc:1199 ../src/qalc.cc:1658 msgid "normal" msgstr "normaal" #: ../src/qalc.cc:416 ../src/qalc.cc:1200 ../src/qalc.cc:1658 msgid "alternative" msgstr "alternatief" #: ../src/qalc.cc:421 ../src/qalc.cc:450 ../src/qalc.cc:464 ../src/qalc.cc:478 #: ../src/qalc.cc:492 ../src/qalc.cc:506 ../src/qalc.cc:520 ../src/qalc.cc:567 #: ../src/qalc.cc:576 ../src/qalc.cc:616 ../src/qalc.cc:630 msgid "Illegal value." msgstr "Waarde niet toegestaan." #: ../src/qalc.cc:426 ../src/qalc.cc:1286 ../src/qalc.cc:1692 msgid "spell out logical" msgstr "logische bewerking voluit spellen" #: ../src/qalc.cc:427 ../src/qalc.cc:1214 ../src/qalc.cc:1664 msgid "dot as separator" msgstr "punt als scheidingsteken" #: ../src/qalc.cc:428 ../src/qalc.cc:1243 ../src/qalc.cc:1673 msgid "limit implicit multiplication" msgstr "impliciet vermenigvuldigen beperken" #: ../src/qalc.cc:430 ../src/qalc.cc:1285 ../src/qalc.cc:1691 msgid "spacious" msgstr "ruimtelijk" #: ../src/qalc.cc:431 ../src/qalc.cc:1288 ../src/qalc.cc:1694 msgid "unicode" msgstr "unicode" #: ../src/qalc.cc:434 ../src/qalc.cc:1289 ../src/qalc.cc:1695 msgid "units" msgstr "eenheden" #: ../src/qalc.cc:435 ../src/qalc.cc:1290 ../src/qalc.cc:1696 msgid "unknowns" msgstr "onbekenden" #: ../src/qalc.cc:436 ../src/qalc.cc:1291 ../src/qalc.cc:1697 msgid "variables" msgstr "variabelen" #: ../src/qalc.cc:437 ../src/qalc.cc:1134 ../src/qalc.cc:1648 msgid "abbreviations" msgstr "afkortingen" #: ../src/qalc.cc:438 ../src/qalc.cc:1282 ../src/qalc.cc:1688 msgid "show ending zeroes" msgstr "afsluitende nullen tonen" #: ../src/qalc.cc:439 ../src/qalc.cc:1241 ../src/qalc.cc:1672 msgid "indicate infinite series" msgstr "oneindige reeksen aangeven" #: ../src/qalc.cc:440 ../src/qalc.cc:1143 ../src/qalc.cc:1651 msgid "angle unit" msgstr "hoekeenheid" #: ../src/qalc.cc:442 ../src/qalc.cc:1145 ../src/qalc.cc:1146 msgid "rad" msgstr "rad" #: ../src/qalc.cc:442 ../src/qalc.cc:1651 msgid "radians" msgstr "radialen" #: ../src/qalc.cc:443 msgid "deg" msgstr "deg" #: ../src/qalc.cc:443 ../src/qalc.cc:1651 msgid "degrees" msgstr "graden" #: ../src/qalc.cc:444 ../src/qalc.cc:1147 msgid "gra" msgstr "gra" #: ../src/qalc.cc:444 ../src/qalc.cc:1651 msgid "gradians" msgstr "grads (100 grads in rechte hoek)" #: ../src/qalc.cc:455 ../src/qalc.cc:1260 ../src/qalc.cc:1678 msgid "multiplication sign" msgstr "vermenigvuldigingsteken" #: ../src/qalc.cc:469 ../src/qalc.cc:1207 ../src/qalc.cc:1663 msgid "division sign" msgstr "teken voor delen" #: ../src/qalc.cc:483 ../src/qalc.cc:1151 ../src/qalc.cc:1652 msgid "approximation" msgstr "benadering" #. qalc command #: ../src/qalc.cc:485 ../src/qalc.cc:526 ../src/qalc.cc:609 #: ../src/qalc.cc:1097 ../src/qalc.cc:1153 ../src/qalc.cc:1229 #: ../src/qalc.cc:1307 ../src/qalc.cc:1652 ../src/qalc.cc:1665 #: ../src/qalc.cc:1668 ../src/qalc.cc:1744 msgid "exact" msgstr "exact" #: ../src/qalc.cc:486 ../src/qalc.cc:1154 ../src/qalc.cc:1652 msgid "try exact" msgstr "exact proberen" #. qalc command #: ../src/qalc.cc:487 ../src/qalc.cc:1103 ../src/qalc.cc:1155 #: ../src/qalc.cc:1302 ../src/qalc.cc:1516 ../src/qalc.cc:1526 #: ../src/qalc.cc:1614 ../src/qalc.cc:1652 ../src/qalc.cc:1748 msgid "approximate" msgstr "benaderd" #: ../src/qalc.cc:497 ../src/qalc.cc:1181 ../src/qalc.cc:1656 msgid "autoconversion" msgstr "autoconversie" #: ../src/qalc.cc:500 ../src/qalc.cc:1112 ../src/qalc.cc:1184 #: ../src/qalc.cc:1656 msgid "best" msgstr "best" #: ../src/qalc.cc:511 ../src/qalc.cc:1135 ../src/qalc.cc:1649 msgid "algebra mode" msgstr "algebraïsche modus" #. qalc command #: ../src/qalc.cc:514 ../src/qalc.cc:1126 ../src/qalc.cc:1138 #: ../src/qalc.cc:1319 ../src/qalc.cc:1635 ../src/qalc.cc:1649 msgid "simplify" msgstr "vereenvoudigen" #: ../src/qalc.cc:515 ../src/qalc.cc:1139 ../src/qalc.cc:1649 msgid "factorize" msgstr "ontbinden in factoren" #: ../src/qalc.cc:537 ../src/qalc.cc:1281 ../src/qalc.cc:1687 msgid "save mode" msgstr "modus opslaan" #: ../src/qalc.cc:546 ../src/qalc.cc:1280 ../src/qalc.cc:1686 msgid "save definitions" msgstr "definities opslaan" #: ../src/qalc.cc:555 ../src/qalc.cc:1216 ../src/qalc.cc:1667 msgid "exp mode" msgstr "exp modus" #: ../src/qalc.cc:558 ../src/qalc.cc:1219 ../src/qalc.cc:1667 msgid "auto" msgstr "auto" #: ../src/qalc.cc:559 ../src/qalc.cc:1220 ../src/qalc.cc:1667 msgid "pure" msgstr "zuiver" #: ../src/qalc.cc:560 ../src/qalc.cc:1221 ../src/qalc.cc:1667 msgid "scientific" msgstr "wetenschappelijk" #: ../src/qalc.cc:561 ../src/qalc.cc:1222 ../src/qalc.cc:1667 msgid "engineering" msgstr "technisch" #: ../src/qalc.cc:572 ../src/qalc.cc:1268 ../src/qalc.cc:1680 msgid "precision" msgstr "nauwkeurigheid" #: ../src/qalc.cc:581 ../src/qalc.cc:1246 ../src/qalc.cc:1676 msgid "max decimals" msgstr "max decimalen" #: ../src/qalc.cc:593 ../src/qalc.cc:1253 ../src/qalc.cc:1677 msgid "min decimals" msgstr "min decimalen" #: ../src/qalc.cc:606 ../src/qalc.cc:1226 ../src/qalc.cc:1668 msgid "fractions" msgstr "breuken" #: ../src/qalc.cc:611 ../src/qalc.cc:1231 ../src/qalc.cc:1668 msgid "combined" msgstr "gecombineerd" #: ../src/qalc.cc:621 ../src/qalc.cc:1270 ../src/qalc.cc:1682 msgid "read precision" msgstr "nauwkeurigheid lezen" #: ../src/qalc.cc:624 ../src/qalc.cc:1273 ../src/qalc.cc:1682 msgid "always" msgstr "altijd" #: ../src/qalc.cc:625 ../src/qalc.cc:1274 ../src/qalc.cc:1682 msgid "when decimals" msgstr "wanneer decimalen" #: ../src/qalc.cc:649 msgid "Unrecognized option." msgstr "Onbekende optie." #: ../src/qalc.cc:670 msgid "usage: qalc [options] [expression]" msgstr "gebruik: qalc [opties] [expressie]" #: ../src/qalc.cc:672 msgid "where options are:" msgstr "waarin opties zijn:" #: ../src/qalc.cc:674 msgid "turn on/off unicode support" msgstr "ondersteuning unicode aan/uit" #: ../src/qalc.cc:675 ../src/qalc.cc:1318 msgid "OPTION" msgstr "OPTIE" #: ../src/qalc.cc:675 ../src/qalc.cc:1318 msgid "VALUE" msgstr "WAARDE" #: ../src/qalc.cc:676 msgid "as set command in interactive program session (ex. -set \"base 16\")" msgstr "" "als set-opdracht bij interactief programmeren (vb. -set \"base 16\" (stel " "grondtal talstelsel op 16))" #: ../src/qalc.cc:677 msgid "FILE" msgstr "BESTAND" #: ../src/qalc.cc:678 msgid "executes commands from a file first" msgstr "voert eerst opdrachten uit vanuit een bestand" #: ../src/qalc.cc:680 msgid "reduces output to just the result of the input expression" msgstr "" "reduceert de uitvoer tot alleen het antwoord op de ingevoerde expressie" #: ../src/qalc.cc:682 msgid "do not load any functions, units, or variables from file" msgstr "lees geen functies, eenheden of variabelen in uit bestand" #: ../src/qalc.cc:684 msgid "do not load any global currencies from file" msgstr "lees geen globale munteenheden in uit bestand" #: ../src/qalc.cc:686 msgid "do not load any global data sets from file" msgstr "lees geen globale gegevensverzamelingen in uit bestand" #: ../src/qalc.cc:688 msgid "do not load any global functions from file" msgstr "lees geen globale functies in uit bestand" #: ../src/qalc.cc:690 msgid "do not load any global units from file" msgstr "lees geen globale eenheden in uit bestand" #: ../src/qalc.cc:692 msgid "do not load any global variables from file" msgstr "lees geen globale variabelen in uit bestand" #: ../src/qalc.cc:694 msgid "" "The program will start in interactive mode if no expression is specified." msgstr "" "Het programma start op in interactieve modus indien geen expressie is " "opgegeven." #: ../src/qalc.cc:720 msgid "No option and value specified for set command." msgstr "Voor set-opdracht zijn geen optie en waarde opgegeven." #: ../src/qalc.cc:728 msgid "No file specified." msgstr "Geen bestand opgegeven." #: ../src/qalc.cc:780 msgid "" "You need the download exchange rates to be able to convert between different " "currencies.\n" "You can later get current exchange rates with the \"exchange rates\" " "command.\n" "Do you want to fetch exchange rates now from the Internet (default yes)?" msgstr "" "Om tussen de verschillende valuta te kunnen converteren moeten wisselkoersen " "worden opgehaald van het internet.\n" "Later kunt u recente wisselkoersen verkrijgen met de opdracht \"wisselkoersen" "\".Wilt u nu wisselkoersen ophalen van het internet (standaard is ja)?" #: ../src/qalc.cc:789 msgid "ans" msgstr "antw" #: ../src/qalc.cc:790 ../src/qalc.cc:793 ../src/qalc.cc:794 ../src/qalc.cc:795 #: ../src/qalc.cc:796 ../src/qalc.cc:1006 ../libqalculate/Calculator.cc:7054 msgid "Temporary" msgstr "Tijdelijk" #: ../src/qalc.cc:790 msgid "Last Answer" msgstr "Laatste antwoord" #: ../src/qalc.cc:791 msgid "answer" msgstr "antwoord" #: ../src/qalc.cc:793 msgid "Answer 2" msgstr "Antwoord 2" #: ../src/qalc.cc:794 msgid "Answer 3" msgstr "Antwoord 3" #: ../src/qalc.cc:795 msgid "Answer 4" msgstr "Antwoord 4" #: ../src/qalc.cc:796 msgid "Answer 5" msgstr "Antwoord 5" #: ../src/qalc.cc:807 msgid "Failed to load global definitions!" msgstr "Inlezen van globale definities is mislukt!" #: ../src/qalc.cc:840 #, c-format msgid "Could not open \"%s\".\n" msgstr "Kon \"%s\" niet openen.\n" #: ../src/qalc.cc:859 ../src/qalc.cc:905 ../src/qalc.cc:1783 #, c-format msgid "Illegal character, '%c', in expression." msgstr "Ongeldig teken '%c', in expressie." #. The qalc command "set" as in "set precision 10". The original text string for commands is kept in addition to the translation. #: ../src/qalc.cc:968 ../src/qalc.cc:1318 ../src/qalc.cc:1639 msgid "set" msgstr "set" #. qalc command #: ../src/qalc.cc:972 ../src/qalc.cc:1317 ../src/qalc.cc:1707 msgid "save" msgstr "opslaan" #: ../src/qalc.cc:972 ../src/qalc.cc:1317 ../src/qalc.cc:1707 msgid "store" msgstr "bewaren" #. qalc command #: ../src/qalc.cc:975 ../src/qalc.cc:1129 ../src/qalc.cc:1315 #: ../src/qalc.cc:1714 msgid "mode" msgstr "modus" #: ../src/qalc.cc:977 msgid "mode saved" msgstr "modus opgeslagen" #: ../src/qalc.cc:979 msgid "definitions" msgstr "definities" #: ../src/qalc.cc:981 msgid "definitions saved" msgstr "definities opgeslagen" #: ../src/qalc.cc:1028 ../src/qalc.cc:1030 #, c-format msgid "Illegal name. Save as %s instead?" msgstr "Ongeldige naam. In plaats daarvan als %s opslaan?" #: ../src/qalc.cc:1037 msgid "" "An unit or variable with the same name already exists.\n" "Do you want to overwrite it?" msgstr "" "Er bestaat al een eenheid of variabele met deze naam.\n" "Wilt u die overschrijven?" #. qalc command #: ../src/qalc.cc:1060 ../src/qalc.cc:1303 ../src/qalc.cc:1701 msgid "assume" msgstr "aannemen" #. qalc command #: ../src/qalc.cc:1070 ../src/qalc.cc:1076 ../src/qalc.cc:1308 #: ../src/qalc.cc:1724 msgid "exrates" msgstr "wisselkoersen" #. qalc command #: ../src/qalc.cc:1080 ../src/qalc.cc:1320 ../src/qalc.cc:1736 msgid "stack" msgstr "stapelgeheugen (stack)" #: ../src/qalc.cc:1082 msgid "The RPN stack is empty." msgstr "Het RPN-stapelgeheugen is leeg." #. qalc command #: ../src/qalc.cc:1094 ../src/qalc.cc:1305 ../src/qalc.cc:1732 msgid "clear stack" msgstr "stapelgeheugen leeg maken" #. qalc command #: ../src/qalc.cc:1109 ../src/qalc.cc:1306 ../src/qalc.cc:1752 msgid "convert" msgstr "converteren" #: ../src/qalc.cc:1109 ../src/qalc.cc:1306 ../src/qalc.cc:1752 msgid "to" msgstr "naar" #. qalc command #: ../src/qalc.cc:1123 ../src/qalc.cc:1313 ../src/qalc.cc:1631 msgid "factor" msgstr "factor" #: ../src/qalc.cc:1164 ../src/qalc.cc:1589 ../src/qalc.cc:1655 #: ../src/qalc.cc:1704 msgid "negative" msgstr "negatief" #. qalc command #: ../src/qalc.cc:1294 ../src/qalc.cc:1628 msgid "help" msgstr "help" #: ../src/qalc.cc:1296 msgid "Enter a mathematical expression or a command." msgstr "Voer een wiskundige expressie of opdracht in." #: ../src/qalc.cc:1298 msgid "Complete functions, units and variables with the tabulator key." msgstr "" "Invoer namen functies, eenheden en variabelen met de tabtoets voltooien." #: ../src/qalc.cc:1300 msgid "Available commands are:" msgstr "Beschikbare opdrachten zijn:" #: ../src/qalc.cc:1303 msgid "ASSUMPTIONS" msgstr "AANNAMES" #: ../src/qalc.cc:1304 msgid "BASE" msgstr "GRONDTAL" #: ../src/qalc.cc:1306 msgid "UNIT" msgstr "EENHEID" #: ../src/qalc.cc:1310 msgid "WGET ARGUMENTS" msgstr "ARGUMENTEN WGET" #: ../src/qalc.cc:1314 ../src/qalc.cc:1326 ../src/qalc.cc:1718 #: ../libqalculate/Calculator.cc:7680 ../libqalculate/DataSet.cc:354 #: ../libqalculate/DataSet.cc:381 ../libqalculate/DataSet.cc:992 msgid "info" msgstr "info" #: ../src/qalc.cc:1316 msgid "ON/OFF" msgstr "AAN/UIT" #: ../src/qalc.cc:1317 msgid "NAME" msgstr "NAAM" #: ../src/qalc.cc:1317 msgid "CATEGORY" msgstr "CATEGORIE" #: ../src/qalc.cc:1317 msgid "TITLE" msgstr "TITEL" #. qalc command #: ../src/qalc.cc:1321 ../src/qalc.cc:1765 ../src/qalc.cc:1773 msgid "quit" msgstr "afsluiten" #: ../src/qalc.cc:1321 ../src/qalc.cc:1765 ../src/qalc.cc:1773 msgid "exit" msgstr "verlaten" #: ../src/qalc.cc:1323 msgid "Type help COMMAND for more help (example: help save)." msgstr "Type help OPDRACHT voor meer hulp (bv.: help save)." #: ../src/qalc.cc:1324 msgid "" "Type info NAME for info about a function, variable or unit (example: info " "sin)." msgstr "" "Type info NAAM voor info over een functie, variabele of eenheid (bv.: info " "sin)." #: ../src/qalc.cc:1334 msgid "No function, variable or unit with specified name exist." msgstr "Er bestaat geen functie, variabele of eenheid met de opgegeven naam." #: ../src/qalc.cc:1344 msgid "Function" msgstr "Functie" #: ../src/qalc.cc:1371 ../libqalculate/Function.cc:149 msgid "argument" msgstr "argument" #: ../src/qalc.cc:1395 #, c-format msgid "" "Retrieves data from the %s data set for a given object and property. If " "\"info\" is typed as property, all properties of the object will be listed." msgstr "" "Haalt gegevens op van een gegeven object en eigenschap uit de " "gegevensverzameling %s. Indien als eigenschap \"info\" wordt ingetypt krijgt " "u een lijst van alle eigenschappen van het object." #: ../src/qalc.cc:1408 msgid "Arguments" msgstr "Argumenten" #. optional argument, in description #: ../src/qalc.cc:1425 msgid "optional" msgstr "optioneel" #. argument default, in description #: ../src/qalc.cc:1429 msgid "default: " msgstr "standaard: " #: ../src/qalc.cc:1440 msgid "Requirement" msgstr "Vereiste" #: ../src/qalc.cc:1448 msgid "Properties" msgstr "Eigenschappen" #: ../src/qalc.cc:1463 msgid "key" msgstr "sleutelwaarde" #: ../src/qalc.cc:1481 ../src/qalc.cc:1484 msgid "Unit" msgstr "Eenheid" #: ../src/qalc.cc:1487 ../src/qalc.cc:1555 msgid "Names" msgstr "Namen" #: ../src/qalc.cc:1505 msgid "Base Unit" msgstr "Basiseenheid" #: ../src/qalc.cc:1512 msgid "Relation" msgstr "Relatie" #: ../src/qalc.cc:1522 msgid "Inverse Relation" msgstr "Inverse relatie" #: ../src/qalc.cc:1534 msgid "Base Units" msgstr "Basiseenheden" #: ../src/qalc.cc:1549 ../src/qalc.cc:1552 msgid "Variable" msgstr "Variabele" #: ../src/qalc.cc:1567 msgid "a previous result" msgstr "een vorig antwoord" #: ../src/qalc.cc:1577 ../libqalculate/Function.cc:1823 msgid "matrix" msgstr "matrix" #: ../src/qalc.cc:1579 ../libqalculate/Function.cc:1762 msgid "vector" msgstr "vector" #: ../src/qalc.cc:1606 msgid "default assumptions" msgstr "standaard aannames" #: ../src/qalc.cc:1610 msgid "Value" msgstr "Waarde" #: ../src/qalc.cc:1633 msgid "Factorizes the current result." msgstr "Het huidige antwoord wordt in factoren ontbonden." #: ../src/qalc.cc:1637 msgid "Simplifies the current result." msgstr "Het huidige antwoord wordt vereenvoudigd." #: ../src/qalc.cc:1644 msgid "Sets the value of an option." msgstr "Stelt de waarde in van een optie." #: ../src/qalc.cc:1646 msgid "Available options and accepted values are:" msgstr "Beschikbare opties en geaccepteerde waarden zijn:" #: ../src/qalc.cc:1699 msgid "Example: set base 16." msgstr "Voorbeeld: set base 16 (stel grondtal talstelsel in op 16)." #: ../src/qalc.cc:1703 msgid "Set default assumptions for unknown variables." msgstr "Staandaard aannames instellen voor onbekende variabelen." #: ../src/qalc.cc:1709 msgid "" "Saves the current result in a variable with the specified name. You may " "optionally also provide a category (default \"Temporary\") and a title." msgstr "" "Slaat het huidige antwoord op in een variabele met de opgegeven naam. " "Optioneel kunt u ook een categorie (standaard \"Tijdelijk\") en een titel " "opgeven." #: ../src/qalc.cc:1710 msgid "" "If name equals \"mode\" or \"definitions\", the current mode and " "definitions, respectively, will be saved." msgstr "" "Indien de naam \"modus\" is of \"definities\", worden de huidige modus of " "definities opgeslagen." #: ../src/qalc.cc:1712 msgid "Example: store var1." msgstr "Voorbeeld: store var1 (bewaar var1)." #: ../src/qalc.cc:1716 msgid "Displays the current mode." msgstr "Toont de huidige modus." #: ../src/qalc.cc:1720 msgid "Displays information about a function, variable or unit." msgstr "Toont informatie over een functie, variabele of eenheid." #: ../src/qalc.cc:1722 msgid "Example: info sin." msgstr "Voorbeeld: info sin." #: ../src/qalc.cc:1726 msgid "Downloads current exchange rates from the Internet." msgstr "Haalt de huidige wisselkoersen op van het internet." #: ../src/qalc.cc:1730 msgid "(De)activates the Reverse Polish Notation mode." msgstr "(De)activeert de RPN-modus (omgekeerde Poolse notatie)." #: ../src/qalc.cc:1734 msgid "Clears the RPN stack." msgstr "Maakt het RPN-stapelgeheugen leeg." #: ../src/qalc.cc:1738 msgid "Displays the RPN stack." msgstr "Toont het RPN-stapelgeheugen." #: ../src/qalc.cc:1742 msgid "Sets the result base (equivalent to set base)." msgstr "" "Stelt het grondtal in voor het antwoord (gelijkwaardig aan instellen " "grondtal talstelsel)." #: ../src/qalc.cc:1746 msgid "Equivalent to set approximation exact." msgstr "Gelijkwaardig aan benadering instellen op exact." #: ../src/qalc.cc:1750 msgid "Equivalent to set approximation try exact." msgstr "Gelijkwaardig aan benadering instellen op exact proberen." #: ../src/qalc.cc:1754 msgid "Converts units in current result." msgstr "Converteert de eenheden in het huidige antwoord." #: ../src/qalc.cc:1756 msgid "Possible unit values are:" msgstr "Mogelijke eenheden zijn:" #: ../src/qalc.cc:1758 msgid "a unit (example meter)" msgstr "een eenheid (voorbeeld meter)" #: ../src/qalc.cc:1759 msgid "a unit expression (example km/h)" msgstr "een uitdrukking voor een eenheid (voorbeeld km/h)" #: ../src/qalc.cc:1760 msgid "base (convert to base units)" msgstr "basis (omzetten naar basiseenheden)" #: ../src/qalc.cc:1761 msgid "best (convert best unit)" msgstr "beste (omzetten naar beste eenheid)" #: ../src/qalc.cc:1763 msgid "Example: convert best." msgstr "Voorbeeld: convert best (converteer naar beste)." #: ../src/qalc.cc:1767 msgid "Terminates this program." msgstr "Sluit het programma af." #: ../src/qalc.cc:1818 msgid "error" msgstr "fout" #: ../src/qalc.cc:1820 msgid "warning" msgstr "waarschuwing" #: ../src/qalc.cc:1879 ../libqalculate/Calculator.cc:182 #: ../libqalculate/Calculator.cc:183 ../libqalculate/Calculator.cc:188 #: ../libqalculate/Calculator.cc:2146 msgid "aborted" msgstr "afgebroken" #: ../src/qalc.cc:1908 msgid "RPN Register Moved" msgstr "RPN-register is verplaatst" #: ../src/qalc.cc:1947 msgid "Processing (press Enter to abort)" msgstr "Aan het verwerken (afbreken met Enter)" #: ../src/qalc.cc:2010 msgid "approx." msgstr "benad." #: ../src/qalc.cc:2116 msgid "Factorizing (press Enter to abort)" msgstr "Aan het ontbinden in factoren (afbreken met Enter)" #: ../src/qalc.cc:2120 msgid "Simplifying (press Enter to abort)" msgstr "Aan het vereenvoudigen (afbreken met Enter)" #: ../src/qalc.cc:2315 msgid "Calculating (press Enter to abort)" msgstr "Aan het berekenen (afbreken met Enter)" #: ../src/qalc.cc:2371 msgid "RPN Operation" msgstr "RPN-berwerking" #: ../src/qalc.cc:2669 #, c-format msgid "" "Couldn't write preferences to\n" "%s" msgstr "" "Kon de voorkeurinstellingen niet schrijven naar\n" "%s" #: ../src/qalc.cc:2743 msgid "Couldn't write definitions" msgstr "Kon definities niet schrijven" #: ../libqalculate/BuiltinFunctions.cc:58 #, c-format msgid "Too many elements (%s) for the dimensions (%sx%s) of the matrix." msgstr "Te veel elementen (%s) voor de dimensies (%sx%s) van de matrix." #: ../libqalculate/BuiltinFunctions.cc:120 #: ../libqalculate/BuiltinFunctions.cc:180 #, c-format msgid "Row %s does not exist in matrix." msgstr "Rij %s bestaat niet in matrix." #: ../libqalculate/BuiltinFunctions.cc:133 #: ../libqalculate/BuiltinFunctions.cc:176 #, c-format msgid "Column %s does not exist in matrix." msgstr "Kolom %s bestaat niet in matrix." #: ../libqalculate/BuiltinFunctions.cc:191 #, c-format msgid "Argument 3, %s, is ignored for vectors." msgstr "Argument 3, %s, wordt genegeerd voor vectoren." #: ../libqalculate/BuiltinFunctions.cc:195 #: ../libqalculate/BuiltinFunctions.cc:216 #, c-format msgid "Element %s does not exist in vector." msgstr "Element %s bestaat niet in vector." #: ../libqalculate/BuiltinFunctions.cc:404 #, c-format msgid "%s() does at the moment only support integers and fractions of two." msgstr "%s() ondersteunt momenteel alleen gehele getallen en breuken van twee." #: ../libqalculate/BuiltinFunctions.cc:1242 #, c-format msgid "Argument for %s() must be a real number greater than or equal to -1/e." msgstr "" "Argument voor %s() moet een reëel getal zijn groter dan of gelijk aan -1/e." #: ../libqalculate/BuiltinFunctions.cc:2112 #: ../libqalculate/BuiltinFunctions.cc:2155 #, c-format msgid "Unsolvable comparison in %s()." msgstr "Vergelijken lukt niet in %s()." #: ../libqalculate/BuiltinFunctions.cc:2246 #: ../libqalculate/BuiltinFunctions.cc:2266 #: ../libqalculate/BuiltinFunctions.cc:2290 ../libqalculate/util.cc:164 #: ../libqalculate/util.cc:211 ../libqalculate/util.cc:231 #: ../libqalculate/util.cc:251 msgid "today" msgstr "vandaag" #: ../libqalculate/BuiltinFunctions.cc:2285 ../libqalculate/util.cc:167 #: ../libqalculate/util.cc:214 ../libqalculate/util.cc:234 #: ../libqalculate/util.cc:254 msgid "now" msgstr "nu" #: ../libqalculate/BuiltinFunctions.cc:2301 #, c-format msgid "The timestamp value for the date %s is too large or small for %s()." msgstr "" "\"Timestamp\"-waarde voor de datum %s is te groot of te klein voor %s()." #: ../libqalculate/BuiltinFunctions.cc:2336 #: ../libqalculate/BuiltinFunctions.cc:2349 #: ../libqalculate/BuiltinFunctions.cc:2362 #: ../libqalculate/BuiltinFunctions.cc:2384 #: ../libqalculate/BuiltinFunctions.cc:2405 #, c-format msgid "Error in date format for function %s()." msgstr "Fout in het datumformaat voor functie %s()." #: ../libqalculate/BuiltinFunctions.cc:2659 msgid "" "The number of requested elements in generate vector function must be a " "positive integer." msgstr "" "Het aantal gevraagde elementen in de gegenereerde vectorfunctie moet een " "positief geheel getal zijn." #: ../libqalculate/BuiltinFunctions.cc:2953 #: ../libqalculate/BuiltinFunctions.cc:2970 msgid "Comparison failed." msgstr "Vergelijken is mislukt." #: ../libqalculate/BuiltinFunctions.cc:2958 #: ../libqalculate/BuiltinFunctions.cc:2988 msgid "No matching item found." msgstr "Geen overeenkomst gevonden." #: ../libqalculate/BuiltinFunctions.cc:3070 #, c-format msgid "Object %s does not exist." msgstr "Object %s bestaat niet." #: ../libqalculate/BuiltinFunctions.cc:3097 #, c-format msgid "Register %s does not exist. Returning zero." msgstr "Register %s bestaat niet. Nul wordt geretourneerd." #: ../libqalculate/BuiltinFunctions.cc:3155 msgid "" "Both the lower and upper limit must be set to get the definite integral." msgstr "" "Voor de bepaalde integraal moeten zowel de onder- als de bovengrens worden " "opgegeven." #: ../libqalculate/BuiltinFunctions.cc:3290 msgid "" "No equality or inequality to solve. The entered expression to solve is not " "correct (ex. \"x + 5 = 3\" is correct)" msgstr "" "Geen op te lossen vergelijking of ongelijkheid. De ingevoerde op te lossen " "expressie is onjuist (bv. \"x + 5 = 3\" is juist)" #: ../libqalculate/BuiltinFunctions.cc:3337 #, c-format msgid "The comparison is true for all %s (with current assumptions)." msgstr "Het vergelijken geeft waar voor alle %s (met huidige aannames)." #: ../libqalculate/BuiltinFunctions.cc:3341 msgid "No possible solution was found (with current assumptions)." msgstr "Geen oplossing gevonden (met huidige aannames)." #: ../libqalculate/BuiltinFunctions.cc:3345 #, c-format msgid "Was unable to completely isolate %s." msgstr "Kon %s niet volledig isoleren." #: ../libqalculate/BuiltinFunctions.cc:3349 #: ../libqalculate/BuiltinFunctions.cc:3477 #: ../libqalculate/BuiltinFunctions.cc:3572 #, c-format msgid "The comparison is true for all %s if %s." msgstr "Het vergelijken geeft waar voor alle %s indien %s." #: ../libqalculate/BuiltinFunctions.cc:3353 #, c-format msgid "Was unable to isolate %s." msgstr "Kon %s niet isoleren." #: ../libqalculate/BuiltinFunctions.cc:3436 #: ../libqalculate/BuiltinFunctions.cc:3463 #: ../libqalculate/BuiltinFunctions.cc:3546 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed sign was " "therefor temporarily set as unknown." msgstr "" "Kon %s niet isoleren met de huidige aannames. Het aangenomen teken werd " "daarom tijdelijk als onbekend beschouwd." #: ../libqalculate/BuiltinFunctions.cc:3439 #: ../libqalculate/BuiltinFunctions.cc:3466 #: ../libqalculate/BuiltinFunctions.cc:3549 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed type and " "sign was therefor temporarily set as unknown." msgstr "" "Kon %s niet isoleren met de huidige aannames. Het aangenomen type en teken " "werd daarom tijdelijk als onbekend beschouwd." #: ../libqalculate/BuiltinFunctions.cc:3472 #: ../libqalculate/BuiltinFunctions.cc:3557 #, c-format msgid "The solution requires that %s." msgstr "De oplossing vereist dat %s." #: ../libqalculate/BuiltinFunctions.cc:3565 #, c-format msgid "Solution %s requires that %s." msgstr "De oplossing %s vereist dat %s." #: ../libqalculate/BuiltinFunctions.cc:3633 #, c-format msgid "" "Unable to isolate %s.\n" "\n" "You might need to place the equations and variables in an appropriate order " "so that so that each equation at least contains the corresponding variable " "(if automatic reordering failed)." msgstr "" "Kan %s niet isoleren.\n" "\n" "Mogelijk moet u de vergelijkingen en variabelen in een juiste volgorde " "plaatsen zodat elke vergelijking tenminste de ermee overeenkomende variabele " "bevat (indien het automatisch op volgorde zetten niet is gelukt)." #: ../libqalculate/BuiltinFunctions.cc:3635 #: ../libqalculate/BuiltinFunctions.cc:3649 #: ../libqalculate/BuiltinFunctions.cc:3658 #, c-format msgid "Unable to isolate %s." msgstr "Kon %s niet isoleren." #: ../libqalculate/BuiltinFunctions.cc:3642 #, c-format msgid "Inequalities is not allowed in %s()." msgstr "Ongelijkheden zijn niet toegestaan in %s()." #: ../libqalculate/Calculator.cc:277 msgid "per" msgstr "per" #: ../libqalculate/Calculator.cc:279 msgid "times" msgstr "keer" #: ../libqalculate/Calculator.cc:281 msgid "plus" msgstr "plus" #: ../libqalculate/Calculator.cc:283 msgid "minus" msgstr "minus" #: ../libqalculate/Calculator.cc:285 ../libqalculate/MathStructure.cc:11274 #: ../libqalculate/Function.cc:1106 ../libqalculate/Function.cc:1114 #: ../libqalculate/Function.cc:1523 ../libqalculate/Function.cc:1667 msgid "and" msgstr "and" #: ../libqalculate/Calculator.cc:289 ../libqalculate/DataSet.cc:1026 #: ../libqalculate/DataSet.cc:1089 ../libqalculate/MathStructure.cc:11288 #: ../libqalculate/Function.cc:1977 ../libqalculate/Function.cc:1993 msgid "or" msgstr "or" #: ../libqalculate/Calculator.cc:319 ../libqalculate/Calculator.cc:1038 #: ../libqalculate/Calculator.cc:2154 ../libqalculate/Calculator.cc:2155 msgid " to " msgstr " naar " #: ../libqalculate/Calculator.cc:391 msgid "Gradians unit is missing. Creating one for this session." msgstr "" "Eenheid grad (100 grads in rechte hoek) ontbreekt. Voor deze sessie wordt er " "een aangemaakt." #: ../libqalculate/Calculator.cc:392 ../libqalculate/Calculator.cc:400 #: ../libqalculate/Calculator.cc:408 msgid "Angle/Plane Angle" msgstr "Hoek/hoek in het platte vlak" #: ../libqalculate/Calculator.cc:399 msgid "Radians unit is missing. Creating one for this session." msgstr "Eenheid radiaal ontbreekt. Voor deze sessie wordt er een aangemaakt." #: ../libqalculate/Calculator.cc:407 msgid "Degrees unit is missing. Creating one for this session." msgstr "Eenheid graad ontbreekt. Voor deze sessie wordt er een aangemaakt." #: ../libqalculate/Calculator.cc:1377 ../libqalculate/Calculator.cc:8061 msgid "Currency" msgstr "Valuta" #: ../libqalculate/Calculator.cc:2117 msgid "calculating..." msgstr "aan het rekenen..." #: ../libqalculate/Calculator.cc:2243 msgid "timed out" msgstr "tijd is verlopen" #: ../libqalculate/Calculator.cc:3144 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name of \"%s\", or " "the variable will be lost." msgstr "" "De naam \"%s\" is niet meer toegestaan. Verander alstublieft de naam \"%s\" " "omdat anders deze variabele verloren gaat." #: ../libqalculate/Calculator.cc:3161 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the function will be lost." msgstr "" "De naam \"%s\" is niet meer toegestaan. Verander alstublieft de naam \"%s\" " "omdat anders deze functie verloren gaat." #: ../libqalculate/Calculator.cc:3177 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the unit will be lost." msgstr "" "De naam \"%s\" is niet meer toegestaan. Verander alstublieft de naam \"%s\" " "omdat anders deze eenheid verloren gaat." #: ../libqalculate/Calculator.cc:4156 ../libqalculate/Calculator.cc:4802 #: ../libqalculate/Calculator.cc:4814 ../libqalculate/Calculator.cc:4839 #: ../libqalculate/Calculator.cc:4865 #, c-format msgid "Misplaced operator(s) \"%s\" ignored" msgstr "Verkeerd geplaatste bewerking(en) \"%s\" genegeerd" #: ../libqalculate/Calculator.cc:4180 ../libqalculate/Calculator.cc:4889 #, c-format msgid "Misplaced '%c' ignored" msgstr "Verkeerd geplaatste '%c' genegeerd" #: ../libqalculate/Calculator.cc:4207 ../libqalculate/Function.cc:1253 #: ../libqalculate/Function.cc:1284 #, c-format msgid "Internal id %s does not exist." msgstr "Interne id %s bestaat niet." #: ../libqalculate/Calculator.cc:4225 #, c-format msgid "\"%s\" is not a valid variable/function/unit." msgstr "\"%s\" is geen geldige variabele/functie/eenheid." #: ../libqalculate/Calculator.cc:4240 #, c-format msgid "" "Trailing characters \"%s\" (not a valid variable/function/unit) in number \"%" "s\" was ignored." msgstr "" "Afsluitende karakters \"%s\" (geen geldige variabele/functie/eenheid) in " "getal \"%s\" werden genegeerd." #: ../libqalculate/Calculator.cc:4630 msgid "RPN syntax error. Values left at the end of the RPN expression." msgstr "" "RPN-fout. Er zijn nog waarden overgebleven na de verwerking van de RPN-" "opdracht." #: ../libqalculate/Calculator.cc:4633 msgid "Unused stack values." msgstr "Ongebruikte waarden op de stack (stapelregister)." #: ../libqalculate/Calculator.cc:4695 msgid "RPN syntax error. Stack is empty." msgstr "RPN-syntaxisfout. Stack (stapelregister) is leeg." #: ../libqalculate/Calculator.cc:4697 msgid "RPN syntax error. Operator ignored as there where only one stack value." msgstr "" "RPN-syntaxisfout. Bewerking genegeerd omdat er slechts één waarde is op de " "stack (stapelregister)." #: ../libqalculate/Calculator.cc:5056 #, c-format msgid "Name \"%s\" is in use. Replacing with \"%s\"." msgstr "Naam \"%s\" wordt al gebruikt.. Wordt vervangen door \"%s\"." #: ../libqalculate/Calculator.cc:5715 ../libqalculate/DataSet.cc:498 #, c-format msgid "File not identified as Qalculate! definitions file: %s." msgstr "Bestand niet gedefinieerd als definitiebestand voor Qalculate!: %s." #: ../libqalculate/Calculator.cc:7663 ../libqalculate/DataSet.cc:352 msgid "Object" msgstr "Object" #: ../libqalculate/Calculator.cc:7672 ../libqalculate/DataSet.cc:353 msgid "Property" msgstr "Eigenschap" #: ../libqalculate/Calculator.cc:7965 msgid "column" msgstr "kolom" #: ../libqalculate/Calculator.cc:7968 msgid "Column " msgstr "Kolom " #: ../libqalculate/Calculator.cc:8132 msgid "Failed to download exchange rates from ECB." msgstr "Het ophalen van wisselkoersen van ECB is niet gelukt." #: ../libqalculate/Calculator.cc:8150 msgid "" "It has been more than one week since the exchange rates last were updated." msgstr "" "Het is al meer dan een week geleden dat de wisselkoersen werden ververst." #: ../libqalculate/Calculator.cc:8187 ../libqalculate/Calculator.cc:8201 msgid "Unable to generate plot data with current min, max and sampling rate." msgstr "" "Het is onmogelijk plotgegevens te genereren met de huidige min, max en " "bemonsteringsnelheid." #: ../libqalculate/Calculator.cc:8217 ../libqalculate/Calculator.cc:8231 msgid "Unable to generate plot data with current min, max and step size." msgstr "" "Het is onmogelijk plotgegevens te genereren met de huidige min, max en " "stapgrootte." #: ../libqalculate/Calculator.cc:8280 msgid "No extension in file name. Saving as PNG image." msgstr "" "Geen extensie opgegeven voor bestandsnaam. Wordt opgeslagen als PNG-" "afbeelding." #: ../libqalculate/Calculator.cc:8297 msgid "Unknown extension in file name. Saving as PNG image." msgstr "" "Onbekende extensie in bestandsnaam. Wordt opgeslagen als PNG-afbeelding." #: ../libqalculate/Calculator.cc:8489 #, c-format msgid "Could not create temporary file %s" msgstr "Kon tijdelijk bestand %s niet aanmaken" #: ../libqalculate/Calculator.cc:8525 #, c-format msgid "" "Series %s contains non-numerical data (\"%s\" first of %s) which can not be " "properly plotted." msgstr "" "Rij %s bevat niet-numerieke gegevens (\"%s\" eerste van %s) die niet goed " "kunnen worden geplot." #: ../libqalculate/Calculator.cc:8527 #, c-format msgid "" "Series %s contains non-real data (\"%s\" first of %s) which can not be " "properly plotted." msgstr "" "Rij %s bevat niet-reële gegevens (\"%s\" eerste van %s) die niet goed kunnen " "worden geplot." #: ../libqalculate/Calculator.cc:8552 msgid "" "Failed to invoke gnuplot. Make sure that you have gnuplot installed in your " "path." msgstr "" "Gnuplot aanroepen mislukt. Controleer uw path of gnuplot daarin is te vinden." #: ../libqalculate/DataSet.cc:378 #, c-format msgid "Object %s not available in data set." msgstr "Object %s niet beschikbaar in gegevensverzameling." #: ../libqalculate/DataSet.cc:388 #, c-format msgid "Property %s not available in data set." msgstr "Eigenschap %s niet beschikbaar in gegevensverzameling." #: ../libqalculate/DataSet.cc:393 #, c-format msgid "Property %s not defined for object %s." msgstr "Eigenschap %s niet gedefinieerd voor object %s." #: ../libqalculate/DataSet.cc:476 ../libqalculate/DataSet.cc:484 #, c-format msgid "Unable to load data objects in %s." msgstr "Kon gegevensobjecten in %s niet inlezen." #: ../libqalculate/DataSet.cc:996 msgid "data property" msgstr "eigenschap gegevens" #: ../libqalculate/DataSet.cc:998 msgid "name of a data property" msgstr "naam van een eigenschap van gegevens" #: ../libqalculate/DataSet.cc:1006 ../libqalculate/DataSet.cc:1022 msgid "no properties available" msgstr "geen eigenschappen beschikbaar" #: ../libqalculate/DataSet.cc:1056 #, c-format msgid "" "Data set \"%s\" has no object key that supports the provided argument type." msgstr "" "Gegevensverzameling \"%s\" heeft geen objectsleutel die het opgegeven " "argumenttype ondersteunt." #: ../libqalculate/DataSet.cc:1061 msgid "data object" msgstr "gegevensobject" #: ../libqalculate/DataSet.cc:1063 msgid "an object from" msgstr "een object van" #: ../libqalculate/DataSet.cc:1092 msgid "use" msgstr "gebruik" #: ../libqalculate/MathStructure.cc:92 ../libqalculate/MathStructure.cc:113 #: ../libqalculate/MathStructure.cc:143 #, c-format msgid "To avoid division by zero, the following must be true: %s." msgstr "Om delen door nul te voorkomen moet het volgende waar zijn: %s." #: ../libqalculate/MathStructure.cc:2450 #, c-format msgid "" "The second matrix must have as many rows (was %s) as the first has columns " "(was %s) for matrix multiplication." msgstr "" "Voor het vermenigvuldigen van twee matrices moet het aantal rijen van de " "tweede (was %s) even groot zijn als het aantal kolommen van de eerste (was %" "s)." #. for(size_t i = 0; i < mcopy.size(); i++) { #. std::cout << "MCOPY " << i << ": " << mcopy[i].print() << std::endl; #. for(size_t i2 = 0; i2 < mcopy[i].size(); i2++) { #. std::cout << "MCOPY " << i << "-" << i2 << ": " << mcopy[i][i2].print() << std::endl; #. } #. } #. for(size_t i = 0; i < mcopy2.size(); i++) { #. std::cout << "MCOPY2 " << i << ": " << mcopy2[i].print() << std::endl; #. for(size_t i2 = 0; i2 < mcopy2[i].size(); i2++) { #. std::cout << "MCOPY2 " << i << "-" << i2 << ": " << mcopy2[i][i2].print() << std::endl; #. } #. } #. std::cout << "WRONG! this: " << print() << " copy: " << mcopy.print() << " copy2: " << mcopy2.print() << std::endl; #: ../libqalculate/MathStructure.cc:4980 ../libqalculate/MathStructure.cc:5021 #: ../libqalculate/MathStructure.cc:5054 ../libqalculate/MathStructure.cc:5110 #: ../libqalculate/MathStructure.cc:5130 ../libqalculate/MathStructure.cc:5149 #: ../libqalculate/MathStructure.cc:5168 ../libqalculate/MathStructure.cc:5187 #: ../libqalculate/MathStructure.cc:5276 ../libqalculate/MathStructure.cc:8486 #: ../libqalculate/MathStructure.cc:8497 ../libqalculate/MathStructure.cc:8576 msgid "This is a bug. Please report it." msgstr "Dit is een bug (programmafout). Meld deze alstublieft." #: ../libqalculate/MathStructure.cc:11368 msgid "undefined" msgstr "ongedefinieerd" #: ../libqalculate/MathStructure.cc:11407 #, c-format msgid "Unsolvable comparison at element %s when trying to rank vector." msgstr "" "Vergelijken lukt niet bij element %s bij berekenen van rangvolgorde vector." #: ../libqalculate/MathStructure.cc:11455 #, c-format msgid "Unsolvable comparison at element %s when trying to sort vector." msgstr "Vergelijken lukt niet bij element %s bij sorteren vector." #: ../libqalculate/MathStructure.cc:11880 msgid "The determinant can only be calculated for square matrices." msgstr "De determinant kan alleen voor een vierkante matrix worden berekend." #: ../libqalculate/MathStructure.cc:11943 msgid "The permanent can only be calculated for square matrices." msgstr "De permanent kan alleen voor een vierkante matrix worden berekend." #: ../libqalculate/MathStructure.cc:12032 msgid "Inverse of singular matrix." msgstr "Inverse van singuliere matrix." #: ../libqalculate/Function.cc:113 #, c-format msgid "%s() requires that %s" msgstr "%s() vereist dat %s" #: ../libqalculate/Function.cc:266 ../libqalculate/Function.cc:323 #: ../libqalculate/Function.cc:382 #, c-format msgid "" "Additional arguments for function %s() was ignored. Function can only use %s " "argument(s)." msgstr "" "Overtollige argumenten voor functie %s() werden genegeerd. Functie heeft " "slechts %s argument(en) nodig." #: ../libqalculate/Function.cc:403 #, c-format msgid "You need at least %s argument(s) (%s) in function %s()." msgstr "Er is/zijn minstens %s argument(en) (%s) nodig in functie %s()." #: ../libqalculate/Function.cc:405 #, c-format msgid "You need at least %s argument(s) in function %s()." msgstr "Er is/zijn minstens %s argument(en) nodig in functie %s()." #: ../libqalculate/Function.cc:1096 msgid "a free value" msgstr "een vrije waarde" #: ../libqalculate/Function.cc:1101 msgid "that is nonzero" msgstr "die ongelijk nul is" #: ../libqalculate/Function.cc:1109 msgid "that is rational (polynomial)" msgstr "die rationaal is (polynoom)" #: ../libqalculate/Function.cc:1117 msgid "that fulfills the condition:" msgstr "die aan de conditie voldoet:" #: ../libqalculate/Function.cc:1120 msgid "Argument" msgstr "Argument" #: ../libqalculate/Function.cc:1175 #, c-format msgid "Argument %s in %s() must be %s." msgstr "Argument %s in %s() moet zijn: %s." #: ../libqalculate/Function.cc:1177 #, c-format msgid "Argument %s, %s, in %s() must be %s." msgstr "Argument %s, %s, in %s() moet zijn: %s." #: ../libqalculate/Function.cc:1504 msgid "a rational number" msgstr "een rationaal getal" #: ../libqalculate/Function.cc:1506 msgid "a number" msgstr "een getal" #: ../libqalculate/Function.cc:1508 msgid "a real number" msgstr "een reëel getal" #: ../libqalculate/Function.cc:1513 ../libqalculate/Function.cc:1660 msgid ">=" msgstr ">=" #: ../libqalculate/Function.cc:1515 msgid ">" msgstr ">" #: ../libqalculate/Function.cc:1527 ../libqalculate/Function.cc:1670 msgid "<=" msgstr "<=" #: ../libqalculate/Function.cc:1529 msgid "<" msgstr "<" #: ../libqalculate/Function.cc:1657 msgid "an integer" msgstr "een geheel getal" #: ../libqalculate/Function.cc:1688 msgid "symbol" msgstr "symbool" #: ../libqalculate/Function.cc:1689 msgid "an unknown variable/symbol" msgstr "een onbekend(e) variabele/symbool" #: ../libqalculate/Function.cc:1702 msgid "text" msgstr "tekst" #: ../libqalculate/Function.cc:1703 msgid "a text string" msgstr "een tekenrij" #: ../libqalculate/Function.cc:1718 msgid "date" msgstr "datum" #: ../libqalculate/Function.cc:1719 msgid "a date" msgstr "een datum" #: ../libqalculate/Function.cc:1765 msgid "a vector with " msgstr "een vector met " #: ../libqalculate/Function.cc:1777 msgid "a vector" msgstr "een vector" #: ../libqalculate/Function.cc:1826 msgid "a square matrix" msgstr "een vierkante matrix" #: ../libqalculate/Function.cc:1828 msgid "a matrix" msgstr "een matrix" #: ../libqalculate/Function.cc:1843 msgid "object" msgstr "object" #: ../libqalculate/Function.cc:1844 msgid "a valid function, unit or variable name" msgstr "een geldige naam voor een functie, eenheid of variabele" #: ../libqalculate/Function.cc:1857 msgid "function" msgstr "functie" #: ../libqalculate/Function.cc:1858 msgid "a valid function name" msgstr "een geldige functienaam" #: ../libqalculate/Function.cc:1871 msgid "unit" msgstr "eenheid" #: ../libqalculate/Function.cc:1872 msgid "a valid unit name" msgstr "een geldige naam voor een eenheid" #: ../libqalculate/Function.cc:1885 msgid "variable" msgstr "variabele" #: ../libqalculate/Function.cc:1886 msgid "a valid variable name" msgstr "een geldige naam voor een variabele" #: ../libqalculate/Function.cc:1899 msgid "file" msgstr "bestand" #: ../libqalculate/Function.cc:1900 msgid "a valid file name" msgstr "een geldige bestandsnaam" #: ../libqalculate/Function.cc:1913 msgid "boolean" msgstr "Booleaanse waarde" #: ../libqalculate/Function.cc:1914 msgid "a boolean (0 or 1)" msgstr "een Booleaanse waarde (0 of 1)" #: ../libqalculate/Function.cc:1924 msgid "angle" msgstr "hoek" #: ../libqalculate/Function.cc:1925 msgid "an angle or a number (using the default angle unit)" msgstr "een hoek of een getal (in standaard hoekeenheid)" #: ../libqalculate/Number.cc:127 msgid "" "Cannot display numbers greater than 9999 or less than -9999 as roman " "numerals." msgstr "" "Kan getallen groter dan 9999 of kleiner dan -9999 niet weergeven als " "Romeinse getallen." #: ../libqalculate/Number.cc:215 msgid "" "Assuming the unusual practice of letting a last capital I mean 2 in a roman " "numeral." msgstr "" "Een laatste hoofdletter I in een Romeins getal betekent hier 2, hoewel dit " "ongebruikelijk is." #: ../libqalculate/Number.cc:293 #, c-format msgid "Error in roman numerals: %s." msgstr "Fout in Romeins cijfers: \"%s\"." #: ../libqalculate/Number.cc:328 #, c-format msgid "Unknown roman numeral: %c." msgstr "Onbekend Romeins cijfer: %c." #: ../libqalculate/Number.cc:386 #, c-format msgid "" "Errors in roman numerals: \"%s\". Interpreted as %s, which should be written " "as %s." msgstr "" "Fout in Romeinse cijfers: \"%s\". Geïnterpreteerd als %s, wat als %s zou " "moeten worden geschreven." #: ../libqalculate/Number.cc:471 msgid "':' in decimal number ignored (decimal point detected)." msgstr "':' in decimaal getal genegeerd (decimale komma gevonden)." #: ../libqalculate/Number.cc:487 msgid "Decimal point in sexagesimal number treated as ':'." msgstr "Decimale komma in sexagesimaal getal behandeld als ':'." #: ../libqalculate/Number.cc:505 #, c-format msgid "Character '%c' was ignored in the number \"%s\" with base %s." msgstr "Karakter '%c' werd genegeerd in het getal \"%s\" met grondtal %s." #: ../libqalculate/Number.cc:1427 msgid "Division by zero." msgstr "Deling door nul." #. 0^0 #: ../libqalculate/Number.cc:1433 msgid "0^0 might be considered undefined" msgstr "0^0 kan als ongedefinieerd worden beschouwd" #: ../libqalculate/Number.cc:1732 msgid "Can only handle Riemann Zeta with an integer argument (s) >= 1" msgstr "Voor Riemann-Zeta is een geheel argument (s) >= 1 nodig" #: ../libqalculate/Number.cc:1738 msgid "Cannot handle an argument (s) that large for Riemann Zeta." msgstr "Argument (s) is te groot voor de berekening van Riemann Zeta." #: ../libqalculate/Number.cc:2628 ../libqalculate/Number.cc:2636 #: ../libqalculate/Number.cc:2645 msgid "infinity" msgstr "oneindigheid" #: ../libqalculate/Unit.cc:760 msgid "Error(s) in unitexpression." msgstr "Fout(en) in de eenheidexpressie." #: ../libqalculate/util.cc:559 msgid "Yes" msgstr "Ja" #: ../libqalculate/util.cc:560 msgid "No" msgstr "Nee" #: ../libqalculate/util.cc:567 msgid "True" msgstr "Waar" #: ../libqalculate/util.cc:568 msgid "False" msgstr "Onwaar" #: ../libqalculate/util.cc:575 msgid "On" msgstr "Aan" #: ../libqalculate/util.cc:576 msgid "Off" msgstr "Uit" libqalculate-0.9.7/po/ChangeLog0000644000175100017510000000000011305546371013277 00000000000000libqalculate-0.9.7/po/zh_CN.po0000644000175100017510000014536411305546372013116 00000000000000# translation of zh_CN.po to Simplified Chinese # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Roy Qu , 2007. msgid "" msgstr "" "Project-Id-Version: zh_CN\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-04-02 10:59+0200\n" "PO-Revision-Date: 2007-07-31 15:34+0800\n" "Last-Translator: Roy Qu \n" "Language-Team: Simplified Chinese\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" #: ../src/qalc.cc:94 ../src/qalc.cc:144 ../src/qalc.cc:1686 #: ../src/qalc.cc:1687 ../libqalculate/util.cc:471 msgid "yes" msgstr "yes" #: ../src/qalc.cc:95 ../src/qalc.cc:146 ../src/qalc.cc:1686 #: ../src/qalc.cc:1687 ../libqalculate/util.cc:472 msgid "no" msgstr "no" #: ../src/qalc.cc:96 ../libqalculate/util.cc:479 msgid "true" msgstr "true" #: ../src/qalc.cc:97 ../libqalculate/util.cc:480 msgid "false" msgstr "false" #: ../src/qalc.cc:98 ../src/qalc.cc:610 ../src/qalc.cc:625 ../src/qalc.cc:1230 #: ../src/qalc.cc:1648 ../src/qalc.cc:1650 ../src/qalc.cc:1653 #: ../src/qalc.cc:1654 ../src/qalc.cc:1659 ../src/qalc.cc:1660 #: ../src/qalc.cc:1661 ../src/qalc.cc:1662 ../src/qalc.cc:1664 #: ../src/qalc.cc:1665 ../src/qalc.cc:1666 ../src/qalc.cc:1668 #: ../src/qalc.cc:1669 ../src/qalc.cc:1671 ../src/qalc.cc:1672 #: ../src/qalc.cc:1673 ../src/qalc.cc:1674 ../src/qalc.cc:1675 #: ../src/qalc.cc:1679 ../src/qalc.cc:1681 ../src/qalc.cc:1682 #: ../src/qalc.cc:1683 ../src/qalc.cc:1684 ../src/qalc.cc:1685 #: ../src/qalc.cc:1688 ../src/qalc.cc:1689 ../src/qalc.cc:1690 #: ../src/qalc.cc:1691 ../src/qalc.cc:1692 ../src/qalc.cc:1693 #: ../src/qalc.cc:1694 ../src/qalc.cc:1695 ../src/qalc.cc:1696 #: ../src/qalc.cc:1697 ../libqalculate/util.cc:487 msgid "on" msgstr "on" #: ../src/qalc.cc:99 ../src/qalc.cc:557 ../src/qalc.cc:583 ../src/qalc.cc:595 #: ../src/qalc.cc:608 ../src/qalc.cc:623 ../src/qalc.cc:1218 #: ../src/qalc.cc:1228 ../src/qalc.cc:1250 ../src/qalc.cc:1257 #: ../src/qalc.cc:1272 ../src/qalc.cc:1648 ../src/qalc.cc:1650 #: ../src/qalc.cc:1653 ../src/qalc.cc:1654 ../src/qalc.cc:1659 #: ../src/qalc.cc:1660 ../src/qalc.cc:1661 ../src/qalc.cc:1662 #: ../src/qalc.cc:1664 ../src/qalc.cc:1665 ../src/qalc.cc:1666 #: ../src/qalc.cc:1667 ../src/qalc.cc:1668 ../src/qalc.cc:1669 #: ../src/qalc.cc:1671 ../src/qalc.cc:1672 ../src/qalc.cc:1673 #: ../src/qalc.cc:1674 ../src/qalc.cc:1675 ../src/qalc.cc:1676 #: ../src/qalc.cc:1677 ../src/qalc.cc:1679 ../src/qalc.cc:1681 #: ../src/qalc.cc:1682 ../src/qalc.cc:1683 ../src/qalc.cc:1684 #: ../src/qalc.cc:1685 ../src/qalc.cc:1688 ../src/qalc.cc:1689 #: ../src/qalc.cc:1690 ../src/qalc.cc:1691 ../src/qalc.cc:1692 #: ../src/qalc.cc:1693 ../src/qalc.cc:1694 ../src/qalc.cc:1695 #: ../src/qalc.cc:1696 ../src/qalc.cc:1697 ../libqalculate/util.cc:488 msgid "off" msgstr "off" #: ../src/qalc.cc:149 msgid "Please answer yes or no" msgstr "请回答yes或者no" #: ../src/qalc.cc:156 ../src/qalc.cc:1179 ../src/qalc.cc:1604 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "unknown" msgstr "unknown" #: ../src/qalc.cc:162 ../src/qalc.cc:414 ../src/qalc.cc:445 ../src/qalc.cc:499 #: ../src/qalc.cc:513 ../src/qalc.cc:1137 ../src/qalc.cc:1148 #: ../src/qalc.cc:1183 ../src/qalc.cc:1198 ../src/qalc.cc:1649 #: ../src/qalc.cc:1651 ../src/qalc.cc:1656 ../src/qalc.cc:1658 msgid "none" msgstr "none" #: ../src/qalc.cc:164 ../src/qalc.cc:1176 ../src/qalc.cc:1601 #: ../src/qalc.cc:1704 msgid "non-matrix" msgstr "non-matrix" #: ../src/qalc.cc:166 ../src/qalc.cc:1174 ../src/qalc.cc:1599 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "complex" msgstr "complex" #: ../src/qalc.cc:168 ../src/qalc.cc:1173 ../src/qalc.cc:1598 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "real" msgstr "real" #: ../src/qalc.cc:170 ../src/qalc.cc:1175 ../src/qalc.cc:1600 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 ../libqalculate/Function.cc:1496 msgid "number" msgstr "number" #: ../src/qalc.cc:172 ../src/qalc.cc:1172 ../src/qalc.cc:1597 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "rational" msgstr "rational" #: ../src/qalc.cc:174 ../src/qalc.cc:1171 ../src/qalc.cc:1596 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 ../libqalculate/Function.cc:1651 msgid "integer" msgstr "integer" #: ../src/qalc.cc:176 ../src/qalc.cc:1166 ../src/qalc.cc:1591 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "non-zero" msgstr "non-zero" #: ../src/qalc.cc:178 ../src/qalc.cc:1162 ../src/qalc.cc:1587 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "positive" msgstr "positive" #: ../src/qalc.cc:180 ../src/qalc.cc:1165 ../src/qalc.cc:1590 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "non-negative" msgstr "non-negative" #: ../src/qalc.cc:182 msgid "negatve" msgstr "negatve" #: ../src/qalc.cc:184 ../src/qalc.cc:1163 ../src/qalc.cc:1588 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "non-positive" msgstr "non-positive" #: ../src/qalc.cc:187 msgid "Unrecognized assumption." msgstr "未被承认的假设" #: ../src/qalc.cc:319 ../src/qalc.cc:320 msgid "" "\n" "Press Enter to continue." msgstr "" "\n" "按回车键继续" #: ../src/qalc.cc:328 ../src/qalc.cc:329 ../src/qalc.cc:330 ../src/qalc.cc:429 #: ../src/qalc.cc:432 ../src/qalc.cc:529 ../src/qalc.cc:540 ../src/qalc.cc:549 msgid "Illegal value" msgstr "非法值" #. qalc command #: ../src/qalc.cc:344 ../src/qalc.cc:501 ../src/qalc.cc:1064 #: ../src/qalc.cc:1115 ../src/qalc.cc:1185 ../src/qalc.cc:1188 #: ../src/qalc.cc:1304 ../src/qalc.cc:1656 ../src/qalc.cc:1657 #: ../src/qalc.cc:1740 msgid "base" msgstr "base" #: ../src/qalc.cc:344 ../src/qalc.cc:346 ../src/qalc.cc:1235 #: ../src/qalc.cc:1670 msgid "input base" msgstr "input base" #: ../src/qalc.cc:344 msgid "output base" msgstr "output base" #: ../src/qalc.cc:347 ../src/qalc.cc:1190 ../src/qalc.cc:1237 #: ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "roman" msgstr "roman" #: ../src/qalc.cc:348 ../src/qalc.cc:1192 ../src/qalc.cc:1657 msgid "time" msgstr "time" #: ../src/qalc.cc:349 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "hex" msgstr "hex" #: ../src/qalc.cc:349 msgid "hexadecimal" msgstr "hexadecimal" #: ../src/qalc.cc:350 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "bin" msgstr "bin" #: ../src/qalc.cc:350 msgid "binary" msgstr "binary" #: ../src/qalc.cc:351 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "oct" msgstr "oct" #: ../src/qalc.cc:351 msgid "octal" msgstr "octal" #: ../src/qalc.cc:352 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "dec" msgstr "dec" #: ../src/qalc.cc:352 msgid "decimal" msgstr "decimal" #: ../src/qalc.cc:353 ../src/qalc.cc:1657 msgid "sex" msgstr "sex" #: ../src/qalc.cc:353 ../src/qalc.cc:1191 msgid "sexagesimal" msgstr "sexagesimal" #: ../src/qalc.cc:370 ../src/qalc.cc:412 ../src/qalc.cc:1196 #: ../src/qalc.cc:1658 msgid "base display" msgstr "base display" #: ../src/qalc.cc:374 msgid "Illegal base." msgstr "Illegal base." #: ../src/qalc.cc:382 ../src/qalc.cc:1180 ../src/qalc.cc:1655 msgid "assumptions" msgstr "assumptions" #: ../src/qalc.cc:392 ../src/qalc.cc:1142 ../src/qalc.cc:1650 msgid "all prefixes" msgstr "all prefixes" #: ../src/qalc.cc:393 ../src/qalc.cc:1205 ../src/qalc.cc:1661 msgid "complex numbers" msgstr "complex numbers" #: ../src/qalc.cc:394 ../src/qalc.cc:1215 ../src/qalc.cc:1666 msgid "excessive parenthesis" msgstr "excessive parenthesis" #: ../src/qalc.cc:395 ../src/qalc.cc:1234 ../src/qalc.cc:1669 msgid "functions" msgstr "functions" #: ../src/qalc.cc:396 ../src/qalc.cc:1242 ../src/qalc.cc:1671 msgid "infinite numbers" msgstr "infinite numbers" #: ../src/qalc.cc:397 ../src/qalc.cc:1283 ../src/qalc.cc:1689 msgid "show negative exponents" msgstr "show negative exponents" #: ../src/qalc.cc:398 ../src/qalc.cc:1158 ../src/qalc.cc:1653 msgid "assume nonzero denominators" msgstr "assume nonzero denominators" #: ../src/qalc.cc:399 ../src/qalc.cc:1159 ../src/qalc.cc:1654 msgid "warn nonzero denominators" msgstr "warn nonzero denominators" #: ../src/qalc.cc:400 ../src/qalc.cc:1269 ../src/qalc.cc:1681 msgid "prefixes" msgstr "prefixes" #: ../src/qalc.cc:401 ../src/qalc.cc:1206 ../src/qalc.cc:1662 msgid "denominator prefixes" msgstr "denominator prefixes" #: ../src/qalc.cc:402 ../src/qalc.cc:1267 ../src/qalc.cc:1679 msgid "place units separately" msgstr "place units separately" #: ../src/qalc.cc:403 ../src/qalc.cc:1204 ../src/qalc.cc:1660 msgid "calculate variables" msgstr "calculate variables" #: ../src/qalc.cc:404 ../src/qalc.cc:1203 ../src/qalc.cc:1659 msgid "calculate functions" msgstr "calculate functions" #: ../src/qalc.cc:405 ../src/qalc.cc:1287 ../src/qalc.cc:1693 msgid "sync units" msgstr "sync units" #: ../src/qalc.cc:406 ../src/qalc.cc:1277 ../src/qalc.cc:1683 msgid "round to even" msgstr "round to even" #. qalc command #: ../src/qalc.cc:407 ../src/qalc.cc:1067 ../src/qalc.cc:1278 #: ../src/qalc.cc:1316 ../src/qalc.cc:1684 ../src/qalc.cc:1728 msgid "rpn" msgstr "rpn" #: ../src/qalc.cc:408 ../src/qalc.cc:1279 ../src/qalc.cc:1685 msgid "rpn syntax" msgstr "rpn syntax" #: ../src/qalc.cc:409 ../src/qalc.cc:1284 ../src/qalc.cc:1690 msgid "short multiplication" msgstr "short multiplication" #: ../src/qalc.cc:410 ../src/qalc.cc:1244 ../src/qalc.cc:1674 msgid "lowercase e" msgstr "lowercase e" #: ../src/qalc.cc:411 ../src/qalc.cc:1245 ../src/qalc.cc:1675 msgid "lowercase numbers" msgstr "lowercase numbers" #: ../src/qalc.cc:415 ../src/qalc.cc:1199 ../src/qalc.cc:1658 msgid "normal" msgstr "normal" #: ../src/qalc.cc:416 ../src/qalc.cc:1200 ../src/qalc.cc:1658 msgid "alternative" msgstr "alternative" #: ../src/qalc.cc:421 ../src/qalc.cc:450 ../src/qalc.cc:464 ../src/qalc.cc:478 #: ../src/qalc.cc:492 ../src/qalc.cc:506 ../src/qalc.cc:520 ../src/qalc.cc:567 #: ../src/qalc.cc:576 ../src/qalc.cc:616 ../src/qalc.cc:630 msgid "Illegal value." msgstr "非法数值。" #: ../src/qalc.cc:426 ../src/qalc.cc:1286 ../src/qalc.cc:1692 msgid "spell out logical" msgstr "spell out logical" #: ../src/qalc.cc:427 ../src/qalc.cc:1214 ../src/qalc.cc:1664 msgid "dot as separator" msgstr "dot as separator" #: ../src/qalc.cc:428 ../src/qalc.cc:1243 ../src/qalc.cc:1673 msgid "limit implicit multiplication" msgstr "limit implicit multiplication" #: ../src/qalc.cc:430 ../src/qalc.cc:1285 ../src/qalc.cc:1691 msgid "spacious" msgstr "spacious" #: ../src/qalc.cc:431 ../src/qalc.cc:1288 ../src/qalc.cc:1694 msgid "unicode" msgstr "unicode" #: ../src/qalc.cc:434 ../src/qalc.cc:1289 ../src/qalc.cc:1695 msgid "units" msgstr "units" #: ../src/qalc.cc:435 ../src/qalc.cc:1290 ../src/qalc.cc:1696 msgid "unknowns" msgstr "unknowns" #: ../src/qalc.cc:436 ../src/qalc.cc:1291 ../src/qalc.cc:1697 msgid "variables" msgstr "variables" #: ../src/qalc.cc:437 ../src/qalc.cc:1134 ../src/qalc.cc:1648 msgid "abbreviations" msgstr "abbreviations" #: ../src/qalc.cc:438 ../src/qalc.cc:1282 ../src/qalc.cc:1688 msgid "show ending zeroes" msgstr "show ending zeroes" #: ../src/qalc.cc:439 ../src/qalc.cc:1241 ../src/qalc.cc:1672 msgid "indicate infinite series" msgstr "indicate infinite series" #: ../src/qalc.cc:440 ../src/qalc.cc:1143 ../src/qalc.cc:1651 msgid "angle unit" msgstr "angle unit" #: ../src/qalc.cc:442 ../src/qalc.cc:1145 ../src/qalc.cc:1146 msgid "rad" msgstr "rad" #: ../src/qalc.cc:442 ../src/qalc.cc:1651 msgid "radians" msgstr "radians" #: ../src/qalc.cc:443 msgid "deg" msgstr "deg" #: ../src/qalc.cc:443 ../src/qalc.cc:1651 msgid "degrees" msgstr "degrees" #: ../src/qalc.cc:444 ../src/qalc.cc:1147 msgid "gra" msgstr "gra" #: ../src/qalc.cc:444 ../src/qalc.cc:1651 msgid "gradians" msgstr "gradians" #: ../src/qalc.cc:455 ../src/qalc.cc:1260 ../src/qalc.cc:1678 msgid "multiplication sign" msgstr "multiplication sign" #: ../src/qalc.cc:469 ../src/qalc.cc:1207 ../src/qalc.cc:1663 msgid "division sign" msgstr "division sign" #: ../src/qalc.cc:483 ../src/qalc.cc:1151 ../src/qalc.cc:1652 msgid "approximation" msgstr "近似" #. qalc command #: ../src/qalc.cc:485 ../src/qalc.cc:526 ../src/qalc.cc:609 #: ../src/qalc.cc:1097 ../src/qalc.cc:1153 ../src/qalc.cc:1229 #: ../src/qalc.cc:1307 ../src/qalc.cc:1652 ../src/qalc.cc:1665 #: ../src/qalc.cc:1668 ../src/qalc.cc:1744 msgid "exact" msgstr "exact" #: ../src/qalc.cc:486 ../src/qalc.cc:1154 ../src/qalc.cc:1652 msgid "try exact" msgstr "try exact" #. qalc command #: ../src/qalc.cc:487 ../src/qalc.cc:1103 ../src/qalc.cc:1155 #: ../src/qalc.cc:1302 ../src/qalc.cc:1516 ../src/qalc.cc:1526 #: ../src/qalc.cc:1614 ../src/qalc.cc:1652 ../src/qalc.cc:1748 msgid "approximate" msgstr "approximate" #: ../src/qalc.cc:497 ../src/qalc.cc:1181 ../src/qalc.cc:1656 msgid "autoconversion" msgstr "autoconversion" #: ../src/qalc.cc:500 ../src/qalc.cc:1112 ../src/qalc.cc:1184 #: ../src/qalc.cc:1656 msgid "best" msgstr "best" #: ../src/qalc.cc:511 ../src/qalc.cc:1135 ../src/qalc.cc:1649 msgid "algebra mode" msgstr "algebra mode" #. qalc command #: ../src/qalc.cc:514 ../src/qalc.cc:1126 ../src/qalc.cc:1138 #: ../src/qalc.cc:1319 ../src/qalc.cc:1635 ../src/qalc.cc:1649 msgid "simplify" msgstr "simplify" #: ../src/qalc.cc:515 ../src/qalc.cc:1139 ../src/qalc.cc:1649 msgid "factorize" msgstr "factorize" #: ../src/qalc.cc:537 ../src/qalc.cc:1281 ../src/qalc.cc:1687 msgid "save mode" msgstr "save mode" #: ../src/qalc.cc:546 ../src/qalc.cc:1280 ../src/qalc.cc:1686 msgid "save definitions" msgstr "save definitions" #: ../src/qalc.cc:555 ../src/qalc.cc:1216 ../src/qalc.cc:1667 msgid "exp mode" msgstr "exp mode" #: ../src/qalc.cc:558 ../src/qalc.cc:1219 ../src/qalc.cc:1667 msgid "auto" msgstr "auto" #: ../src/qalc.cc:559 ../src/qalc.cc:1220 ../src/qalc.cc:1667 msgid "pure" msgstr "pure" #: ../src/qalc.cc:560 ../src/qalc.cc:1221 ../src/qalc.cc:1667 msgid "scientific" msgstr "scientific" #: ../src/qalc.cc:561 ../src/qalc.cc:1222 ../src/qalc.cc:1667 msgid "engineering" msgstr "engineering" #: ../src/qalc.cc:572 ../src/qalc.cc:1268 ../src/qalc.cc:1680 msgid "precision" msgstr "precision" #: ../src/qalc.cc:581 ../src/qalc.cc:1246 ../src/qalc.cc:1676 msgid "max decimals" msgstr "max decimals" #: ../src/qalc.cc:593 ../src/qalc.cc:1253 ../src/qalc.cc:1677 msgid "min decimals" msgstr "min decimals" #: ../src/qalc.cc:606 ../src/qalc.cc:1226 ../src/qalc.cc:1668 msgid "fractions" msgstr "fractions" #: ../src/qalc.cc:611 ../src/qalc.cc:1231 ../src/qalc.cc:1668 msgid "combined" msgstr "combined" #: ../src/qalc.cc:621 ../src/qalc.cc:1270 ../src/qalc.cc:1682 msgid "read precision" msgstr "read precision" #: ../src/qalc.cc:624 ../src/qalc.cc:1273 ../src/qalc.cc:1682 msgid "always" msgstr "always" #: ../src/qalc.cc:625 ../src/qalc.cc:1274 ../src/qalc.cc:1682 msgid "when decimals" msgstr "" #: ../src/qalc.cc:649 msgid "Unrecognized option." msgstr "无法识别的选项。" #: ../src/qalc.cc:670 msgid "usage: qalc [options] [expression]" msgstr "用法:qalc [选项] [表达式]" #: ../src/qalc.cc:672 msgid "where options are:" msgstr "可用选项有:" #: ../src/qalc.cc:674 msgid "turn on/off unicode support" msgstr "打开/关闭unicode支持" #: ../src/qalc.cc:675 ../src/qalc.cc:1318 msgid "OPTION" msgstr "选项" #: ../src/qalc.cc:675 ../src/qalc.cc:1318 msgid "VALUE" msgstr "值" #: ../src/qalc.cc:676 msgid "as set command in interactive program session (ex. -set \"base 16\")" msgstr "与在交互编程环境下使用set命令的作用一致 (例如, -set \"base 16\")" #: ../src/qalc.cc:677 msgid "FILE" msgstr "文件" #: ../src/qalc.cc:678 msgid "executes commands from a file first" msgstr "首先执行指定文件中的命令" #: ../src/qalc.cc:680 msgid "reduces output to just the result of the input expression" msgstr "限制输出,仅输出输入表达式的结果" #: ../src/qalc.cc:682 msgid "do not load any functions, units, or variables from file" msgstr "不载入文件中的函数、单位和变量定义" #: ../src/qalc.cc:684 msgid "do not load any global currencies from file" msgstr "不载入文件中的全局货币定义" #: ../src/qalc.cc:686 msgid "do not load any global data sets from file" msgstr "不载入文件中的全局数据集" #: ../src/qalc.cc:688 msgid "do not load any global functions from file" msgstr "不载入文件中的全局函数定义" #: ../src/qalc.cc:690 msgid "do not load any global units from file" msgstr "不载入文件中的全局单位定义" #: ../src/qalc.cc:692 msgid "do not load any global variables from file" msgstr "不载入文件中的全局变量定义" #: ../src/qalc.cc:694 msgid "The program will start in interactive mode if no expression is specified." msgstr "如果未指定表达式,程序将以交互模式启动。" #: ../src/qalc.cc:720 msgid "No option and value specified for set command." msgstr "在set命令中未指定选项或数值。" #: ../src/qalc.cc:728 msgid "No file specified." msgstr "未指定文件。" #: ../src/qalc.cc:780 msgid "" "You need the download exchange rates to be able to convert between different " "currencies.\n" "You can later get current exchange rates with the \"exchange rates\" " "command.\n" "Do you want to fetch exchange rates now from the Internet (default yes)?" msgstr "" "需要先下载汇率,才能进行货币换算。\n" "你可以以后通过\"exchange rates\"命令获取当前汇率。 " "是否现在就从因特网下载汇率?(缺省:是)" #: ../src/qalc.cc:789 msgid "ans" msgstr "ans" #: ../src/qalc.cc:790 ../src/qalc.cc:793 ../src/qalc.cc:794 ../src/qalc.cc:795 #: ../src/qalc.cc:796 ../src/qalc.cc:1006 ../libqalculate/Calculator.cc:7041 msgid "Temporary" msgstr "临时" #: ../src/qalc.cc:790 msgid "Last Answer" msgstr "最后一个答案" #: ../src/qalc.cc:791 msgid "answer" msgstr "answer" #: ../src/qalc.cc:793 msgid "Answer 2" msgstr "答案2" #: ../src/qalc.cc:794 msgid "Answer 3" msgstr "答案3" #: ../src/qalc.cc:795 msgid "Answer 4" msgstr "答案4" #: ../src/qalc.cc:796 msgid "Answer 5" msgstr "答案5" #: ../src/qalc.cc:807 msgid "Failed to load global definitions!" msgstr "载入全局定义失败!" #: ../src/qalc.cc:840 #, c-format msgid "Could not open \"%s\".\n" msgstr "无法打开\"%s\".\n" #: ../src/qalc.cc:859 ../src/qalc.cc:905 ../src/qalc.cc:1783 #, c-format msgid "Illegal character, '%c', in expression." msgstr "在表达式中有非法字符\"%c\"。" #. The qalc command "set" as in "set precision 10". The original text string for commands is kept in addition to the translation. #: ../src/qalc.cc:968 ../src/qalc.cc:1318 ../src/qalc.cc:1639 msgid "set" msgstr "set" #. qalc command #: ../src/qalc.cc:972 ../src/qalc.cc:1317 ../src/qalc.cc:1707 msgid "save" msgstr "save" #: ../src/qalc.cc:972 ../src/qalc.cc:1317 ../src/qalc.cc:1707 msgid "store" msgstr "store" #. qalc command #: ../src/qalc.cc:975 ../src/qalc.cc:1129 ../src/qalc.cc:1315 #: ../src/qalc.cc:1714 msgid "mode" msgstr "mode" #: ../src/qalc.cc:977 msgid "mode saved" msgstr "模式已保存" #: ../src/qalc.cc:979 msgid "definitions" msgstr "definitions" #: ../src/qalc.cc:981 msgid "definitions saved" msgstr "定义已保存" #: ../src/qalc.cc:1028 ../src/qalc.cc:1030 #, c-format msgid "Illegal name. Save as %s instead?" msgstr "非法文件名。是否另存为%s?" #: ../src/qalc.cc:1037 msgid "" "An unit or variable with the same name already exists.\n" "Do you want to overwrite it?" msgstr "" "同名的单位或变量已存在。\n" "您要覆盖它吗?" #. qalc command #: ../src/qalc.cc:1060 ../src/qalc.cc:1303 ../src/qalc.cc:1701 msgid "assume" msgstr "assume" #. qalc command #: ../src/qalc.cc:1070 ../src/qalc.cc:1076 ../src/qalc.cc:1308 #: ../src/qalc.cc:1724 msgid "exrates" msgstr "exrates" #. qalc command #: ../src/qalc.cc:1080 ../src/qalc.cc:1320 ../src/qalc.cc:1736 msgid "stack" msgstr "stack" #: ../src/qalc.cc:1082 msgid "The RPN stack is empty." msgstr "逆波兰范式栈为空。" #. qalc command #: ../src/qalc.cc:1094 ../src/qalc.cc:1305 ../src/qalc.cc:1732 msgid "clear stack" msgstr "clear stack" #. qalc command #: ../src/qalc.cc:1109 ../src/qalc.cc:1306 ../src/qalc.cc:1752 msgid "convert" msgstr "convert" #: ../src/qalc.cc:1109 ../src/qalc.cc:1306 ../src/qalc.cc:1752 msgid "to" msgstr "to" #. qalc command #: ../src/qalc.cc:1123 ../src/qalc.cc:1313 ../src/qalc.cc:1631 msgid "factor" msgstr "factor" #: ../src/qalc.cc:1164 ../src/qalc.cc:1589 ../src/qalc.cc:1655 #: ../src/qalc.cc:1704 msgid "negative" msgstr "negative" #. qalc command #: ../src/qalc.cc:1294 ../src/qalc.cc:1628 msgid "help" msgstr "help" #: ../src/qalc.cc:1296 msgid "Enter a mathematical expression or a command." msgstr "请输入一个数学表达式或命令。" #: ../src/qalc.cc:1298 msgid "Complete functions, units and variables with the tabulator key." msgstr "使用tab键补全函数、命令和单位。" #: ../src/qalc.cc:1300 msgid "Available commands are:" msgstr "候选命令有:" #: ../src/qalc.cc:1303 msgid "ASSUMPTIONS" msgstr "假设" #: ../src/qalc.cc:1304 msgid "BASE" msgstr "BASE" #: ../src/qalc.cc:1306 msgid "UNIT" msgstr "单位" #: ../src/qalc.cc:1310 msgid "WGET ARGUMENTS" msgstr "WGET ARGUMENTS" #: ../src/qalc.cc:1314 ../src/qalc.cc:1326 ../src/qalc.cc:1718 #: ../libqalculate/Calculator.cc:7667 ../libqalculate/DataSet.cc:354 #: ../libqalculate/DataSet.cc:381 ../libqalculate/DataSet.cc:992 msgid "info" msgstr "info" #: ../src/qalc.cc:1316 msgid "ON/OFF" msgstr "ON/OFF" #: ../src/qalc.cc:1317 msgid "NAME" msgstr "名称" #: ../src/qalc.cc:1317 msgid "CATEGORY" msgstr "类别" #: ../src/qalc.cc:1317 msgid "TITLE" msgstr "标题" #. qalc command #: ../src/qalc.cc:1321 ../src/qalc.cc:1765 ../src/qalc.cc:1773 msgid "quit" msgstr "quit" #: ../src/qalc.cc:1321 ../src/qalc.cc:1765 ../src/qalc.cc:1773 msgid "exit" msgstr "exit" #: ../src/qalc.cc:1323 msgid "Type help COMMAND for more help (example: help save)." msgstr "输入help 命令 以获取更多帮助(例如:help save)" #: ../src/qalc.cc:1324 msgid "" "Type info NAME for info about a function, variable or unit (example: info " "sin)." msgstr "输入info 名称 以获取关于函数,变量或单位的信息。(例:info sin)" #: ../src/qalc.cc:1334 msgid "No function, variable or unit with specified name exist." msgstr "找不到指定名称的函数、变量或单位。" #: ../src/qalc.cc:1344 msgid "Function" msgstr "函数" #: ../src/qalc.cc:1371 ../libqalculate/Function.cc:149 msgid "argument" msgstr "argument" #: ../src/qalc.cc:1395 #, c-format msgid "" "Retrieves data from the %s data set for a given object and property. If " "\"info\" is typed as property, all properties of the object will be listed." msgstr "" "从数据集%s中为给定的标量和属性读取数据。如果将\"info\"作为属性,则将会 " "列出对象的全部属性。" #: ../src/qalc.cc:1408 msgid "Arguments" msgstr "自变量" #. optional argument, in description #: ../src/qalc.cc:1425 msgid "optional" msgstr "可选的" #. argument default, in description #: ../src/qalc.cc:1429 msgid "default: " msgstr "缺省:" #: ../src/qalc.cc:1440 msgid "Requirement" msgstr "要求" #: ../src/qalc.cc:1448 msgid "Properties" msgstr "属性" #: ../src/qalc.cc:1463 msgid "key" msgstr "key" #: ../src/qalc.cc:1481 ../src/qalc.cc:1484 msgid "Unit" msgstr "单位" #: ../src/qalc.cc:1487 ../src/qalc.cc:1555 msgid "Names" msgstr "名称" #: ../src/qalc.cc:1505 msgid "Base Unit" msgstr "基准单位" #: ../src/qalc.cc:1512 msgid "Relation" msgstr "关系" #: ../src/qalc.cc:1522 msgid "Inverse Relation" msgstr "反向关系" #: ../src/qalc.cc:1534 msgid "Base Units" msgstr "基准单位" #: ../src/qalc.cc:1549 ../src/qalc.cc:1552 msgid "Variable" msgstr "变量" #: ../src/qalc.cc:1567 msgid "a previous result" msgstr "之前的结果" #: ../src/qalc.cc:1577 ../libqalculate/Function.cc:1820 msgid "matrix" msgstr "matrix" #: ../src/qalc.cc:1579 ../libqalculate/Function.cc:1759 msgid "vector" msgstr "vector" #: ../src/qalc.cc:1606 msgid "default assumptions" msgstr "缺省假设" #: ../src/qalc.cc:1610 msgid "Value" msgstr "值" #: ../src/qalc.cc:1633 msgid "Factorizes the current result." msgstr "因式分解当前结果。" #: ../src/qalc.cc:1637 msgid "Simplifies the current result." msgstr "化简当前结果。" #: ../src/qalc.cc:1644 msgid "Sets the value of an option." msgstr "设置选项的值。" #: ../src/qalc.cc:1646 msgid "Available options and accepted values are:" msgstr "可用的选项以及相应的值有:" #: ../src/qalc.cc:1699 msgid "Example: set base 16." msgstr "例: set base 16." #: ../src/qalc.cc:1703 msgid "Set default assumptions for unknown variables." msgstr "设置关于未知数的缺省假设。" #: ../src/qalc.cc:1709 msgid "" "Saves the current result in a variable with the specified name. You may " "optionally also provide a category (default \"Temporary\") and a title." msgstr "将当前结果保存在指定的变量中。您可以同时为它指定一个类别(缺省为\"临时\")和标题。" #: ../src/qalc.cc:1710 msgid "" "If name equals \"mode\" or \"definitions\", the current mode and " "definitions, respectively, will be saved." msgstr "如果名称等于\"mode\"或\"definitions\",将保存当前模式或定义。" #: ../src/qalc.cc:1712 msgid "Example: store var1." msgstr "例如: store var1." #: ../src/qalc.cc:1716 msgid "Displays the current mode." msgstr "显示当前模式。" #: ../src/qalc.cc:1720 msgid "Displays information about a function, variable or unit." msgstr "显示关于函数,变量或单位的信息。" #: ../src/qalc.cc:1722 msgid "Example: info sin." msgstr "例如: info sin." #: ../src/qalc.cc:1726 msgid "Downloads current exchange rates from the Internet." msgstr "从因特网上下载最新汇率。" #: ../src/qalc.cc:1730 msgid "(De)activates the Reverse Polish Notation mode." msgstr "切换逆波兰范式模式。" #: ../src/qalc.cc:1734 msgid "Clears the RPN stack." msgstr "清空逆波兰范式(RPN)栈" #: ../src/qalc.cc:1738 msgid "Displays the RPN stack." msgstr "显示逆波兰范式(RPN)栈" #: ../src/qalc.cc:1742 msgid "Sets the result base (equivalent to set base)." msgstr "设置结果base(相当于set base)" #: ../src/qalc.cc:1746 msgid "Equivalent to set approximation exact." msgstr "相当于set approximation exact" #: ../src/qalc.cc:1750 msgid "Equivalent to set approximation try exact." msgstr "相当于set approximation try exact." #: ../src/qalc.cc:1754 msgid "Converts units in current result." msgstr "为当前结果换算单位" #: ../src/qalc.cc:1756 msgid "Possible unit values are:" msgstr "可用的单位值有:" #: ../src/qalc.cc:1758 msgid "a unit (example meter)" msgstr "一个单位(例如: 米)" #: ../src/qalc.cc:1759 msgid "a unit expression (example km/h)" msgstr "一个单位表达式 (例如 km/h)" #: ../src/qalc.cc:1760 msgid "base (convert to base units)" msgstr "base (转换为基准单位)" #: ../src/qalc.cc:1761 msgid "best (convert best unit)" msgstr "best (转换为最佳单位)" #: ../src/qalc.cc:1763 msgid "Example: convert best." msgstr "例:convert best" #: ../src/qalc.cc:1767 msgid "Terminates this program." msgstr "结束此程序。" #: ../src/qalc.cc:1818 msgid "error" msgstr "错误" #: ../src/qalc.cc:1820 msgid "warning" msgstr "警告" #: ../src/qalc.cc:1879 ../libqalculate/Calculator.cc:182 #: ../libqalculate/Calculator.cc:183 ../libqalculate/Calculator.cc:188 #: ../libqalculate/Calculator.cc:2133 msgid "aborted" msgstr "已终止" #: ../src/qalc.cc:1908 msgid "RPN Register Moved" msgstr "逆波兰范式寄存器已被移动" #: ../src/qalc.cc:1947 msgid "Processing (press Enter to abort)" msgstr "正在处理(按回车键终止)" #: ../src/qalc.cc:2010 msgid "approx." msgstr "约" #: ../src/qalc.cc:2116 msgid "Factorizing (press Enter to abort)" msgstr "正在分解因式(按回车键终止)" #: ../src/qalc.cc:2120 msgid "Simplifying (press Enter to abort)" msgstr "正在化简(按回车键终止)" #: ../src/qalc.cc:2315 msgid "Calculating (press Enter to abort)" msgstr "正在计算(按回车键终止)" #: ../src/qalc.cc:2371 msgid "RPN Operation" msgstr "(RPN)逆波兰范式操作" #: ../src/qalc.cc:2669 #, c-format msgid "" "Couldn't write preferences to\n" "%s" msgstr "" "无法将偏好设置写入\n" "%s" #: ../src/qalc.cc:2743 msgid "Couldn't write definitions" msgstr "无法写定义" #: ../libqalculate/BuiltinFunctions.cc:54 #, c-format msgid "Too many elements (%s) for the dimensions (%sx%s) of the matrix." msgstr "%s个元素对于%s X %s的矩阵而言太多。" #: ../libqalculate/BuiltinFunctions.cc:116 #: ../libqalculate/BuiltinFunctions.cc:176 #, c-format msgid "Row %s does not exist in matrix." msgstr "在矩阵中不存在行%s。" #: ../libqalculate/BuiltinFunctions.cc:129 #: ../libqalculate/BuiltinFunctions.cc:172 #, c-format msgid "Column %s does not exist in matrix." msgstr "在矩阵中不存在列%s。" #: ../libqalculate/BuiltinFunctions.cc:187 #, c-format msgid "Argument 3, %s, is ignored for vectors." msgstr "已为向量忽略了参数3, %s。" #: ../libqalculate/BuiltinFunctions.cc:191 #: ../libqalculate/BuiltinFunctions.cc:212 #, c-format msgid "Element %s does not exist in vector." msgstr "在向量中不存在元素%s。" #: ../libqalculate/BuiltinFunctions.cc:400 #, c-format msgid "%s() does at the moment only support integers and fractions of two." msgstr "%s目前只支持整数和2的分数。" #: ../libqalculate/BuiltinFunctions.cc:2018 #: ../libqalculate/BuiltinFunctions.cc:2061 #, c-format msgid "Unsolvable comparison in %s()." msgstr "在%s()中无法进行比较。" #: ../libqalculate/BuiltinFunctions.cc:2152 #: ../libqalculate/BuiltinFunctions.cc:2172 #: ../libqalculate/BuiltinFunctions.cc:2196 ../libqalculate/util.cc:73 #: ../libqalculate/util.cc:120 ../libqalculate/util.cc:140 #: ../libqalculate/util.cc:160 msgid "today" msgstr "today" #: ../libqalculate/BuiltinFunctions.cc:2191 ../libqalculate/util.cc:76 #: ../libqalculate/util.cc:123 ../libqalculate/util.cc:143 #: ../libqalculate/util.cc:163 msgid "now" msgstr "now" #: ../libqalculate/BuiltinFunctions.cc:2207 #, c-format msgid "The timestamp value for the date %s is too large or small for %s()." msgstr "对于函数%s而言,时间戳%s的值太大或太小。" #: ../libqalculate/BuiltinFunctions.cc:2250 #: ../libqalculate/BuiltinFunctions.cc:2271 #, c-format msgid "Error in date format for function %s()." msgstr "函数%s()的日期格式错误。" #: ../libqalculate/BuiltinFunctions.cc:2525 msgid "" "The number of requested elements in generate vector function must be a " "positive integer." msgstr "在常规向量函数中,需求的元素个数必须为正整数。" #: ../libqalculate/BuiltinFunctions.cc:2819 #: ../libqalculate/BuiltinFunctions.cc:2836 msgid "Comparison failed." msgstr "比较失败。" #: ../libqalculate/BuiltinFunctions.cc:2824 #: ../libqalculate/BuiltinFunctions.cc:2854 msgid "No matching item found." msgstr "未能找到匹配项。" #: ../libqalculate/BuiltinFunctions.cc:2914 #, c-format msgid "Object %s does not exist." msgstr "对象%s不存在。" #: ../libqalculate/BuiltinFunctions.cc:2941 #, c-format msgid "Register %s does not exist. Returning zero." msgstr "寄存器%s不存在。返回零。" #: ../libqalculate/BuiltinFunctions.cc:2999 msgid "Both the lower and upper limit must be set to get the definite integral." msgstr "必须同时设置积分上下限,才能获得定积分。" #: ../libqalculate/BuiltinFunctions.cc:3134 msgid "" "No equality or inequality to solve. The entered expression to solve is not " "correct (ex. \"x + 5 = 3\" is correct)" msgstr "无法解等式或不等式。 输入的表达式不正确(例如:\"x + 5 = 3\"是正确的)" #: ../libqalculate/BuiltinFunctions.cc:3181 #, c-format msgid "The comparison is true for all %s (with current assumptions)." msgstr "" "此比较对所有%s为真。 " "(按照目前的假设)" #: ../libqalculate/BuiltinFunctions.cc:3185 msgid "No possible solution was found (with current assumptions)." msgstr "" "未找到可行解。 " "(按照目前的假设)" #: ../libqalculate/BuiltinFunctions.cc:3189 #, c-format msgid "Was unable to completely isolate %s." msgstr "无法完成分离%s/" #: ../libqalculate/BuiltinFunctions.cc:3193 #: ../libqalculate/BuiltinFunctions.cc:3321 #: ../libqalculate/BuiltinFunctions.cc:3416 #, c-format msgid "The comparison is true for all %s if %s." msgstr "此比较对所有%s为真,如果%s。" #: ../libqalculate/BuiltinFunctions.cc:3197 #, c-format msgid "Was unable to isolate %s." msgstr "无法分离%s。" #: ../libqalculate/BuiltinFunctions.cc:3280 #: ../libqalculate/BuiltinFunctions.cc:3307 #: ../libqalculate/BuiltinFunctions.cc:3390 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed sign was " "therefor temporarily set as unknown." msgstr "" "按照当前的假设条件无法分离%s。 " "因此,假设符号暂时已被设成了未知。" #: ../libqalculate/BuiltinFunctions.cc:3283 #: ../libqalculate/BuiltinFunctions.cc:3310 #: ../libqalculate/BuiltinFunctions.cc:3393 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed type and " "sign was therefor temporarily set as unknown." msgstr "" "按照当前的假设条件无法分离%s。 " "因此,假设类型和符号暂时都已被设成了未知。" #: ../libqalculate/BuiltinFunctions.cc:3316 #: ../libqalculate/BuiltinFunctions.cc:3401 #, c-format msgid "The solution requires that %s." msgstr "解需要%s。" #: ../libqalculate/BuiltinFunctions.cc:3409 #, c-format msgid "Solution %s requires that %s." msgstr "解%s需要%s。" #: ../libqalculate/BuiltinFunctions.cc:3477 #, c-format msgid "" "Unable to isolate %s.\n" "\n" "You might need to place the equations and variables in an appropriate order " "so that so that each equation at least contains the corresponding variable " "(if automatic reordering failed)." msgstr "" "无法分离%s。\n" "\n" "您可能需要按照正确的顺序排列等式和变量,这样每个等式都至少包含一个对应变量。 " "(如果自动排序失败的话)。" #: ../libqalculate/BuiltinFunctions.cc:3479 #: ../libqalculate/BuiltinFunctions.cc:3493 #: ../libqalculate/BuiltinFunctions.cc:3502 #, c-format msgid "Unable to isolate %s." msgstr "无法分离%s。" #: ../libqalculate/BuiltinFunctions.cc:3486 #, c-format msgid "Inequalities is not allowed in %s()." msgstr "在%s中不允许不等式。" #: ../libqalculate/Calculator.cc:277 msgid "per" msgstr "per" #: ../libqalculate/Calculator.cc:279 msgid "times" msgstr "times" #: ../libqalculate/Calculator.cc:281 msgid "plus" msgstr "plus" #: ../libqalculate/Calculator.cc:283 msgid "minus" msgstr "minus" #: ../libqalculate/Calculator.cc:285 ../libqalculate/MathStructure.cc:11276 #: ../libqalculate/Function.cc:1106 ../libqalculate/Function.cc:1114 #: ../libqalculate/Function.cc:1520 ../libqalculate/Function.cc:1664 msgid "and" msgstr "and" #: ../libqalculate/Calculator.cc:289 ../libqalculate/DataSet.cc:1026 #: ../libqalculate/DataSet.cc:1089 ../libqalculate/MathStructure.cc:11290 #: ../libqalculate/Function.cc:1974 ../libqalculate/Function.cc:1990 msgid "or" msgstr "or" #: ../libqalculate/Calculator.cc:319 ../libqalculate/Calculator.cc:1038 #: ../libqalculate/Calculator.cc:2141 ../libqalculate/Calculator.cc:2142 msgid " to " msgstr " to " #: ../libqalculate/Calculator.cc:391 msgid "Gradians unit is missing. Creating one for this session." msgstr "梯度单位丢失。自动为本会话创建了一个。" #: ../libqalculate/Calculator.cc:392 ../libqalculate/Calculator.cc:400 #: ../libqalculate/Calculator.cc:408 msgid "Angle/Plane Angle" msgstr "角/平面角" #: ../libqalculate/Calculator.cc:399 msgid "Radians unit is missing. Creating one for this session." msgstr "弧度单位丢失。自动为本会话创建了一个。" #: ../libqalculate/Calculator.cc:407 msgid "Degrees unit is missing. Creating one for this session." msgstr "角度单位丢失。自动为本会话创建了一个。" #: ../libqalculate/Calculator.cc:1364 ../libqalculate/Calculator.cc:8048 msgid "Currency" msgstr "货币" #: ../libqalculate/Calculator.cc:2104 msgid "calculating..." msgstr "正在计算" #: ../libqalculate/Calculator.cc:2230 msgid "timed out" msgstr "已超时" #: ../libqalculate/Calculator.cc:3131 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name of \"%s\", or " "the variable will be lost." msgstr "在名称中不再允许使用\"%s\"。请修改名称\"%s\",否则此变量将消失。" #: ../libqalculate/Calculator.cc:3148 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the function will be lost." msgstr "在名称中不再允许使用\"%s\"。请修改名称\"%s\",否则此函数将消失。" #: ../libqalculate/Calculator.cc:3164 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the unit will be lost." msgstr "在名称中不再允许使用\"%s\"。请修改名称\"%s\",否则此单位将消失。" #: ../libqalculate/Calculator.cc:4143 ../libqalculate/Calculator.cc:4789 #: ../libqalculate/Calculator.cc:4801 ../libqalculate/Calculator.cc:4826 #: ../libqalculate/Calculator.cc:4852 #, c-format msgid "Misplaced operator(s) \"%s\" ignored" msgstr "已忽略放错地方的运算符\"%s\"。" #: ../libqalculate/Calculator.cc:4167 ../libqalculate/Calculator.cc:4876 #, c-format msgid "Misplaced '%c' ignored" msgstr "已忽略放错地方的\"%c\"。" #: ../libqalculate/Calculator.cc:4194 ../libqalculate/Function.cc:1250 #: ../libqalculate/Function.cc:1281 #, c-format msgid "Internal id %s does not exist." msgstr "内部id %s不存在。" #: ../libqalculate/Calculator.cc:4212 #, c-format msgid "\"%s\" is not a valid variable/function/unit." msgstr "\"%s\"不是合法的变量/函数/单位。" #: ../libqalculate/Calculator.cc:4227 #, c-format msgid "" "Trailing characters \"%s\" (not a valid variable/function/unit) in number \"%" "s\" was ignored." msgstr "尾部字符\"%s\"(不是合法的变量/函数/单位) in 数字\"%s\"已被忽略。" #: ../libqalculate/Calculator.cc:4617 msgid "RPN syntax error. Values left at the end of the RPN expression." msgstr "RPN语法错误。在逆波兰表达式的最后剩下了数值。" #: ../libqalculate/Calculator.cc:4620 msgid "Unused stack values." msgstr "栈内还有值未被使用。" #: ../libqalculate/Calculator.cc:4682 msgid "RPN syntax error. Stack is empty." msgstr "RPN语法错误。栈内是空的。" #: ../libqalculate/Calculator.cc:4684 msgid "RPN syntax error. Operator ignored as there where only one stack value." msgstr "RPN语法错误。栈内只有一个值,因此运算符已被忽略。" #: ../libqalculate/Calculator.cc:5043 #, c-format msgid "Name \"%s\" is in use. Replacing with \"%s\"." msgstr "名称\"%s\"已被使用。替换为\"%s\"。" #: ../libqalculate/Calculator.cc:5702 ../libqalculate/DataSet.cc:498 #, c-format msgid "File not identified as Qalculate! definitions file: %s." msgstr "" "指定的文件无法被Qalculate!识别! " "定义文件:%s。" #: ../libqalculate/Calculator.cc:7650 ../libqalculate/DataSet.cc:352 msgid "Object" msgstr "对象" #: ../libqalculate/Calculator.cc:7659 ../libqalculate/DataSet.cc:353 msgid "Property" msgstr "属性" #: ../libqalculate/Calculator.cc:7952 msgid "column" msgstr "column" #: ../libqalculate/Calculator.cc:7955 msgid "Column " msgstr "列" #: ../libqalculate/Calculator.cc:8119 msgid "Failed to download exchange rates from ECB." msgstr "从ECB下载汇率失败。" #: ../libqalculate/Calculator.cc:8137 msgid "It has been more than one week since the exchange rates last were updated." msgstr "距离最后一次汇率更新已超过一周了。" #: ../libqalculate/Calculator.cc:8174 ../libqalculate/Calculator.cc:8188 msgid "Unable to generate plot data with current min, max and sampling rate." msgstr "按照当前的最大、最小和采样率,无法生成绘图数据。" #: ../libqalculate/Calculator.cc:8204 ../libqalculate/Calculator.cc:8218 msgid "Unable to generate plot data with current min, max and step size." msgstr "按照当前的最大、最小和步长,无法生成绘图数据。" #: ../libqalculate/Calculator.cc:8267 msgid "No extension in file name. Saving as PNG image." msgstr "未指定文件扩展名。保存为PNG图像。" #: ../libqalculate/Calculator.cc:8284 msgid "Unknown extension in file name. Saving as PNG image." msgstr "未知的文件扩展名。保存为PNG图像。" #: ../libqalculate/Calculator.cc:8476 #, c-format msgid "Could not create temporary file %s" msgstr "无法创建临时文件%s" #: ../libqalculate/Calculator.cc:8512 #, c-format msgid "" "Series %s contains non-numerical data (\"%s\" first of %s) which can not be " "properly plotted." msgstr "序列%s中包含无法被正确绘制的非数字型数据(\"%s\"first of %s)。" #: ../libqalculate/Calculator.cc:8514 #, c-format msgid "" "Series %s contains non-real data (\"%s\" first of %s) which can not be " "properly plotted." msgstr "序列%s中包含无法被正确绘制的非实数数据(\"%s\"first of %s)。" #: ../libqalculate/Calculator.cc:8539 msgid "" "Failed to invoke gnuplot. Make sure that you have gnuplot installed in your " "path." msgstr "调用gnuplot失败。请确认在您的路径中包含gnuplot。" #: ../libqalculate/DataSet.cc:378 #, c-format msgid "Object %s not available in data set." msgstr "数据集中没有对象%s。" #: ../libqalculate/DataSet.cc:388 #, c-format msgid "Property %s not available in data set." msgstr "数据集中没有属性%s。" #: ../libqalculate/DataSet.cc:393 #, c-format msgid "Property %s not defined for object %s." msgstr "属性%s在对象%s中没有定义。" #: ../libqalculate/DataSet.cc:476 ../libqalculate/DataSet.cc:484 #, c-format msgid "Unable to load data objects in %s." msgstr "无法从%s中载入数据。" #: ../libqalculate/DataSet.cc:996 msgid "data property" msgstr "data property" #: ../libqalculate/DataSet.cc:998 msgid "name of a data property" msgstr "数据属性的名称" #: ../libqalculate/DataSet.cc:1006 ../libqalculate/DataSet.cc:1022 msgid "no properties available" msgstr "没有可用的属性" #: ../libqalculate/DataSet.cc:1056 #, c-format msgid "Data set \"%s\" has no object key that supports the provided argument type." msgstr "数据集\"%s\"中没有支持所提供的参数类型的对象关键字。" #: ../libqalculate/DataSet.cc:1061 msgid "data object" msgstr "data object" #: ../libqalculate/DataSet.cc:1063 msgid "an object from" msgstr "来自于...的对象" #: ../libqalculate/DataSet.cc:1092 msgid "use" msgstr "use" #: ../libqalculate/MathStructure.cc:92 ../libqalculate/MathStructure.cc:113 #: ../libqalculate/MathStructure.cc:143 #, c-format msgid "To avoid division by zero, the following must be true: %s." msgstr "为了避免被零,必须满足:%s。" #: ../libqalculate/MathStructure.cc:2450 #, c-format msgid "" "The second matrix must have as many rows (was %s) as the first has columns " "(was %s) for matrix multiplication." msgstr "在矩阵乘法中,第二个向量的列数(%s)必须与第一个向量的行数(%s)相同。" #. for(size_t i = 0; i < mcopy.size(); i++) { #. std::cout << "MCOPY " << i << ": " << mcopy[i].print() << std::endl; #. for(size_t i2 = 0; i2 < mcopy[i].size(); i2++) { #. std::cout << "MCOPY " << i << "-" << i2 << ": " << mcopy[i][i2].print() << std::endl; #. } #. } #. for(size_t i = 0; i < mcopy2.size(); i++) { #. std::cout << "MCOPY2 " << i << ": " << mcopy2[i].print() << std::endl; #. for(size_t i2 = 0; i2 < mcopy2[i].size(); i2++) { #. std::cout << "MCOPY2 " << i << "-" << i2 << ": " << mcopy2[i][i2].print() << std::endl; #. } #. } #. std::cout << "WRONG! this: " << print() << " copy: " << mcopy.print() << " copy2: " << mcopy2.print() << std::endl; #: ../libqalculate/MathStructure.cc:4974 ../libqalculate/MathStructure.cc:5015 #: ../libqalculate/MathStructure.cc:5048 ../libqalculate/MathStructure.cc:5104 #: ../libqalculate/MathStructure.cc:5124 ../libqalculate/MathStructure.cc:5143 #: ../libqalculate/MathStructure.cc:5162 ../libqalculate/MathStructure.cc:5181 #: ../libqalculate/MathStructure.cc:5270 ../libqalculate/MathStructure.cc:8488 #: ../libqalculate/MathStructure.cc:8499 ../libqalculate/MathStructure.cc:8578 msgid "This is a bug. Please report it." msgstr "这是个bug。请想我们报告它。" #: ../libqalculate/MathStructure.cc:11370 msgid "undefined" msgstr "undefined" #: ../libqalculate/MathStructure.cc:11409 #, c-format msgid "Unsolvable comparison at element %s when trying to rank vector." msgstr "" #: ../libqalculate/MathStructure.cc:11457 #, c-format msgid "Unsolvable comparison at element %s when trying to sort vector." msgstr "试图为向量排序,但无法比较元素%s。" #: ../libqalculate/MathStructure.cc:11882 msgid "The determinant can only be calculated for square matrices." msgstr "只能为方阵计算行列式" #: ../libqalculate/MathStructure.cc:11945 msgid "The permanent can only be calculated for square matrices." msgstr "只能为方阵计算不变积和式" #: ../libqalculate/MathStructure.cc:12034 msgid "Inverse of singular matrix." msgstr "奇异矩阵的逆。" #: ../libqalculate/Function.cc:113 #, c-format msgid "%s() requires that %s" msgstr "%s()需要%s。" #: ../libqalculate/Function.cc:266 ../libqalculate/Function.cc:323 #: ../libqalculate/Function.cc:382 #, c-format msgid "" "Additional arguments for function %s() was ignored. Function can only use %s " "argument(s)." msgstr "已忽略函数%s的多余参数。它只需要%s个参数。" #: ../libqalculate/Function.cc:403 #, c-format msgid "You need at least %s argument(s) (%s) in function %s()." msgstr "你需要至少%s个参数(%s)提供给函数%s()" #: ../libqalculate/Function.cc:405 #, c-format msgid "You need at least %s argument(s) in function %s()." msgstr "你需要至少%s个参数提供给函数%s()" #: ../libqalculate/Function.cc:1096 msgid "a free value" msgstr "一个自由量" #: ../libqalculate/Function.cc:1101 msgid "that is nonzero" msgstr "非零" #: ../libqalculate/Function.cc:1109 msgid "that is rational (polynomial)" msgstr "合理的(多项式的)" #: ../libqalculate/Function.cc:1117 msgid "that fulfills the condition:" msgstr "满足下列条件:" #: ../libqalculate/Function.cc:1172 #, c-format msgid "Argument %s in %s() must be %s." msgstr "参数%s, 在%s()中必须为%s。" #: ../libqalculate/Function.cc:1174 #, c-format msgid "Argument %s, %s, in %s() must be %s." msgstr "参数%s,%s, 在%s()中必须为%s。" #: ../libqalculate/Function.cc:1501 msgid "a rational number" msgstr "一个有理数" #: ../libqalculate/Function.cc:1503 msgid "a number" msgstr "一个数" #: ../libqalculate/Function.cc:1505 msgid "a real number" msgstr "一个实数" #: ../libqalculate/Function.cc:1510 ../libqalculate/Function.cc:1657 msgid ">=" msgstr ">=" #: ../libqalculate/Function.cc:1512 msgid ">" msgstr ">" #: ../libqalculate/Function.cc:1524 ../libqalculate/Function.cc:1667 msgid "<=" msgstr "<=" #: ../libqalculate/Function.cc:1526 msgid "<" msgstr "<" #: ../libqalculate/Function.cc:1654 msgid "an integer" msgstr "一个整数" #: ../libqalculate/Function.cc:1685 msgid "symbol" msgstr "symbol" #: ../libqalculate/Function.cc:1686 msgid "an unknown variable/symbol" msgstr "一个未知变量或符号" #: ../libqalculate/Function.cc:1699 msgid "text" msgstr "text" #: ../libqalculate/Function.cc:1700 msgid "a text string" msgstr "一段文字" #: ../libqalculate/Function.cc:1715 msgid "date" msgstr "date" #: ../libqalculate/Function.cc:1716 msgid "a date" msgstr "一个日期" #: ../libqalculate/Function.cc:1762 msgid "a vector with " msgstr "一个向量with" #: ../libqalculate/Function.cc:1774 msgid "a vector" msgstr "一个向量" #: ../libqalculate/Function.cc:1823 msgid "a square matrix" msgstr "一个方阵" #: ../libqalculate/Function.cc:1825 msgid "a matrix" msgstr "一个矩阵" #: ../libqalculate/Function.cc:1840 msgid "object" msgstr "object" #: ../libqalculate/Function.cc:1841 msgid "a valid function, unit or variable name" msgstr "一个合法的函数、单位或函数名" #: ../libqalculate/Function.cc:1854 msgid "function" msgstr "function" #: ../libqalculate/Function.cc:1855 msgid "a valid function name" msgstr "一个合法的函数名" #: ../libqalculate/Function.cc:1868 msgid "unit" msgstr "unit" #: ../libqalculate/Function.cc:1869 msgid "a valid unit name" msgstr "一个合法的单位名" #: ../libqalculate/Function.cc:1882 msgid "variable" msgstr "variable" #: ../libqalculate/Function.cc:1883 msgid "a valid variable name" msgstr "一个合法的变量名" #: ../libqalculate/Function.cc:1896 msgid "file" msgstr "file" #: ../libqalculate/Function.cc:1897 msgid "a valid file name" msgstr "一个合法的文件名" #: ../libqalculate/Function.cc:1910 msgid "boolean" msgstr "boolean" #: ../libqalculate/Function.cc:1911 msgid "a boolean (0 or 1)" msgstr "一个逻辑量(0或者1)" #: ../libqalculate/Function.cc:1921 msgid "angle" msgstr "angle" #: ../libqalculate/Function.cc:1922 msgid "an angle or a number (using the default angle unit)" msgstr "一个角度或者数字(使用缺省角度单位)" #: ../libqalculate/Number.cc:127 msgid "" "Cannot display numbers greater than 9999 or less than -9999 as roman " "numerals." msgstr "无法显示大于9999或小于-9999的罗马数字。" #: ../libqalculate/Number.cc:215 msgid "" "Assuming the unusual practice of letting a last capital I mean 2 in a roman " "numeral." msgstr "假设一种不常见的情况:在罗马数字中,最后一个大写的\"I\"表示2。" #: ../libqalculate/Number.cc:293 #, c-format msgid "Error in roman numerals: %s." msgstr "在罗马数字中有错:\"%s\"" #: ../libqalculate/Number.cc:328 #, c-format msgid "Unknown roman numeral: %c." msgstr "不认识的罗马数字:\"%c\"" #: ../libqalculate/Number.cc:386 #, c-format msgid "" "Errors in roman numerals: \"%s\". Interpreted as %s, which should be written " "as %s." msgstr "罗马数字中有错误:\"%s\"。已被翻译成\"%s\",它正确的写法是\"%s\"。" #: ../libqalculate/Number.cc:471 msgid "':' in decimal number ignored (decimal point detected)." msgstr "十进制数中的\":\"被忽略。(已发现小数点)" #: ../libqalculate/Number.cc:487 msgid "Decimal point in sexagesimal number treated as ':'." msgstr "六十进制数中的小数点被处理为\":\"" #: ../libqalculate/Number.cc:505 #, c-format msgid "Character '%c' was ignored in the number \"%s\" with base %s." msgstr "字符\"%c\"被忽略,在数字\"%s\"中,其base为\"%s\"。" #: ../libqalculate/Number.cc:1427 msgid "Division by zero." msgstr "被零除。" #. 0^0 #: ../libqalculate/Number.cc:1433 msgid "0^0 might be considered undefined" msgstr "0^0将被当成未定义量处理" #: ../libqalculate/Number.cc:1732 msgid "Can only handle Riemann Zeta with an integer argument (s) >= 1" msgstr "只能处理参数为大于等于1的正整数的黎曼Zeta函数" #: ../libqalculate/Number.cc:1738 msgid "Cannot handle an argument (s) that large for Riemann Zeta." msgstr "无法处理对于黎曼Zeta函数来说太大的参数" #: ../libqalculate/Number.cc:2593 ../libqalculate/Number.cc:2601 #: ../libqalculate/Number.cc:2610 msgid "infinity" msgstr "infinity" #: ../libqalculate/Unit.cc:760 msgid "Error(s) in unitexpression." msgstr "单位表达式里有错。" #: ../libqalculate/util.cc:468 msgid "Yes" msgstr "Yes" #: ../libqalculate/util.cc:469 msgid "No" msgstr "No" #: ../libqalculate/util.cc:476 msgid "True" msgstr "True" #: ../libqalculate/util.cc:477 msgid "False" msgstr "False" #: ../libqalculate/util.cc:484 msgid "On" msgstr "On" #: ../libqalculate/util.cc:485 msgid "Off" msgstr "Off" libqalculate-0.9.7/po/POTFILES.in0000644000175100017510000000056111305546372013317 00000000000000# List of source files containing translatable strings. [encoding: UTF-8] src/qalc.cc libqalculate/BuiltinFunctions.cc libqalculate/Calculator.cc libqalculate/DataSet.cc libqalculate/ExpressionItem.cc libqalculate/MathStructure.cc libqalculate/Function.cc libqalculate/Number.cc libqalculate/Prefix.cc libqalculate/Unit.cc libqalculate/Variable.cc libqalculate/util.cc libqalculate-0.9.7/po/Makefile.in.in0000644000175100017510000001532311320655025014207 00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libqalculate-0.9.7/po/sv.po0000644000175100017510000015352711305546372012545 00000000000000# translation of sv.po to Swedish # This file is distributed under the same license as the PACKAGE package. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. # Niklas Knutsson , 2003. # msgid "" msgstr "" "Project-Id-Version: sv\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-05-08 14:48+0200\n" "PO-Revision-Date: 2006-05-04 12:29+0200\n" "Last-Translator: Niklas Knutsson \n" "Language-Team: Swedish\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/qalc.cc:94 ../src/qalc.cc:144 ../src/qalc.cc:1686 #: ../src/qalc.cc:1687 ../libqalculate/util.cc:562 msgid "yes" msgstr "ja" #: ../src/qalc.cc:95 ../src/qalc.cc:146 ../src/qalc.cc:1686 #: ../src/qalc.cc:1687 ../libqalculate/util.cc:563 msgid "no" msgstr "nej" #: ../src/qalc.cc:96 ../libqalculate/util.cc:570 msgid "true" msgstr "sant" #: ../src/qalc.cc:97 ../libqalculate/util.cc:571 msgid "false" msgstr "falskt" #: ../src/qalc.cc:98 ../src/qalc.cc:610 ../src/qalc.cc:625 ../src/qalc.cc:1230 #: ../src/qalc.cc:1648 ../src/qalc.cc:1650 ../src/qalc.cc:1653 #: ../src/qalc.cc:1654 ../src/qalc.cc:1659 ../src/qalc.cc:1660 #: ../src/qalc.cc:1661 ../src/qalc.cc:1662 ../src/qalc.cc:1664 #: ../src/qalc.cc:1665 ../src/qalc.cc:1666 ../src/qalc.cc:1668 #: ../src/qalc.cc:1669 ../src/qalc.cc:1671 ../src/qalc.cc:1672 #: ../src/qalc.cc:1673 ../src/qalc.cc:1674 ../src/qalc.cc:1675 #: ../src/qalc.cc:1679 ../src/qalc.cc:1681 ../src/qalc.cc:1682 #: ../src/qalc.cc:1683 ../src/qalc.cc:1684 ../src/qalc.cc:1685 #: ../src/qalc.cc:1688 ../src/qalc.cc:1689 ../src/qalc.cc:1690 #: ../src/qalc.cc:1691 ../src/qalc.cc:1692 ../src/qalc.cc:1693 #: ../src/qalc.cc:1694 ../src/qalc.cc:1695 ../src/qalc.cc:1696 #: ../src/qalc.cc:1697 ../libqalculate/util.cc:578 msgid "on" msgstr "på" #: ../src/qalc.cc:99 ../src/qalc.cc:557 ../src/qalc.cc:583 ../src/qalc.cc:595 #: ../src/qalc.cc:608 ../src/qalc.cc:623 ../src/qalc.cc:1218 #: ../src/qalc.cc:1228 ../src/qalc.cc:1250 ../src/qalc.cc:1257 #: ../src/qalc.cc:1272 ../src/qalc.cc:1648 ../src/qalc.cc:1650 #: ../src/qalc.cc:1653 ../src/qalc.cc:1654 ../src/qalc.cc:1659 #: ../src/qalc.cc:1660 ../src/qalc.cc:1661 ../src/qalc.cc:1662 #: ../src/qalc.cc:1664 ../src/qalc.cc:1665 ../src/qalc.cc:1666 #: ../src/qalc.cc:1667 ../src/qalc.cc:1668 ../src/qalc.cc:1669 #: ../src/qalc.cc:1671 ../src/qalc.cc:1672 ../src/qalc.cc:1673 #: ../src/qalc.cc:1674 ../src/qalc.cc:1675 ../src/qalc.cc:1676 #: ../src/qalc.cc:1677 ../src/qalc.cc:1679 ../src/qalc.cc:1681 #: ../src/qalc.cc:1682 ../src/qalc.cc:1683 ../src/qalc.cc:1684 #: ../src/qalc.cc:1685 ../src/qalc.cc:1688 ../src/qalc.cc:1689 #: ../src/qalc.cc:1690 ../src/qalc.cc:1691 ../src/qalc.cc:1692 #: ../src/qalc.cc:1693 ../src/qalc.cc:1694 ../src/qalc.cc:1695 #: ../src/qalc.cc:1696 ../src/qalc.cc:1697 ../libqalculate/util.cc:579 msgid "off" msgstr "av" #: ../src/qalc.cc:149 msgid "Please answer yes or no" msgstr "Vänligen svara ja eller nej" #: ../src/qalc.cc:156 ../src/qalc.cc:1179 ../src/qalc.cc:1604 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "unknown" msgstr "okänd" #: ../src/qalc.cc:162 ../src/qalc.cc:414 ../src/qalc.cc:445 ../src/qalc.cc:499 #: ../src/qalc.cc:513 ../src/qalc.cc:1137 ../src/qalc.cc:1148 #: ../src/qalc.cc:1183 ../src/qalc.cc:1198 ../src/qalc.cc:1649 #: ../src/qalc.cc:1651 ../src/qalc.cc:1656 ../src/qalc.cc:1658 msgid "none" msgstr "ingen" #: ../src/qalc.cc:164 ../src/qalc.cc:1176 ../src/qalc.cc:1601 #: ../src/qalc.cc:1704 msgid "non-matrix" msgstr "ej matris" #: ../src/qalc.cc:166 ../src/qalc.cc:1174 ../src/qalc.cc:1599 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "complex" msgstr "komplex" #: ../src/qalc.cc:168 ../src/qalc.cc:1173 ../src/qalc.cc:1598 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "real" msgstr "reell" #: ../src/qalc.cc:170 ../src/qalc.cc:1175 ../src/qalc.cc:1600 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 ../libqalculate/Function.cc:1499 msgid "number" msgstr "nummer" #: ../src/qalc.cc:172 ../src/qalc.cc:1172 ../src/qalc.cc:1597 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "rational" msgstr "rationell" #: ../src/qalc.cc:174 ../src/qalc.cc:1171 ../src/qalc.cc:1596 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 ../libqalculate/Function.cc:1654 msgid "integer" msgstr "heltal" #: ../src/qalc.cc:176 ../src/qalc.cc:1166 ../src/qalc.cc:1591 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "non-zero" msgstr "ej noll" #: ../src/qalc.cc:178 ../src/qalc.cc:1162 ../src/qalc.cc:1587 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "positive" msgstr "positiv" #: ../src/qalc.cc:180 ../src/qalc.cc:1165 ../src/qalc.cc:1590 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "non-negative" msgstr "ej negativ" #: ../src/qalc.cc:182 msgid "negatve" msgstr "negativ" #: ../src/qalc.cc:184 ../src/qalc.cc:1163 ../src/qalc.cc:1588 #: ../src/qalc.cc:1655 ../src/qalc.cc:1704 msgid "non-positive" msgstr "ej positiv" #: ../src/qalc.cc:187 msgid "Unrecognized assumption." msgstr "Okänt antagande." #: ../src/qalc.cc:319 ../src/qalc.cc:320 msgid "" "\n" "Press Enter to continue." msgstr "" "\n" "Tryck Enter för att fortsätta." #: ../src/qalc.cc:328 ../src/qalc.cc:329 ../src/qalc.cc:330 ../src/qalc.cc:429 #: ../src/qalc.cc:432 ../src/qalc.cc:529 ../src/qalc.cc:540 ../src/qalc.cc:549 msgid "Illegal value" msgstr "Otillåtet värde" #. qalc command #: ../src/qalc.cc:344 ../src/qalc.cc:501 ../src/qalc.cc:1064 #: ../src/qalc.cc:1115 ../src/qalc.cc:1185 ../src/qalc.cc:1188 #: ../src/qalc.cc:1304 ../src/qalc.cc:1656 ../src/qalc.cc:1657 #: ../src/qalc.cc:1740 msgid "base" msgstr "bas" #: ../src/qalc.cc:344 ../src/qalc.cc:346 ../src/qalc.cc:1235 #: ../src/qalc.cc:1670 msgid "input base" msgstr "indatabas" #: ../src/qalc.cc:344 msgid "output base" msgstr "utdatabas" #: ../src/qalc.cc:347 ../src/qalc.cc:1190 ../src/qalc.cc:1237 #: ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "roman" msgstr "romersk" #: ../src/qalc.cc:348 ../src/qalc.cc:1192 ../src/qalc.cc:1657 msgid "time" msgstr "tid" #: ../src/qalc.cc:349 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "hex" msgstr "hex" #: ../src/qalc.cc:349 msgid "hexadecimal" msgstr "hexadecimal" #: ../src/qalc.cc:350 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "bin" msgstr "bin" #: ../src/qalc.cc:350 msgid "binary" msgstr "binär" #: ../src/qalc.cc:351 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "oct" msgstr "okt" #: ../src/qalc.cc:351 msgid "octal" msgstr "oktal" #: ../src/qalc.cc:352 ../src/qalc.cc:1657 ../src/qalc.cc:1670 msgid "dec" msgstr "dec" #: ../src/qalc.cc:352 msgid "decimal" msgstr "decimal" #: ../src/qalc.cc:353 ../src/qalc.cc:1657 msgid "sex" msgstr "sex" #: ../src/qalc.cc:353 ../src/qalc.cc:1191 msgid "sexagesimal" msgstr "sexagesimal" #: ../src/qalc.cc:370 ../src/qalc.cc:412 ../src/qalc.cc:1196 #: ../src/qalc.cc:1658 msgid "base display" msgstr "basvisning" #: ../src/qalc.cc:374 msgid "Illegal base." msgstr "Otillåten bas." #: ../src/qalc.cc:382 ../src/qalc.cc:1180 ../src/qalc.cc:1655 msgid "assumptions" msgstr "antaganden" #: ../src/qalc.cc:392 ../src/qalc.cc:1142 ../src/qalc.cc:1650 msgid "all prefixes" msgstr "alla prefix" #: ../src/qalc.cc:393 ../src/qalc.cc:1205 ../src/qalc.cc:1661 msgid "complex numbers" msgstr "komplexa tal" #: ../src/qalc.cc:394 ../src/qalc.cc:1215 ../src/qalc.cc:1666 msgid "excessive parenthesis" msgstr "parenteser av mass" #: ../src/qalc.cc:395 ../src/qalc.cc:1234 ../src/qalc.cc:1669 msgid "functions" msgstr "funktioner" #: ../src/qalc.cc:396 ../src/qalc.cc:1242 ../src/qalc.cc:1671 msgid "infinite numbers" msgstr "oändliga tal" #: ../src/qalc.cc:397 ../src/qalc.cc:1283 ../src/qalc.cc:1689 msgid "show negative exponents" msgstr "visa negativa exponenter" #: ../src/qalc.cc:398 ../src/qalc.cc:1158 ../src/qalc.cc:1653 msgid "assume nonzero denominators" msgstr "antag nämnare ej noll" #: ../src/qalc.cc:399 ../src/qalc.cc:1159 ../src/qalc.cc:1654 msgid "warn nonzero denominators" msgstr "varna nämnare ej noll" #: ../src/qalc.cc:400 ../src/qalc.cc:1269 ../src/qalc.cc:1681 msgid "prefixes" msgstr "prefix" #: ../src/qalc.cc:401 ../src/qalc.cc:1206 ../src/qalc.cc:1662 msgid "denominator prefixes" msgstr "nämnarprefix" #: ../src/qalc.cc:402 ../src/qalc.cc:1267 ../src/qalc.cc:1679 msgid "place units separately" msgstr "placera enheter separat" #: ../src/qalc.cc:403 ../src/qalc.cc:1204 ../src/qalc.cc:1660 msgid "calculate variables" msgstr "beräkna variabler" #: ../src/qalc.cc:404 ../src/qalc.cc:1203 ../src/qalc.cc:1659 msgid "calculate functions" msgstr "beräkna funktioner" #: ../src/qalc.cc:405 ../src/qalc.cc:1287 ../src/qalc.cc:1693 msgid "sync units" msgstr "synkronisera enheter" #: ../src/qalc.cc:406 ../src/qalc.cc:1277 ../src/qalc.cc:1683 msgid "round to even" msgstr "avrunda till jämnt" #. qalc command #: ../src/qalc.cc:407 ../src/qalc.cc:1067 ../src/qalc.cc:1278 #: ../src/qalc.cc:1316 ../src/qalc.cc:1684 ../src/qalc.cc:1728 msgid "rpn" msgstr "rpn" #: ../src/qalc.cc:408 ../src/qalc.cc:1279 ../src/qalc.cc:1685 msgid "rpn syntax" msgstr "rpnsyntax" #: ../src/qalc.cc:409 ../src/qalc.cc:1284 ../src/qalc.cc:1690 msgid "short multiplication" msgstr "kort multiplikation" #: ../src/qalc.cc:410 ../src/qalc.cc:1244 ../src/qalc.cc:1674 msgid "lowercase e" msgstr "litet e" #: ../src/qalc.cc:411 ../src/qalc.cc:1245 ../src/qalc.cc:1675 msgid "lowercase numbers" msgstr "små nummer" #: ../src/qalc.cc:415 ../src/qalc.cc:1199 ../src/qalc.cc:1658 msgid "normal" msgstr "normal" #: ../src/qalc.cc:416 ../src/qalc.cc:1200 ../src/qalc.cc:1658 msgid "alternative" msgstr "alternativ" #: ../src/qalc.cc:421 ../src/qalc.cc:450 ../src/qalc.cc:464 ../src/qalc.cc:478 #: ../src/qalc.cc:492 ../src/qalc.cc:506 ../src/qalc.cc:520 ../src/qalc.cc:567 #: ../src/qalc.cc:576 ../src/qalc.cc:616 ../src/qalc.cc:630 msgid "Illegal value." msgstr "Otillåtet värde." #: ../src/qalc.cc:426 ../src/qalc.cc:1286 ../src/qalc.cc:1692 msgid "spell out logical" msgstr "skriv ut logiska" #: ../src/qalc.cc:427 ../src/qalc.cc:1214 ../src/qalc.cc:1664 msgid "dot as separator" msgstr "punkt som avgränsare" #: ../src/qalc.cc:428 ../src/qalc.cc:1243 ../src/qalc.cc:1673 msgid "limit implicit multiplication" msgstr "begränsa implicit multiplikation" #: ../src/qalc.cc:430 ../src/qalc.cc:1285 ../src/qalc.cc:1691 msgid "spacious" msgstr "rymlig" #: ../src/qalc.cc:431 ../src/qalc.cc:1288 ../src/qalc.cc:1694 msgid "unicode" msgstr "unicode" #: ../src/qalc.cc:434 ../src/qalc.cc:1289 ../src/qalc.cc:1695 msgid "units" msgstr "enheter" #: ../src/qalc.cc:435 ../src/qalc.cc:1290 ../src/qalc.cc:1696 msgid "unknowns" msgstr "okända" #: ../src/qalc.cc:436 ../src/qalc.cc:1291 ../src/qalc.cc:1697 msgid "variables" msgstr "variabler" #: ../src/qalc.cc:437 ../src/qalc.cc:1134 ../src/qalc.cc:1648 msgid "abbreviations" msgstr "förkortningar" #: ../src/qalc.cc:438 ../src/qalc.cc:1282 ../src/qalc.cc:1688 msgid "show ending zeroes" msgstr "visa avslutande nollor" #: ../src/qalc.cc:439 ../src/qalc.cc:1241 ../src/qalc.cc:1672 msgid "indicate infinite series" msgstr "indikera oändliga talserier" #: ../src/qalc.cc:440 ../src/qalc.cc:1143 ../src/qalc.cc:1651 msgid "angle unit" msgstr "vinkelenhet" #: ../src/qalc.cc:442 ../src/qalc.cc:1145 ../src/qalc.cc:1146 msgid "rad" msgstr "rad" #: ../src/qalc.cc:442 ../src/qalc.cc:1651 msgid "radians" msgstr "radianer" #: ../src/qalc.cc:443 msgid "deg" msgstr "deg" #: ../src/qalc.cc:443 ../src/qalc.cc:1651 msgid "degrees" msgstr "grader" #: ../src/qalc.cc:444 ../src/qalc.cc:1147 msgid "gra" msgstr "gra" #: ../src/qalc.cc:444 ../src/qalc.cc:1651 msgid "gradians" msgstr "gradienter" #: ../src/qalc.cc:455 ../src/qalc.cc:1260 ../src/qalc.cc:1678 msgid "multiplication sign" msgstr "multiplikationstecken" #: ../src/qalc.cc:469 ../src/qalc.cc:1207 ../src/qalc.cc:1663 msgid "division sign" msgstr "divisionstecken" #: ../src/qalc.cc:483 ../src/qalc.cc:1151 ../src/qalc.cc:1652 msgid "approximation" msgstr "approximering" #. qalc command #: ../src/qalc.cc:485 ../src/qalc.cc:526 ../src/qalc.cc:609 #: ../src/qalc.cc:1097 ../src/qalc.cc:1153 ../src/qalc.cc:1229 #: ../src/qalc.cc:1307 ../src/qalc.cc:1652 ../src/qalc.cc:1665 #: ../src/qalc.cc:1668 ../src/qalc.cc:1744 msgid "exact" msgstr "exakt" #: ../src/qalc.cc:486 ../src/qalc.cc:1154 ../src/qalc.cc:1652 msgid "try exact" msgstr "försök exakt" #. qalc command #: ../src/qalc.cc:487 ../src/qalc.cc:1103 ../src/qalc.cc:1155 #: ../src/qalc.cc:1302 ../src/qalc.cc:1516 ../src/qalc.cc:1526 #: ../src/qalc.cc:1614 ../src/qalc.cc:1652 ../src/qalc.cc:1748 msgid "approximate" msgstr "approximerat" #: ../src/qalc.cc:497 ../src/qalc.cc:1181 ../src/qalc.cc:1656 msgid "autoconversion" msgstr "autoomvandling" #: ../src/qalc.cc:500 ../src/qalc.cc:1112 ../src/qalc.cc:1184 #: ../src/qalc.cc:1656 msgid "best" msgstr "bästa" #: ../src/qalc.cc:511 ../src/qalc.cc:1135 ../src/qalc.cc:1649 msgid "algebra mode" msgstr "algebraiskt läge" #. qalc command #: ../src/qalc.cc:514 ../src/qalc.cc:1126 ../src/qalc.cc:1138 #: ../src/qalc.cc:1319 ../src/qalc.cc:1635 ../src/qalc.cc:1649 msgid "simplify" msgstr "förenkla" #: ../src/qalc.cc:515 ../src/qalc.cc:1139 ../src/qalc.cc:1649 msgid "factorize" msgstr "faktorisera" #: ../src/qalc.cc:537 ../src/qalc.cc:1281 ../src/qalc.cc:1687 msgid "save mode" msgstr "spara läge" #: ../src/qalc.cc:546 ../src/qalc.cc:1280 ../src/qalc.cc:1686 msgid "save definitions" msgstr "spara definitioner" #: ../src/qalc.cc:555 ../src/qalc.cc:1216 ../src/qalc.cc:1667 msgid "exp mode" msgstr "exp-läge" #: ../src/qalc.cc:558 ../src/qalc.cc:1219 ../src/qalc.cc:1667 msgid "auto" msgstr "auto" #: ../src/qalc.cc:559 ../src/qalc.cc:1220 ../src/qalc.cc:1667 msgid "pure" msgstr "ren" #: ../src/qalc.cc:560 ../src/qalc.cc:1221 ../src/qalc.cc:1667 msgid "scientific" msgstr "vetenskaplig" #: ../src/qalc.cc:561 ../src/qalc.cc:1222 ../src/qalc.cc:1667 msgid "engineering" msgstr "teknisk" #: ../src/qalc.cc:572 ../src/qalc.cc:1268 ../src/qalc.cc:1680 msgid "precision" msgstr "precision" #: ../src/qalc.cc:581 ../src/qalc.cc:1246 ../src/qalc.cc:1676 msgid "max decimals" msgstr "max decimaler" #: ../src/qalc.cc:593 ../src/qalc.cc:1253 ../src/qalc.cc:1677 msgid "min decimals" msgstr "min decimaler" #: ../src/qalc.cc:606 ../src/qalc.cc:1226 ../src/qalc.cc:1668 msgid "fractions" msgstr "bråktal" #: ../src/qalc.cc:611 ../src/qalc.cc:1231 ../src/qalc.cc:1668 msgid "combined" msgstr "kombinerad" #: ../src/qalc.cc:621 ../src/qalc.cc:1270 ../src/qalc.cc:1682 msgid "read precision" msgstr "läs precision" #: ../src/qalc.cc:624 ../src/qalc.cc:1273 ../src/qalc.cc:1682 msgid "always" msgstr "alltid" #: ../src/qalc.cc:625 ../src/qalc.cc:1274 ../src/qalc.cc:1682 msgid "when decimals" msgstr "när decimaler" #: ../src/qalc.cc:649 msgid "Unrecognized option." msgstr "Okänd inställning." #: ../src/qalc.cc:670 msgid "usage: qalc [options] [expression]" msgstr "användning: qalc [alternative] [uttryck]" #: ../src/qalc.cc:672 msgid "where options are:" msgstr "där alternative är:" #: ../src/qalc.cc:674 msgid "turn on/off unicode support" msgstr "aktivera/avaktivera unicode-stöd" #: ../src/qalc.cc:675 ../src/qalc.cc:1318 msgid "OPTION" msgstr "INSTÄLLNING" #: ../src/qalc.cc:675 ../src/qalc.cc:1318 msgid "VALUE" msgstr "VÄRDE" #: ../src/qalc.cc:676 msgid "as set command in interactive program session (ex. -set \"base 16\")" msgstr "" "fungerar som set (sätt) kommandot i en interaktiv programsession (ex. -set " "\"bas 16\")" #: ../src/qalc.cc:677 msgid "FILE" msgstr "FIL" #: ../src/qalc.cc:678 msgid "executes commands from a file first" msgstr "utför kommandon från en fil först" #: ../src/qalc.cc:680 msgid "reduces output to just the result of the input expression" msgstr "begränsar utdata till enbart resultatet av angett uttryck" #: ../src/qalc.cc:682 msgid "do not load any functions, units, or variables from file" msgstr "läs inte in några funktioner, enheter, eller variabler från datafiler" #: ../src/qalc.cc:684 msgid "do not load any global currencies from file" msgstr "läs inte in några systemvida valutor" #: ../src/qalc.cc:686 msgid "do not load any global data sets from file" msgstr "läs inte in några systemvida dataset" #: ../src/qalc.cc:688 msgid "do not load any global functions from file" msgstr "läs inte in några systemvida funktioner" #: ../src/qalc.cc:690 msgid "do not load any global units from file" msgstr "läs inte in några systemvida enheter" #: ../src/qalc.cc:692 msgid "do not load any global variables from file" msgstr "läs inte in några systemvida variabler" #: ../src/qalc.cc:694 msgid "" "The program will start in interactive mode if no expression is specified." msgstr "Programmet startar i interaktivt läge om inget uttryck angetts." #: ../src/qalc.cc:720 msgid "No option and value specified for set command." msgstr "Ingen inställning och värde angett för set (sätt) kommandot." #: ../src/qalc.cc:728 msgid "No file specified." msgstr "Ingen fil specificerad." #: ../src/qalc.cc:780 msgid "" "You need the download exchange rates to be able to convert between different " "currencies.\n" "You can later get current exchange rates with the \"exchange rates\" " "command.\n" "Do you want to fetch exchange rates now from the Internet (default yes)?" msgstr "" "Du behöver ladda ner växelkurser för att kunna omvandla mellan olika " "valutor.\n" "Du kan senare hämta nuvarande växelkurser med \"exchange rates\"-kommandot\n" "Vill du hämta växelkurser från Internet nu?" #: ../src/qalc.cc:789 msgid "ans" msgstr "ans" #: ../src/qalc.cc:790 ../src/qalc.cc:793 ../src/qalc.cc:794 ../src/qalc.cc:795 #: ../src/qalc.cc:796 ../src/qalc.cc:1006 ../libqalculate/Calculator.cc:7054 msgid "Temporary" msgstr "Temporära" #: ../src/qalc.cc:790 msgid "Last Answer" msgstr "Senaste svaret" #: ../src/qalc.cc:791 msgid "answer" msgstr "svar" #: ../src/qalc.cc:793 msgid "Answer 2" msgstr "Svar 2" #: ../src/qalc.cc:794 msgid "Answer 3" msgstr "Svar 3" #: ../src/qalc.cc:795 msgid "Answer 4" msgstr "Svar 4" #: ../src/qalc.cc:796 msgid "Answer 5" msgstr "Svar 5" #: ../src/qalc.cc:807 msgid "Failed to load global definitions!" msgstr "Kunde inte inhämta systemvida definitioner!" #: ../src/qalc.cc:840 #, c-format msgid "Could not open \"%s\".\n" msgstr "Kunde inte öppna \"%s\".\n" #: ../src/qalc.cc:859 ../src/qalc.cc:905 ../src/qalc.cc:1783 #, c-format msgid "Illegal character, '%c', in expression." msgstr "Otillåtet tecken, '%c', i uttryck." #. The qalc command "set" as in "set precision 10". The original text string for commands is kept in addition to the translation. #: ../src/qalc.cc:968 ../src/qalc.cc:1318 ../src/qalc.cc:1639 msgid "set" msgstr "ange" #. qalc command #: ../src/qalc.cc:972 ../src/qalc.cc:1317 ../src/qalc.cc:1707 msgid "save" msgstr "spara" #: ../src/qalc.cc:972 ../src/qalc.cc:1317 ../src/qalc.cc:1707 msgid "store" msgstr "lagra" #. qalc command #: ../src/qalc.cc:975 ../src/qalc.cc:1129 ../src/qalc.cc:1315 #: ../src/qalc.cc:1714 msgid "mode" msgstr "läge" #: ../src/qalc.cc:977 msgid "mode saved" msgstr "läge sparades" #: ../src/qalc.cc:979 msgid "definitions" msgstr "definitioner" #: ../src/qalc.cc:981 msgid "definitions saved" msgstr "definitioner sparades" #: ../src/qalc.cc:1028 ../src/qalc.cc:1030 #, c-format msgid "Illegal name. Save as %s instead?" msgstr "Otillåtet namn. Vill du spara som %s i stället?" #: ../src/qalc.cc:1037 msgid "" "An unit or variable with the same name already exists.\n" "Do you want to overwrite it?" msgstr "" "En enhet eller variabel med samma namn finns redan.\n" "Vill du ersätta den?" #. qalc command #: ../src/qalc.cc:1060 ../src/qalc.cc:1303 ../src/qalc.cc:1701 msgid "assume" msgstr "antag" #. qalc command #: ../src/qalc.cc:1070 ../src/qalc.cc:1076 ../src/qalc.cc:1308 #: ../src/qalc.cc:1724 msgid "exrates" msgstr "växelkurser" #. qalc command #: ../src/qalc.cc:1080 ../src/qalc.cc:1320 ../src/qalc.cc:1736 msgid "stack" msgstr "stack" #: ../src/qalc.cc:1082 msgid "The RPN stack is empty." msgstr "RPN-stacken är tom." #. qalc command #: ../src/qalc.cc:1094 ../src/qalc.cc:1305 ../src/qalc.cc:1732 msgid "clear stack" msgstr "töm stacken" #. qalc command #: ../src/qalc.cc:1109 ../src/qalc.cc:1306 ../src/qalc.cc:1752 msgid "convert" msgstr "omvandla" #: ../src/qalc.cc:1109 ../src/qalc.cc:1306 ../src/qalc.cc:1752 msgid "to" msgstr "till" #. qalc command #: ../src/qalc.cc:1123 ../src/qalc.cc:1313 ../src/qalc.cc:1631 msgid "factor" msgstr "faktor" #: ../src/qalc.cc:1164 ../src/qalc.cc:1589 ../src/qalc.cc:1655 #: ../src/qalc.cc:1704 msgid "negative" msgstr "negativ" #. qalc command #: ../src/qalc.cc:1294 ../src/qalc.cc:1628 msgid "help" msgstr "hjälp" #: ../src/qalc.cc:1296 msgid "Enter a mathematical expression or a command." msgstr "Skriv in ett matematiskt uttryck eller komande." #: ../src/qalc.cc:1298 msgid "Complete functions, units and variables with the tabulator key." msgstr "Avsluta funktions-, enhets- och variabelnamn med tabulatortangenten." #: ../src/qalc.cc:1300 msgid "Available commands are:" msgstr "Tillgängliga kommandon:" #: ../src/qalc.cc:1303 msgid "ASSUMPTIONS" msgstr "ANTAGANDEN" #: ../src/qalc.cc:1304 msgid "BASE" msgstr "BAS" #: ../src/qalc.cc:1306 msgid "UNIT" msgstr "ENHET" #: ../src/qalc.cc:1310 msgid "WGET ARGUMENTS" msgstr "WGET ARGUMENT" #: ../src/qalc.cc:1314 ../src/qalc.cc:1326 ../src/qalc.cc:1718 #: ../libqalculate/Calculator.cc:7680 ../libqalculate/DataSet.cc:354 #: ../libqalculate/DataSet.cc:381 ../libqalculate/DataSet.cc:992 msgid "info" msgstr "info" #: ../src/qalc.cc:1316 msgid "ON/OFF" msgstr "AV/PÅ" #: ../src/qalc.cc:1317 msgid "NAME" msgstr "NAMN" #: ../src/qalc.cc:1317 msgid "CATEGORY" msgstr "KATEGORI" #: ../src/qalc.cc:1317 msgid "TITLE" msgstr "TITEL" #. qalc command #: ../src/qalc.cc:1321 ../src/qalc.cc:1765 ../src/qalc.cc:1773 msgid "quit" msgstr "avsluta" #: ../src/qalc.cc:1321 ../src/qalc.cc:1765 ../src/qalc.cc:1773 msgid "exit" msgstr "exit" #: ../src/qalc.cc:1323 msgid "Type help COMMAND for more help (example: help save)." msgstr "Skriv in hjälp KOMMANDO för mer hjälp (exemel: hjälp save)." #: ../src/qalc.cc:1324 msgid "" "Type info NAME for info about a function, variable or unit (example: info " "sin)." msgstr "" "Skriv info NAMN för info om en funktion, variabel eller enhet (exempel: info " "sin)." #: ../src/qalc.cc:1334 msgid "No function, variable or unit with specified name exist." msgstr "Ingen funktion, variabel eller enhet med det angivna namnet existerar." #: ../src/qalc.cc:1344 msgid "Function" msgstr "Funktion" #: ../src/qalc.cc:1371 ../libqalculate/Function.cc:149 msgid "argument" msgstr "parameter" #: ../src/qalc.cc:1395 #, c-format msgid "" "Retrieves data from the %s data set for a given object and property. If " "\"info\" is typed as property, all properties of the object will be listed." msgstr "" "Hämtar data från dataset %s för ett givet objekt och egenskap. Om \"info\" " "är angivet som egenskap, kommer alla objektets egenskaper att listas." #: ../src/qalc.cc:1408 msgid "Arguments" msgstr "Parametrar" #. optional argument, in description #: ../src/qalc.cc:1425 msgid "optional" msgstr "frivillig" #. argument default, in description #: ../src/qalc.cc:1429 msgid "default: " msgstr "förval: " #: ../src/qalc.cc:1440 msgid "Requirement" msgstr "Krav" #: ../src/qalc.cc:1448 msgid "Properties" msgstr "Egenskaper" #: ../src/qalc.cc:1463 msgid "key" msgstr "nyckel" #: ../src/qalc.cc:1481 ../src/qalc.cc:1484 msgid "Unit" msgstr "Enhet" #: ../src/qalc.cc:1487 ../src/qalc.cc:1555 msgid "Names" msgstr "Namn" #: ../src/qalc.cc:1505 msgid "Base Unit" msgstr "Grundenhet" #: ../src/qalc.cc:1512 msgid "Relation" msgstr "Relation" #: ../src/qalc.cc:1522 msgid "Inverse Relation" msgstr "Omvänd relation" #: ../src/qalc.cc:1534 msgid "Base Units" msgstr "Grundenheter" #: ../src/qalc.cc:1549 ../src/qalc.cc:1552 msgid "Variable" msgstr "Variabel" #: ../src/qalc.cc:1567 msgid "a previous result" msgstr "ett föregående resultat" #: ../src/qalc.cc:1577 ../libqalculate/Function.cc:1823 msgid "matrix" msgstr "matris" #: ../src/qalc.cc:1579 ../libqalculate/Function.cc:1762 msgid "vector" msgstr "vektor" #: ../src/qalc.cc:1606 msgid "default assumptions" msgstr "förvalda antaganden" #: ../src/qalc.cc:1610 msgid "Value" msgstr "Värde" #: ../src/qalc.cc:1633 msgid "Factorizes the current result." msgstr "Faktoriserar nuvaranda resultat." #: ../src/qalc.cc:1637 msgid "Simplifies the current result." msgstr "Förenklar nuvaranda resultat." #: ../src/qalc.cc:1644 msgid "Sets the value of an option." msgstr "Anger värdet för en inställning." #: ../src/qalc.cc:1646 msgid "Available options and accepted values are:" msgstr "Tillgängliga inställningar och accepterade värden:" #: ../src/qalc.cc:1699 msgid "Example: set base 16." msgstr "Exempel: set bas 16." #: ../src/qalc.cc:1703 msgid "Set default assumptions for unknown variables." msgstr "Ange färvalda antaganden för okända variabler." #: ../src/qalc.cc:1709 msgid "" "Saves the current result in a variable with the specified name. You may " "optionally also provide a category (default \"Temporary\") and a title." msgstr "" "Sparar nuvarande resultat i en variabel med angivet namn. Du kan välja att " "också ange en kategori (förvald är \"Temporära\") och en titel." #: ../src/qalc.cc:1710 msgid "" "If name equals \"mode\" or \"definitions\", the current mode and " "definitions, respectively, will be saved." msgstr "" "Om angivet namn är \"läge\" eller \"definitioner\", sparas nuvarande läge " "respektive definitioner." #: ../src/qalc.cc:1712 msgid "Example: store var1." msgstr "Exempel: store var1." #: ../src/qalc.cc:1716 msgid "Displays the current mode." msgstr "Visar nuvarande läge." #: ../src/qalc.cc:1720 msgid "Displays information about a function, variable or unit." msgstr "Visar information om en funktion, variabel eller enhet." #: ../src/qalc.cc:1722 msgid "Example: info sin." msgstr "Exempel: info sin." #: ../src/qalc.cc:1726 msgid "Downloads current exchange rates from the Internet." msgstr "Hämtar nuvarande växelkurser från internet." #: ../src/qalc.cc:1730 msgid "(De)activates the Reverse Polish Notation mode." msgstr "(Av)aktiverar RPN-läget." #: ../src/qalc.cc:1734 msgid "Clears the RPN stack." msgstr "Tömmer RPN-stacken." #: ../src/qalc.cc:1738 msgid "Displays the RPN stack." msgstr "Visar RPN-stacken." #: ../src/qalc.cc:1742 msgid "Sets the result base (equivalent to set base)." msgstr "Anger nummerbas för resultat (liktydigt med ange bas)." #: ../src/qalc.cc:1746 msgid "Equivalent to set approximation exact." msgstr "Liktydigt med ange approximation exakt." #: ../src/qalc.cc:1750 msgid "Equivalent to set approximation try exact." msgstr "Liktydigt med ange approximation försök exakt." #: ../src/qalc.cc:1754 msgid "Converts units in current result." msgstr "Omvandlar enheter i nuvarande resultat." #: ../src/qalc.cc:1756 msgid "Possible unit values are:" msgstr "Möjliga enhetsvärden:" #: ../src/qalc.cc:1758 msgid "a unit (example meter)" msgstr "en enhet (exempel meter)" #: ../src/qalc.cc:1759 msgid "a unit expression (example km/h)" msgstr "ett enhetsuttryck (exempel km/h)" #: ../src/qalc.cc:1760 msgid "base (convert to base units)" msgstr "bas (omvandla till basenheter)" #: ../src/qalc.cc:1761 msgid "best (convert best unit)" msgstr "bästa (omvandla till bästa enhet)" #: ../src/qalc.cc:1763 msgid "Example: convert best." msgstr "Exempel: convert bästa." #: ../src/qalc.cc:1767 msgid "Terminates this program." msgstr "Avslutar det här programmet." #: ../src/qalc.cc:1818 msgid "error" msgstr "fel" #: ../src/qalc.cc:1820 msgid "warning" msgstr "varning" #: ../src/qalc.cc:1879 ../libqalculate/Calculator.cc:182 #: ../libqalculate/Calculator.cc:183 ../libqalculate/Calculator.cc:188 #: ../libqalculate/Calculator.cc:2146 msgid "aborted" msgstr "avbruten" #: ../src/qalc.cc:1908 msgid "RPN Register Moved" msgstr "RPN-register flyttades" #: ../src/qalc.cc:1947 msgid "Processing (press Enter to abort)" msgstr "Behandlar (tryck Enter för att avbryta)" #: ../src/qalc.cc:2010 msgid "approx." msgstr "ca" #: ../src/qalc.cc:2116 msgid "Factorizing (press Enter to abort)" msgstr "Faktoriserar (tryck Enter för att avbryta)" #: ../src/qalc.cc:2120 msgid "Simplifying (press Enter to abort)" msgstr "Förenklar (tryck Enter för att avbryta)" #: ../src/qalc.cc:2315 msgid "Calculating (press Enter to abort)" msgstr "Beräknar (tryck Enter för att avbryta)" #: ../src/qalc.cc:2371 msgid "RPN Operation" msgstr "RPN-operation" #: ../src/qalc.cc:2669 #, c-format msgid "" "Couldn't write preferences to\n" "%s" msgstr "" "Kunde inte spara inställningar till\n" "%s" #: ../src/qalc.cc:2743 msgid "Couldn't write definitions" msgstr "Kunde inte spara definitioner" #: ../libqalculate/BuiltinFunctions.cc:58 #, c-format msgid "Too many elements (%s) for the dimensions (%sx%s) of the matrix." msgstr "För många element (%s) för en %sx%s matris." #: ../libqalculate/BuiltinFunctions.cc:120 #: ../libqalculate/BuiltinFunctions.cc:180 #, c-format msgid "Row %s does not exist in matrix." msgstr "Rad %s finns inte i matrisen." #: ../libqalculate/BuiltinFunctions.cc:133 #: ../libqalculate/BuiltinFunctions.cc:176 #, c-format msgid "Column %s does not exist in matrix." msgstr "Kolumn %s finns inte i matrisen." #: ../libqalculate/BuiltinFunctions.cc:191 #, c-format msgid "Argument 3, %s, is ignored for vectors." msgstr "Parameter 3, %s, bortses från för vektorer." #: ../libqalculate/BuiltinFunctions.cc:195 #: ../libqalculate/BuiltinFunctions.cc:216 #, c-format msgid "Element %s does not exist in vector." msgstr "Element %s finns inte i vektorn." #: ../libqalculate/BuiltinFunctions.cc:404 #, c-format msgid "%s() does at the moment only support integers and fractions of two." msgstr "%s() har för närvarande enbart stöd för heltal och halvtal." #: ../libqalculate/BuiltinFunctions.cc:1242 #, c-format msgid "Argument for %s() must be a real number greater than or equal to -1/e." msgstr "Parameter för %s() måste vara reellt tal större eller lika med -1/e." #: ../libqalculate/BuiltinFunctions.cc:2112 #: ../libqalculate/BuiltinFunctions.cc:2155 #, c-format msgid "Unsolvable comparison in %s()." msgstr "Olöslig jämförelse i %s()." #: ../libqalculate/BuiltinFunctions.cc:2246 #: ../libqalculate/BuiltinFunctions.cc:2266 #: ../libqalculate/BuiltinFunctions.cc:2290 ../libqalculate/util.cc:164 #: ../libqalculate/util.cc:211 ../libqalculate/util.cc:231 #: ../libqalculate/util.cc:251 msgid "today" msgstr "idag" #: ../libqalculate/BuiltinFunctions.cc:2285 ../libqalculate/util.cc:167 #: ../libqalculate/util.cc:214 ../libqalculate/util.cc:234 #: ../libqalculate/util.cc:254 msgid "now" msgstr "nu" #: ../libqalculate/BuiltinFunctions.cc:2301 #, c-format msgid "The timestamp value for the date %s is too large or small for %s()." msgstr "\"Timestamp\"-värdet för datumet %s är för stort eller litet för %s()." #: ../libqalculate/BuiltinFunctions.cc:2336 #: ../libqalculate/BuiltinFunctions.cc:2349 #: ../libqalculate/BuiltinFunctions.cc:2362 #: ../libqalculate/BuiltinFunctions.cc:2384 #: ../libqalculate/BuiltinFunctions.cc:2405 #, c-format msgid "Error in date format for function %s()." msgstr "Felaktigt datumformat för %s()." #: ../libqalculate/BuiltinFunctions.cc:2659 msgid "" "The number of requested elements in generate vector function must be a " "positive integer." msgstr "" "Antalet efterfrågade element i generera vektor-funktionen måste vara ett " "positivt heltal." #: ../libqalculate/BuiltinFunctions.cc:2953 #: ../libqalculate/BuiltinFunctions.cc:2970 msgid "Comparison failed." msgstr "Jämförelse misslyckades." #: ../libqalculate/BuiltinFunctions.cc:2958 #: ../libqalculate/BuiltinFunctions.cc:2988 msgid "No matching item found." msgstr "Inga matchande poster funna." #: ../libqalculate/BuiltinFunctions.cc:3070 #, c-format msgid "Object %s does not exist." msgstr "Okjektet %s finns inte." #: ../libqalculate/BuiltinFunctions.cc:3097 #, c-format msgid "Register %s does not exist. Returning zero." msgstr "RPN-registret %s finns inte. Returnerar noll." #: ../libqalculate/BuiltinFunctions.cc:3155 msgid "" "Both the lower and upper limit must be set to get the definite integral." msgstr "Både nedre och övre gräns måste anges för definitiva integraler." #: ../libqalculate/BuiltinFunctions.cc:3290 msgid "" "No equality or inequality to solve. The entered expression to solve is not " "correct (ex. \"x + 5 = 3\" is correct)" msgstr "" "Ingen ekvation eller olikhet att lösa. Angett uttryck att lösa var inte " "korrekt (t ex \"x + 5 = 3\" är korrekt)" #: ../libqalculate/BuiltinFunctions.cc:3337 #, c-format msgid "The comparison is true for all %s (with current assumptions)." msgstr "Jämförelsen är sann för alla %s (med nuvarande antaganden)." #: ../libqalculate/BuiltinFunctions.cc:3341 msgid "No possible solution was found (with current assumptions)." msgstr "Ingen möjlig lösning funnen (med nuvarande antaganden)." #: ../libqalculate/BuiltinFunctions.cc:3345 #, c-format msgid "Was unable to completely isolate %s." msgstr "Kunde inte isolera %s fullständigt." #: ../libqalculate/BuiltinFunctions.cc:3349 #: ../libqalculate/BuiltinFunctions.cc:3477 #: ../libqalculate/BuiltinFunctions.cc:3572 #, c-format msgid "The comparison is true for all %s if %s." msgstr "Jämförelsen är sann för alla %s om %s." #: ../libqalculate/BuiltinFunctions.cc:3353 #, c-format msgid "Was unable to isolate %s." msgstr "Kunde inte isolera %s." #: ../libqalculate/BuiltinFunctions.cc:3436 #: ../libqalculate/BuiltinFunctions.cc:3463 #: ../libqalculate/BuiltinFunctions.cc:3546 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed sign was " "therefor temporarily set as unknown." msgstr "" "Kunde inte isolera %s med nuvarande antaganden. Antaget tecken sattes därför " "temporärt till okänt." #: ../libqalculate/BuiltinFunctions.cc:3439 #: ../libqalculate/BuiltinFunctions.cc:3466 #: ../libqalculate/BuiltinFunctions.cc:3549 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed type and " "sign was therefor temporarily set as unknown." msgstr "" "Kunde inte isolera %s med nuvarande antaganden. Antagen typ sattes därför " "temporärt till okänd." #: ../libqalculate/BuiltinFunctions.cc:3472 #: ../libqalculate/BuiltinFunctions.cc:3557 #, c-format msgid "The solution requires that %s." msgstr "Lösningen kräver att %s." #: ../libqalculate/BuiltinFunctions.cc:3565 #, c-format msgid "Solution %s requires that %s." msgstr "Lösning %s kräver att %s." #: ../libqalculate/BuiltinFunctions.cc:3633 #, c-format msgid "" "Unable to isolate %s.\n" "\n" "You might need to place the equations and variables in an appropriate order " "so that so that each equation at least contains the corresponding variable " "(if automatic reordering failed)." msgstr "" "Kan inte isolera %s.\n" "\n" "Du behöver kanske placera ekvationerna och variablerna i lämplig ordning så " "att varje ekvation åtminstone innehåller motsvarande variabel (om automatisk " "omsortering misslyckades)." #: ../libqalculate/BuiltinFunctions.cc:3635 #: ../libqalculate/BuiltinFunctions.cc:3649 #: ../libqalculate/BuiltinFunctions.cc:3658 #, c-format msgid "Unable to isolate %s." msgstr "Kan inte isolera %s." #: ../libqalculate/BuiltinFunctions.cc:3642 #, c-format msgid "Inequalities is not allowed in %s()." msgstr "Olikheter är inte tillåtna i %s()." #: ../libqalculate/Calculator.cc:277 msgid "per" msgstr "per" #: ../libqalculate/Calculator.cc:279 msgid "times" msgstr "gånger" #: ../libqalculate/Calculator.cc:281 msgid "plus" msgstr "plus" #: ../libqalculate/Calculator.cc:283 msgid "minus" msgstr "minus" #: ../libqalculate/Calculator.cc:285 ../libqalculate/MathStructure.cc:11274 #: ../libqalculate/Function.cc:1106 ../libqalculate/Function.cc:1114 #: ../libqalculate/Function.cc:1523 ../libqalculate/Function.cc:1667 msgid "and" msgstr "och" #: ../libqalculate/Calculator.cc:289 ../libqalculate/DataSet.cc:1026 #: ../libqalculate/DataSet.cc:1089 ../libqalculate/MathStructure.cc:11288 #: ../libqalculate/Function.cc:1977 ../libqalculate/Function.cc:1993 msgid "or" msgstr "eller" #: ../libqalculate/Calculator.cc:319 ../libqalculate/Calculator.cc:1038 #: ../libqalculate/Calculator.cc:2154 ../libqalculate/Calculator.cc:2155 msgid " to " msgstr " till " #: ../libqalculate/Calculator.cc:391 msgid "Gradians unit is missing. Creating one for this session." msgstr "Gradientenheten saknas. Skapar en för nuvarande session." #: ../libqalculate/Calculator.cc:392 ../libqalculate/Calculator.cc:400 #: ../libqalculate/Calculator.cc:408 msgid "Angle/Plane Angle" msgstr "Vinkel/Planvinkel" #: ../libqalculate/Calculator.cc:399 msgid "Radians unit is missing. Creating one for this session." msgstr "Radianenheten saknas. Skapar en för nuvarande session." #: ../libqalculate/Calculator.cc:407 msgid "Degrees unit is missing. Creating one for this session." msgstr "Gradenheten saknas. Skapar en för nuvarande session." #: ../libqalculate/Calculator.cc:1377 ../libqalculate/Calculator.cc:8061 msgid "Currency" msgstr "Valuta" #: ../libqalculate/Calculator.cc:2117 msgid "calculating..." msgstr "beräknar..." #: ../libqalculate/Calculator.cc:2243 msgid "timed out" msgstr "tiden rann ut för visning" #: ../libqalculate/Calculator.cc:3144 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name of \"%s\", or " "the variable will be lost." msgstr "" "\"%s\" tillåts inte längre i namn. Vänligen ändra namnet på \"%s\". Annars " "kommer variabeln att gå förlorad." #: ../libqalculate/Calculator.cc:3161 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the function will be lost." msgstr "" "\"%s\" tillåts inte längre i namn. Vänligen ändra namnet på \"%s\". Annars " "kommer funktionen att gå förlorad." #: ../libqalculate/Calculator.cc:3177 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the unit will be lost." msgstr "" "\"%s\" tillåts inte längre i namn. Vänligen ändra namnet på \"%s\". Annars " "kommer enheten att gå förlorad." #: ../libqalculate/Calculator.cc:4156 ../libqalculate/Calculator.cc:4802 #: ../libqalculate/Calculator.cc:4814 ../libqalculate/Calculator.cc:4839 #: ../libqalculate/Calculator.cc:4865 #, c-format msgid "Misplaced operator(s) \"%s\" ignored" msgstr "Malplacerad(e) \"%s\" ignorerades" #: ../libqalculate/Calculator.cc:4180 ../libqalculate/Calculator.cc:4889 #, c-format msgid "Misplaced '%c' ignored" msgstr "Malplacerat '%c' ignorerades" #: ../libqalculate/Calculator.cc:4207 ../libqalculate/Function.cc:1253 #: ../libqalculate/Function.cc:1284 #, c-format msgid "Internal id %s does not exist." msgstr "Internt id %s finns inte." #: ../libqalculate/Calculator.cc:4225 #, c-format msgid "\"%s\" is not a valid variable/function/unit." msgstr "\"%s\" motsvarar inte någon giltig variabel/funktion/enhet." #: ../libqalculate/Calculator.cc:4240 #, c-format msgid "" "Trailing characters \"%s\" (not a valid variable/function/unit) in number \"%" "s\" was ignored." msgstr "" "Överblivna tecken i uttrycket \"%s\" (inte någon giltig variabel/funktion/" "enhet) ignorerades i talet \"%s\"." #: ../libqalculate/Calculator.cc:4630 msgid "RPN syntax error. Values left at the end of the RPN expression." msgstr "RPN syntaxfel. Värden kvar i slutet av RPN uttryck." #: ../libqalculate/Calculator.cc:4633 msgid "Unused stack values." msgstr "Oanvända stackvärden." #: ../libqalculate/Calculator.cc:4695 msgid "RPN syntax error. Stack is empty." msgstr "RPN syntaxfel. Stacken är tom." #: ../libqalculate/Calculator.cc:4697 msgid "RPN syntax error. Operator ignored as there where only one stack value." msgstr "" "RPN syntaxfel. Operatorn ignorerades eftersom det enbart fanns ett " "stackvärde kvar." #: ../libqalculate/Calculator.cc:5056 #, c-format msgid "Name \"%s\" is in use. Replacing with \"%s\"." msgstr "Namnet \"%s\" är upptaget. Ändrar till \"%s\"." #: ../libqalculate/Calculator.cc:5715 ../libqalculate/DataSet.cc:498 #, c-format msgid "File not identified as Qalculate! definitions file: %s." msgstr "Filen identifierades inte som en Qalculate! definitionsfil: %s." #: ../libqalculate/Calculator.cc:7663 ../libqalculate/DataSet.cc:352 msgid "Object" msgstr "Objekt" #: ../libqalculate/Calculator.cc:7672 ../libqalculate/DataSet.cc:353 msgid "Property" msgstr "Egenskap" #: ../libqalculate/Calculator.cc:7965 msgid "column" msgstr "kolumn" #: ../libqalculate/Calculator.cc:7968 msgid "Column " msgstr "Kolumn" #: ../libqalculate/Calculator.cc:8132 msgid "Failed to download exchange rates from ECB." msgstr "Misslyckades med att ladda ner växelkurser från ECB." #: ../libqalculate/Calculator.cc:8150 msgid "" "It has been more than one week since the exchange rates last were updated." msgstr "Det var mer än en vecka sedan växelkurserna senast updaterades." #: ../libqalculate/Calculator.cc:8187 ../libqalculate/Calculator.cc:8201 msgid "Unable to generate plot data with current min, max and sampling rate." msgstr "Kunde inte generera diagramdata med angivet min, max och frekvens." #: ../libqalculate/Calculator.cc:8217 ../libqalculate/Calculator.cc:8231 msgid "Unable to generate plot data with current min, max and step size." msgstr "Kunde inte generera diagramdata med angivet min, max och stegstorlek." #: ../libqalculate/Calculator.cc:8280 msgid "No extension in file name. Saving as PNG image." msgstr "Inget tillägg i filnamnet. Sparar som PNG-bild." #: ../libqalculate/Calculator.cc:8297 msgid "Unknown extension in file name. Saving as PNG image." msgstr "Okänt tillägg i filnamnet. Sparar som PNG-bild." #: ../libqalculate/Calculator.cc:8489 #, c-format msgid "Could not create temporary file %s" msgstr "Kunde inte skapa temporär fil %s" #: ../libqalculate/Calculator.cc:8525 #, c-format msgid "" "Series %s contains non-numerical data (\"%s\" first of %s) which can not be " "properly plotted." msgstr "" "Dataserie %s innehåller värden som inte är numeriska (\"%s\" först av %s) " "och inte kan visas korrekt." #: ../libqalculate/Calculator.cc:8527 #, c-format msgid "" "Series %s contains non-real data (\"%s\" first of %s) which can not be " "properly plotted." msgstr "" "Dataserie %s innehåller värden som inte är reella (\"%s\" först av %s) och " "inte kan visas korrekt." #: ../libqalculate/Calculator.cc:8552 msgid "" "Failed to invoke gnuplot. Make sure that you have gnuplot installed in your " "path." msgstr "" "Misslyckades med att aktivera gnuplot. Se till att du har gnuplot " "installerat i sökvägen för program." #: ../libqalculate/DataSet.cc:378 #, c-format msgid "Object %s not available in data set." msgstr "Okjektet %s finns inte i dataset." #: ../libqalculate/DataSet.cc:388 #, c-format msgid "Property %s not available in data set." msgstr "Egenskap %s är inte tillgänglig i dataset." #: ../libqalculate/DataSet.cc:393 #, c-format msgid "Property %s not defined for object %s." msgstr "Egenskap %s inte definierad för objekt %s." #: ../libqalculate/DataSet.cc:476 ../libqalculate/DataSet.cc:484 #, c-format msgid "Unable to load data objects in %s." msgstr "Kunde inhämte dataobjekt i %s." #: ../libqalculate/DataSet.cc:996 msgid "data property" msgstr "dataegenskap" #: ../libqalculate/DataSet.cc:998 msgid "name of a data property" msgstr "namn på dataegenskap" #: ../libqalculate/DataSet.cc:1006 ../libqalculate/DataSet.cc:1022 msgid "no properties available" msgstr "inga egenskaper tillgängliga" #: ../libqalculate/DataSet.cc:1056 #, c-format msgid "" "Data set \"%s\" has no object key that supports the provided argument type." msgstr "" "Dataset \"%s\" har ingen objektnyckel som stödjer tillhandahållen argumenttyp" #: ../libqalculate/DataSet.cc:1061 msgid "data object" msgstr "dataobjekt" #: ../libqalculate/DataSet.cc:1063 msgid "an object from" msgstr "ett objekt från" #: ../libqalculate/DataSet.cc:1092 msgid "use" msgstr "använd" #: ../libqalculate/MathStructure.cc:92 ../libqalculate/MathStructure.cc:113 #: ../libqalculate/MathStructure.cc:143 #, c-format msgid "To avoid division by zero, the following must be true: %s." msgstr "För att undvika division med noll, krävs att följande är sant: %s." #: ../libqalculate/MathStructure.cc:2450 #, c-format msgid "" "The second matrix must have as many rows (was %s) as the first has columns " "(was %s) for matrix multiplication." msgstr "" "Den andra matrisen måste ha lika många rader (var %s) som den första har " "kolumner (var %s) för matrismultiplikation." #. for(size_t i = 0; i < mcopy.size(); i++) { #. std::cout << "MCOPY " << i << ": " << mcopy[i].print() << std::endl; #. for(size_t i2 = 0; i2 < mcopy[i].size(); i2++) { #. std::cout << "MCOPY " << i << "-" << i2 << ": " << mcopy[i][i2].print() << std::endl; #. } #. } #. for(size_t i = 0; i < mcopy2.size(); i++) { #. std::cout << "MCOPY2 " << i << ": " << mcopy2[i].print() << std::endl; #. for(size_t i2 = 0; i2 < mcopy2[i].size(); i2++) { #. std::cout << "MCOPY2 " << i << "-" << i2 << ": " << mcopy2[i][i2].print() << std::endl; #. } #. } #. std::cout << "WRONG! this: " << print() << " copy: " << mcopy.print() << " copy2: " << mcopy2.print() << std::endl; #: ../libqalculate/MathStructure.cc:4980 ../libqalculate/MathStructure.cc:5021 #: ../libqalculate/MathStructure.cc:5054 ../libqalculate/MathStructure.cc:5110 #: ../libqalculate/MathStructure.cc:5130 ../libqalculate/MathStructure.cc:5149 #: ../libqalculate/MathStructure.cc:5168 ../libqalculate/MathStructure.cc:5187 #: ../libqalculate/MathStructure.cc:5276 ../libqalculate/MathStructure.cc:8486 #: ../libqalculate/MathStructure.cc:8497 ../libqalculate/MathStructure.cc:8576 msgid "This is a bug. Please report it." msgstr "Detta är en bug. Var vänlig rapportera felet." #: ../libqalculate/MathStructure.cc:11368 msgid "undefined" msgstr "odefinierad" #: ../libqalculate/MathStructure.cc:11407 #, c-format msgid "Unsolvable comparison at element %s when trying to rank vector." msgstr "Olöslig jämförelse vid element %s, vid rangordning av vektor." #: ../libqalculate/MathStructure.cc:11455 #, c-format msgid "Unsolvable comparison at element %s when trying to sort vector." msgstr "Olöslig jämförelse vid element %s, vid sortering av vektor." #: ../libqalculate/MathStructure.cc:11880 msgid "The determinant can only be calculated for square matrices." msgstr "Determinanten kan enbart beräknas för kvadratiska matriser." #: ../libqalculate/MathStructure.cc:11943 msgid "The permanent can only be calculated for square matrices." msgstr "Permanenten kan enbart beräknas för kvadratiska matriser." #: ../libqalculate/MathStructure.cc:12032 msgid "Inverse of singular matrix." msgstr "Invers av singulär matrs." #: ../libqalculate/Function.cc:113 #, c-format msgid "%s() requires that %s" msgstr "%s() kräver att %s" #: ../libqalculate/Function.cc:266 ../libqalculate/Function.cc:323 #: ../libqalculate/Function.cc:382 #, c-format msgid "" "Additional arguments for function %s() was ignored. Function can only use %s " "argument(s)." msgstr "" "Övertaliga parametrar för funktionen %s() ignorerades. Funktionen kan inte " "använda fler än %s parametrar." #: ../libqalculate/Function.cc:403 #, c-format msgid "You need at least %s argument(s) (%s) in function %s()." msgstr "Det krävs minst %s parametrar (%s) i funktionen %s()." #: ../libqalculate/Function.cc:405 #, c-format msgid "You need at least %s argument(s) in function %s()." msgstr "Det krävs minst %s parametrar i funktionen %s()." #: ../libqalculate/Function.cc:1096 msgid "a free value" msgstr "ett valfritt värde" #: ../libqalculate/Function.cc:1101 msgid "that is nonzero" msgstr "som är icke-noll" #: ../libqalculate/Function.cc:1109 msgid "that is rational (polynomial)" msgstr "som är rationellt (polynom)" #: ../libqalculate/Function.cc:1117 msgid "that fulfills the condition:" msgstr "som uppfyller villkoret:" #: ../libqalculate/Function.cc:1120 msgid "Argument" msgstr "Parameter" #: ../libqalculate/Function.cc:1175 #, c-format msgid "Argument %s in %s() must be %s." msgstr "Parameter %s i %s() måste vara %s." #: ../libqalculate/Function.cc:1177 #, c-format msgid "Argument %s, %s, in %s() must be %s." msgstr "Parameter %s, %s, i %s() måste vara %s." #: ../libqalculate/Function.cc:1504 msgid "a rational number" msgstr "ett rationellt nummer" #: ../libqalculate/Function.cc:1506 msgid "a number" msgstr "ett nummer" #: ../libqalculate/Function.cc:1508 msgid "a real number" msgstr "ett reellt nummer" #: ../libqalculate/Function.cc:1513 ../libqalculate/Function.cc:1660 msgid ">=" msgstr ">=" #: ../libqalculate/Function.cc:1515 msgid ">" msgstr ">" #: ../libqalculate/Function.cc:1527 ../libqalculate/Function.cc:1670 msgid "<=" msgstr "<=" #: ../libqalculate/Function.cc:1529 msgid "<" msgstr "<" #: ../libqalculate/Function.cc:1657 msgid "an integer" msgstr "ett heltal" #: ../libqalculate/Function.cc:1688 msgid "symbol" msgstr "symbol" #: ../libqalculate/Function.cc:1689 msgid "an unknown variable/symbol" msgstr "en okänd variabel/symbol" #: ../libqalculate/Function.cc:1702 msgid "text" msgstr "text" #: ../libqalculate/Function.cc:1703 msgid "a text string" msgstr "en textsträng" #: ../libqalculate/Function.cc:1718 msgid "date" msgstr "datum" #: ../libqalculate/Function.cc:1719 msgid "a date" msgstr "ett datum" #: ../libqalculate/Function.cc:1765 msgid "a vector with " msgstr "en vektor med " #: ../libqalculate/Function.cc:1777 msgid "a vector" msgstr "en vektor" #: ../libqalculate/Function.cc:1826 msgid "a square matrix" msgstr "en kvadratisk matris" #: ../libqalculate/Function.cc:1828 msgid "a matrix" msgstr "en matris" #: ../libqalculate/Function.cc:1843 msgid "object" msgstr "objekt" #: ../libqalculate/Function.cc:1844 msgid "a valid function, unit or variable name" msgstr "ett giltigt funktions, enhets eller variabelnamn" #: ../libqalculate/Function.cc:1857 msgid "function" msgstr "funktion" #: ../libqalculate/Function.cc:1858 msgid "a valid function name" msgstr "ett giltigt funktionsnamn" #: ../libqalculate/Function.cc:1871 msgid "unit" msgstr "enhet" #: ../libqalculate/Function.cc:1872 msgid "a valid unit name" msgstr "ett giltigt enhetsnamn" #: ../libqalculate/Function.cc:1885 msgid "variable" msgstr "variabel" #: ../libqalculate/Function.cc:1886 msgid "a valid variable name" msgstr "ett giltigt variabelnamn" #: ../libqalculate/Function.cc:1899 msgid "file" msgstr "fil" #: ../libqalculate/Function.cc:1900 msgid "a valid file name" msgstr "ett giltigt filnamn" #: ../libqalculate/Function.cc:1913 msgid "boolean" msgstr "boolskt värde" #: ../libqalculate/Function.cc:1914 msgid "a boolean (0 or 1)" msgstr "ett boolskt värde (0 eller 1)" #: ../libqalculate/Function.cc:1924 msgid "angle" msgstr "vinkel" #: ../libqalculate/Function.cc:1925 msgid "an angle or a number (using the default angle unit)" msgstr "en vinkel eller ett tal (som använder inställd vinkelenhet)" #: ../libqalculate/Number.cc:127 msgid "" "Cannot display numbers greater than 9999 or less than -9999 as roman " "numerals." msgstr "" "Kan inte visa tal större än 9999 eller mindre än -9999 som romerska siffror." #: ../libqalculate/Number.cc:215 msgid "" "Assuming the unusual practice of letting a last capital I mean 2 in a roman " "numeral." msgstr "Antar att ett sista stort I avses betyda 2." #: ../libqalculate/Number.cc:293 #, c-format msgid "Error in roman numerals: %s." msgstr "Fel i romerska siffor: \"%s\"." #: ../libqalculate/Number.cc:328 #, c-format msgid "Unknown roman numeral: %c." msgstr "Okänd romersk siffra: %c." #: ../libqalculate/Number.cc:386 #, c-format msgid "" "Errors in roman numerals: \"%s\". Interpreted as %s, which should be written " "as %s." msgstr "" "Fel i romerska siffor: \"%s\". Tolkat som %s, vilket borde skrivits %s." #: ../libqalculate/Number.cc:471 msgid "':' in decimal number ignored (decimal point detected)." msgstr "':' i decimalt tal ignorerades (decimalkomma upptäckt)." #: ../libqalculate/Number.cc:487 msgid "Decimal point in sexagesimal number treated as ':'." msgstr "Decimalkomma i sexagesimala tal behandlas som ':'." #: ../libqalculate/Number.cc:505 #, c-format msgid "Character '%c' was ignored in the number \"%s\" with base %s." msgstr "Tecken '%c' ignorerades i numret \"%s\" med bas %s" #: ../libqalculate/Number.cc:1427 msgid "Division by zero." msgstr "Division med noll." #. 0^0 #: ../libqalculate/Number.cc:1433 msgid "0^0 might be considered undefined" msgstr "0^0 kan anses vara odefinierat" #: ../libqalculate/Number.cc:1732 msgid "Can only handle Riemann Zeta with an integer argument (s) >= 1" msgstr "Kan enbart hantera Riemann Zeta med en heltalsparameter (s) >= 1" #: ../libqalculate/Number.cc:1738 msgid "Cannot handle an argument (s) that large for Riemann Zeta." msgstr "" "Kan inte hantera ett så stort tal för parametern (s) till Riemann Zeta." #: ../libqalculate/Number.cc:2628 ../libqalculate/Number.cc:2636 #: ../libqalculate/Number.cc:2645 msgid "infinity" msgstr "oändlighet" #: ../libqalculate/Unit.cc:760 msgid "Error(s) in unitexpression." msgstr "Fel i enhetsuttryck." #: ../libqalculate/util.cc:559 msgid "Yes" msgstr "Ja" #: ../libqalculate/util.cc:560 msgid "No" msgstr "Nej" #: ../libqalculate/util.cc:567 msgid "True" msgstr "Sant" #: ../libqalculate/util.cc:568 msgid "False" msgstr "Falskt" #: ../libqalculate/util.cc:575 msgid "On" msgstr "På" #: ../libqalculate/util.cc:576 msgid "Off" msgstr "Av" #~ msgid "Switches RPN mode on/off." #~ msgstr "Sätter RPN-läget av/på." #~ msgid "Only equals comparison is allowed in the equations in %s()." #~ msgstr "Enbart lika-med-jäförelser är tillåtna i ekvationer i %s()." #~ msgid "a symmetric matrix" #~ msgstr "en symmetrisk matris" #~ msgid "Integral point for Riemann's zeta must be an integer > 1." #~ msgstr "Integralpunkten för Riemanns zeta måste vara ett heltal > 1." #~ msgid "Integral point for Riemann's zeta is too large." #~ msgstr "Integralpunkten för Riemanns zeta är för stor." #~ msgid "" #~ "No comparison to solve. The reason might be:\n" #~ "\n" #~ "1. The entered expression to solve is not correct (ex. \"x + 5 = 3\" is " #~ "correct)\n" #~ "\n" #~ "2. The expression evaluates FALSE. There is no valid solution with the " #~ "current assumptions (ex. \"x = -5\" with x assumed positive).\n" #~ "\n" #~ "3. The expression evaluates TRUE (ex. \"2x = 2x\")" #~ msgstr "" #~ "Ingen jämförelse att lösa. Anledningen kan vara en av:\n" #~ "\n" #~ "1. Angivet uttryck att lösa är inte korrekt (ex. \"x + 5 = 3\" är " #~ "korrekt)\n" #~ "\n" #~ "2. Uttrycket evalueras som FALSKT. Det finns ingen giltig lösning med " #~ "nuvarande antaganden (ex. \"x = -5\" med x antaget positivt).\n" #~ "\n" #~ "3. Uttryckes evalueras som SANT (ex. \"2x = 2x\")" #~ msgid "Unknowns" #~ msgstr "Okända" libqalculate-0.9.7/INSTALL0000644000175100017510000002202411305546371012152 00000000000000Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. libqalculate-0.9.7/AUTHORS0000644000175100017510000000004111305546371012164 00000000000000Niklas Knutsson libqalculate-0.9.7/configure.in0000644000175100017510000001731511320653617013440 00000000000000dnl dnl configure.in for libqalculate dnl dnl ---------------------- dnl | initialize autotools |--------------------------------------------------- dnl ---------------------- AC_INIT(configure.in) AM_INIT_AUTOMAKE(libqalculate, 0.9.7) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_ARG_ENABLE(textport, [ --disable-textport Disable compiling the text port], enable_textport=$enableval, enable_textport="yes") AC_ARG_ENABLE(defs2doc, [ --enable-defs2doc Enable compiling the definitions documentation generator], enable_defs2doc=$enableval, enable_defs2doc="no") dnl ------------------------------- dnl | check for neccessary programs |------------------------------------------ dnl ------------------------------- AC_ISC_POSIX AC_PROG_CC AC_PROG_CXX AM_PROG_CC_STDC AC_PROG_LN_S AC_HEADER_STDC AC_PROG_INTLTOOL AM_PROG_LIBTOOL dnl ------------------------------------ dnl | check for compiler characteristics |------------------------------------- dnl ------------------------------------ dnl Replace -Os with -O2 to stop segfault on startup if test "x$GCC" = "xyes"; then case $CFLAGS in *-Os*) CFLAGS="$CFLAGS -O2" ;; esac case $CXXFLAGS in *-Os*) CXXFLAGS="$CXXFLAGS -O2" ;; esac fi dnl Use -Wall if we have gcc. changequote(,)dnl if test "x$GCC" = "xyes"; then case " $CFLAGS " in *[\ \ ]-Wall[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wall" ;; esac fi changequote([,])dnl dnl libtool versioning for libqalculate dnl increment if the interface has additions, changes, removals. QALCULATE_CURRENT=5 dnl increment any time the source changes; set to dnl 0 if you increment CURRENT QALCULATE_REVISION=0 dnl increment if any interfaces have been added; set to 0 dnl if any interfaces have been removed. removal has dnl precedence over adding, so set to 0 if both happened. QALCULATE_AGE=0 AC_SUBST(QALCULATE_CURRENT) AC_SUBST(QALCULATE_REVISION) AC_SUBST(QALCULATE_AGE) dnl -------------------------------- dnl | check for neccessary libraries |----------------------------------------- dnl -------------------------------- AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"]) AC_LANG([C++]) PKG_CHECK_MODULES(GLIB, [ glib-2.0 libxml-2.0 >= 2.3.8 ]) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) PKG_CHECK_MODULES(CLN, [ cln >= 1.2 ], [have_recent_cln=yes], [have_recent_cln=no]) AC_SUBST(CLN_CPPFLAGS) AC_SUBST(CLN_LIBS) if test "$have_recent_cln" = "yes" ; then AC_DEFINE(HAVE_RECENT_CLN, 1, [Define if CLN can be used]) LIBS="$LIBS $CLN_LIBS" CPPFLAGS="$CPPFLAGS $CLN_CPPFLAGS" fi dnl -------------------------------- dnl | check for readline |----------------------------------------- dnl -------------------------------- QALCULATE_TEXT="" LN_QALCULATE="" USE_READLINE="yes" READLINE_LIBS="" if test "x$enable_textport" = "xyes" ; then QALCULATE_TEXT="qalc" LN_QALCULATE="qalc" AC_MSG_CHECKING([whether to use readline]) AC_ARG_WITH(readline, [ --with-readline turn on readline [default=yes, default tries -lncurses, -lcurses, -ltermcap]], [case "${withval}" in yes) USE_READLINE="yes" ; AC_MSG_RESULT([yes]) ;; no) USE_READLINE="no" ; AC_MSG_RESULT([no]) ;; only) USE_READLINE="yes" EXTRA_LIBREADLINE_DEPS=" " AC_MSG_RESULT([yes (using only readline)]) ;; *) USE_READLINE="yes" EXTRA_LIBREADLINE_DEPS="${withval}" AC_MSG_RESULT([yes (using extra libraries ${withval})]) ;; esac],[AC_MSG_RESULT([${USE_READLINE}])]) dnl Checks for libraries. dnl When checking readline, check using extra libraries first. dnl We want to protect against the link somehow succeeding, but only dnl failing at runtime, as seems to happen on some BSD systems. if test "$USE_READLINE" = yes ; then AC_CHECK_HEADERS(readline/readline.h readline/history.h) if test "x${ac_cv_header_readline_readline_h}" != "xyes" -o "x${ac_cv_header_readline_history_h}" != "xyes"; then AC_MSG_WARN([Could not find the headers for libreadline.]) else if test "$EXTRA_LIBREADLINE_DEPS" = "" ; then unset ac_cv_lib_readline_readline AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, HAVE_LIBREADLINE=false, -lncurses) if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -lncurses" EXTRA_LIBREADLINE_DEPS=-lncurses AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) else unset ac_cv_lib_readline_readline AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, HAVE_LIBREADLINE=false, -lcurses) if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -lcurses" EXTRA_LIBREADLINE_DEPS=-lcurses AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) else unset ac_cv_lib_readline_readline AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, HAVE_LIBREADLINE=false, -ltermcap) if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -ltermcap" EXTRA_LIBREADLINE_DEPS=-ltermcap AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) else unset ac_cv_lib_readline_readline AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, HAVE_LIBREADLINE=false) if test x${HAVE_LIBREADLINE} = xtrue ; then AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) fi fi fi fi else unset ac_cv_lib_readline_readline AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, HAVE_LIBREADLINE=false, ${EXTRA_LIBREADLINE_DEPS}) if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline ${EXTRA_LIBREADLINE_DEPS}" AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) fi fi if test x${HAVE_LIBREADLINE} = xtrue; then READLINE_LIBS="-lreadline -lhistory ${EXTRA_LIBREADLINE_DEPS}" else AC_MSG_WARN([Could not find libreadline.]) fi fi fi fi AC_SUBST(READLINE_LIBS) AC_SUBST(QALCULATE_TEXT) AC_SUBST(LN_QALCULATE) QALCULATE_DEFS2DOC="" if test "x$enable_defs2doc" = "xyes" ; then QALCULATE_DEFS2DOC="defs2doc" fi AC_SUBST(QALCULATE_DEFS2DOC) dnl ------------------------------------- dnl | internationalization (i18n) support |------------------------------------ dnl ------------------------------------- GETTEXT_PACKAGE=libqalculate AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The package name for gettext]) dnl Please keep this in alphabetical order ALL_LINGUAS="fr nl sv zh_CN" AM_GLIB_GNU_GETTEXT dnl AM_GLIB_GNU_GETTEXT sets $DATADIRNAME AC_MSG_CHECKING(locale directory) if test "x$prefix" = "xNONE"; then PACKAGE_LOCALE_DIR=$ac_default_prefix/share/locale else PACKAGE_LOCALE_DIR=$prefix/share/locale fi AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "$PACKAGE_LOCALE_DIR", [The directory in which qalculate's locale data will be stored]) AC_MSG_RESULT("$PACKAGE_LOCALE_DIR") INTLTOOL_QALCULATE_DEFINITIONS_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po-defs/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po-defs/.intltool-merge-cache $(top_srcdir)/po-defs $< [$]@' AC_SUBST(INTLTOOL_QALCULATE_DEFINITIONS_RULE) dnl -------- dnl | output |----------------------------------------------------------------- dnl -------- AC_OUTPUT([ Makefile src/Makefile libqalculate/Makefile data/Makefile po/Makefile.in po-defs/Makefile docs/Makefile docs/reference/Makefile libqalculate.pc ]) libqalculate-0.9.7/src/0000777000175100017510000000000011320655050011764 500000000000000libqalculate-0.9.7/src/qalc.cc0000644000175100017510000033036711320654011013137 00000000000000/* Qalculate Copyright (C) 2004-2007 Niklas Knutsson (nq@altern.org) 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. */ #include "support.h" #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_LIBREADLINE #include #include #endif MathStructure *mstruct, *parsed_mstruct; KnownVariable *vans[5]; string result_text, parsed_text; bool load_global_defs, fetch_exchange_rates_at_startup, first_time, first_qalculate_run, save_mode_on_exit, save_defs_on_exit; PrintOptions printops, saved_printops; EvaluationOptions evalops, saved_evalops; AssumptionType saved_assumption_type; AssumptionSign saved_assumption_sign; int saved_precision; FILE *view_pipe_r, *view_pipe_w, *command_pipe_r, *command_pipe_w; pthread_t view_thread, command_thread; pthread_attr_t view_thread_attr, command_thread_attr; bool command_aborted = false, command_thread_started; bool b_busy = false; string expression_str; bool expression_executed = false; bool rpn_mode; bool result_only; fd_set in_set; struct timeval timeout; char buffer[1000]; void *view_proc(void *pipe); void *command_proc(void *pipe); void execute_expression(bool goto_input = true, bool do_mathoperation = false, MathOperation op = OPERATION_ADD, MathFunction *f = NULL, bool do_stack = false, size_t stack_index = 0); void execute_command(int command_type); void load_preferences(); bool save_preferences(bool mode = false); bool save_mode(); void set_saved_mode(); bool save_defs(); void result_display_updated(); void result_format_updated(); void result_action_executed(); void result_prefix_changed(Prefix *prefix = NULL); void expression_format_updated(); FILE *cfile; enum { COMMAND_FACTORIZE, COMMAND_SIMPLIFY }; #define EQUALS_IGNORECASE_AND_LOCAL(x,y,z) (equalsIgnoreCase(x, y) || equalsIgnoreCase(x, z)) bool contains_unicode_char(const char *str) { for(int i = strlen(str) - 1; i >= 0; i--) { if(str[i] < 0) return true; } return false; } #define PUTS_UNICODE(x) if(printops.use_unicode_signs || !contains_unicode_char(x)) {puts(x);} else {gchar *gstr = g_locale_from_utf8(x, -1, NULL, NULL, NULL); if(gstr) {puts(gstr); g_free(gstr);} else {puts(x);}} #define FPUTS_UNICODE(x, y) if(printops.use_unicode_signs || !contains_unicode_char(x)) {fputs(x, y);} else {gchar *gstr = g_locale_from_utf8(x, -1, NULL, NULL, NULL); if(gstr) {fputs(gstr, y); g_free(gstr);} else {fputs(x, y);}} size_t unicode_length_check(const char *str) { if(printops.use_unicode_signs) return unicode_length(str); return strlen(str); } int s2b(const string &str) { if(str.empty()) return -1; if(EQUALS_IGNORECASE_AND_LOCAL(str, "yes", _("yes"))) return 1; if(EQUALS_IGNORECASE_AND_LOCAL(str, "no", _("no"))) return 0; if(EQUALS_IGNORECASE_AND_LOCAL(str, "true", _("true"))) return 1; if(EQUALS_IGNORECASE_AND_LOCAL(str, "false", _("false"))) return 0; if(EQUALS_IGNORECASE_AND_LOCAL(str, "on", _("on"))) return 1; if(EQUALS_IGNORECASE_AND_LOCAL(str, "off", _("off"))) return 0; if(str.find_first_not_of(SPACES NUMBERS) != string::npos) return -1; int i = s2i(str); if(i > 0) return 1; return 0; } bool is_answer_variable(Variable *v) { return v == vans[0] || v == vans[1] || v == vans[2] || v == vans[3] || v == vans[4]; } bool equalsIgnoreCaseFirst(const string &str1, const char *str2) { if(str1.length() < 1 || strlen(str2) < 1) return false; if(str1[0] < 0 && str1.length() > 1) { if(str2[0] >= 0) return false; size_t i2 = 1; while(i2 < str1.length() && str1[i2] < 0) { if(i2 >= strlen(str2) || str2[i2] >= 0) return false; i2++; } if(i2 != str1.length()) return false; gchar *gstr1 = g_utf8_strdown(str1.c_str(), i2); gchar *gstr2 = g_utf8_strdown(str2, i2); if(strcmp(gstr1, gstr2) != 0) return false; g_free(gstr1); g_free(gstr2); } else if(str1.length() != 1 || (str1[0] != str2[0] && !((str1[0] >= 'a' && str1[0] <= 'z') && str1[0] - 32 == str2[0]) && !((str1[0] <= 'Z' && str1[0] >= 'A') && str1[0] + 32 == str2[0]))) { return false; } return true; } bool ask_question(const char *question) { FPUTS_UNICODE(question, stdout); while(true) { #ifdef HAVE_LIBREADLINE char *rlbuffer = readline(" "); string str = rlbuffer; free(rlbuffer); #else fputs(" ", stdout); fgets(buffer, 1000, stdin); string str = buffer; #endif remove_blank_ends(str); if(equalsIgnoreCaseFirst(str, "yes") || equalsIgnoreCaseFirst(str, _("yes")) || EQUALS_IGNORECASE_AND_LOCAL(str, "yes", _("yes"))) { return true; } else if(equalsIgnoreCaseFirst(str, "no") || equalsIgnoreCaseFirst(str, _("no")) || EQUALS_IGNORECASE_AND_LOCAL(str, "no", _("no"))) { return false; } else { FPUTS_UNICODE(_("Please answer yes or no"), stdout); FPUTS_UNICODE(":", stdout); } } } void set_assumption(const string &str, bool first_of_two = false) { if(EQUALS_IGNORECASE_AND_LOCAL(str, "unknown", _("unknown"))) { if(first_of_two) { CALCULATOR->defaultAssumptions()->setSign(ASSUMPTION_SIGN_UNKNOWN); } else { CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_NONE); } } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "none", _("none"))) { CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_NONE); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "non-matrix", _("non-matrix"))) { CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_NONMATRIX); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "complex", _("complex"))) { CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_COMPLEX); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "real", _("real"))) { CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_REAL); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "number", _("number"))) { CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_NUMBER); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "rational", _("rational"))) { CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_RATIONAL); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "integer", _("integer"))) { CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_INTEGER); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "non-zero", _("non-zero"))) { CALCULATOR->defaultAssumptions()->setSign(ASSUMPTION_SIGN_NONZERO); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "positive", _("positive"))) { CALCULATOR->defaultAssumptions()->setSign(ASSUMPTION_SIGN_POSITIVE); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "non-negative", _("non-negative"))) { CALCULATOR->defaultAssumptions()->setSign(ASSUMPTION_SIGN_NONNEGATIVE); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "negative", _("negatve"))) { CALCULATOR->defaultAssumptions()->setSign(ASSUMPTION_SIGN_NEGATIVE); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "non-positive", _("non-positive"))) { CALCULATOR->defaultAssumptions()->setSign(ASSUMPTION_SIGN_NONPOSITIVE); } else { PUTS_UNICODE(_("Unrecognized assumption.")); } } vector matches; #ifdef __cplusplus extern "C" { #endif #ifdef HAVE_LIBREADLINE char *qalc_completion(const char *text, int index) { if(index == 0) { if(strlen(text) < 1) return NULL; matches.clear(); const string *str; bool b_match; size_t l = strlen(text); for(size_t i = 0; i < CALCULATOR->functions.size(); i++) { if(CALCULATOR->functions[i]->isActive()) { str = &CALCULATOR->functions[i]->preferredInputName(printops.abbreviate_names, printops.use_unicode_signs).name; if(l <= str->length()) { b_match = true; for(size_t i2 = 0; i2 < l; i2++) { if((*str)[i2] != text[i2]) { b_match = false; break; } } if(b_match) { matches.push_back(str); } } } } for(size_t i = 0; i < CALCULATOR->variables.size(); i++) { if(CALCULATOR->variables[i]->isActive()) { str = &CALCULATOR->variables[i]->preferredInputName(printops.abbreviate_names, printops.use_unicode_signs).name; if(l <= str->length()) { b_match = true; for(size_t i2 = 0; i2 < l; i2++) { if((*str)[i2] != text[i2]) { b_match = false; break; } } if(b_match) { matches.push_back(str); } } } } for(size_t i = 0; i < CALCULATOR->units.size(); i++) { if(CALCULATOR->units[i]->isActive() && CALCULATOR->units[i]->subtype() != SUBTYPE_COMPOSITE_UNIT) { str = &CALCULATOR->units[i]->preferredInputName(printops.abbreviate_names, printops.use_unicode_signs).name; if(l <= str->length()) { b_match = true; for(size_t i2 = 0; i2 < l; i2++) { if((*str)[i2] != text[i2]) { b_match = false; break; } } if(b_match) { matches.push_back(str); } } } } } if(index >= 0 && index < (int) matches.size()) { char *cstr = (char*) malloc(sizeof(char) *matches[index]->length() + 1); strcpy(cstr, matches[index]->c_str()); return cstr; } return NULL; } #endif #ifdef __cplusplus } #endif int enable_unicode = -1; void handle_exit() { if(enable_unicode >= 0) { printops.use_unicode_signs = enable_unicode; } if(!cfile) { if(save_mode_on_exit) { save_mode(); } else { save_preferences(); } if(save_defs_on_exit) { save_defs(); } } pthread_cancel(view_thread); CALCULATOR->terminateThreads(); } #ifdef HAVE_LIBREADLINE int rlcom_tab(int, int) { rl_complete_internal('!'); return 0; } #endif int countRows(const char *str, int cols) { int l = unicode_length_check(str); if(l == 0) return 1; int r = 1, c = 0; for(int i = 0; i < l; i++) { if(str[i] == '\n') { r++; c = 0; } else { if(c == cols) { r++; c = 0; } c++; } } return r; } #ifdef HAVE_LIBREADLINE # define CHECK_IF_SCREEN_FILLED if(!cfile) {rcount++; if(rcount + 3 >= rows) {FPUTS_UNICODE(_("\nPress Enter to continue."), stdout); fflush(stdout); rl_read_key(); puts(""); rcount = 1;}} # define CHECK_IF_SCREEN_FILLED_PUTS(x) if(!cfile) {rcount += countRows(x, cols); if(rcount + 2 >= rows) {FPUTS_UNICODE(_("\nPress Enter to continue."), stdout); fflush(stdout); rl_read_key(); puts(""); rcount = 1;}} PUTS_UNICODE(x); # define INIT_SCREEN_CHECK int rows, cols, rcount = 0; if(!cfile) rl_get_screen_size(&rows, &cols); #else # define CHECK_IF_SCREEN_FILLED # define CHECK_IF_SCREEN_FILLED_PUTS(x) PUTS_UNICODE(x); # define INIT_SCREEN_CHECK #endif #define SET_BOOL(x) {int v = s2b(svalue); if(v < 0) {PUTS_UNICODE(_("Illegal value"));} else {x = v;}} #define SET_BOOL_D(x) {int v = s2b(svalue); if(v < 0) {PUTS_UNICODE(_("Illegal value"));} else {x = v; result_display_updated();}} #define SET_BOOL_E(x) {int v = s2b(svalue); if(v < 0) {PUTS_UNICODE(_("Illegal value"));} else {x = v; expression_format_updated();}} void set_option(string str) { remove_blank_ends(str); string svalue, svar; size_t index; if((index = str.find_first_of(SPACES)) != string::npos) { svalue = str.substr(index + 1, str.length() - (index + 1)); remove_blank_ends(svalue); } svar = str.substr(0, index); remove_blank_ends(svar); gsub("_", " ", svar); set_option_place: if(EQUALS_IGNORECASE_AND_LOCAL(svar, "base", _("base")) || EQUALS_IGNORECASE_AND_LOCAL(svar, "input base", _("input base")) || EQUALS_IGNORECASE_AND_LOCAL(svar, "output base", _("output base"))) { int v = 0; bool b_in = EQUALS_IGNORECASE_AND_LOCAL(svar, "input base", _("input base")); if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "roman", _("roman"))) v = BASE_ROMAN_NUMERALS; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "time", _("time"))) {if(b_in) v = 0; else v = BASE_TIME;} else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "hex", _("hex")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "hexadecimal", _("hexadecimal"))) v = BASE_HEXADECIMAL; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "bin", _("bin")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "binary", _("binary"))) v = BASE_BINARY; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "oct", _("oct")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "octal", _("octal"))) v = BASE_HEXADECIMAL; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "dec", _("dec")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "decimal", _("decimal"))) v = BASE_DECIMAL; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "sex", _("sex")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "sexagesimal", _("sexagesimal"))) {if(b_in) v = 0; else v = BASE_SEXAGESIMAL;} else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); if((v < 2 || v > 36) && (b_in || v != 60)) { v = 0; } } if(v == 0) { if((index = svalue.find_first_of(SPACES)) != string::npos) { str = svalue; svalue = str.substr(index + 1, str.length() - (index + 1)); remove_blank_ends(svalue); svar += " "; str = str.substr(0, index); remove_blank_ends(str); svar += str; gsub("_", " ", svar); if(EQUALS_IGNORECASE_AND_LOCAL(svar, "base display", _("base display"))) { goto set_option_place; } } PUTS_UNICODE(_("Illegal base.")); } else if(b_in) { evalops.parse_options.base = v; expression_format_updated(); } else { printops.base = v; result_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "assumptions", _("assumptions"))) { size_t i = svalue.find_first_of(SPACES); if(i != string::npos) { set_assumption(svalue.substr(0, i), true); set_assumption(svalue.substr(i + 1, svalue.length() - (i + 1)), false); } else { set_assumption(svalue, false); } expression_format_updated(); } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "all prefixes", _("all prefixes"))) SET_BOOL_D(printops.use_all_prefixes) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "complex numbers", _("complex numbers"))) SET_BOOL_E(evalops.allow_complex) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "excessive parenthises", _("excessive parenthesis"))) SET_BOOL_D(printops.excessive_parenthesis) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "functions", _("functions"))) SET_BOOL_E(evalops.parse_options.functions_enabled) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "infinite numbers", _("infinite numbers"))) SET_BOOL_E(evalops.allow_infinite) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "show negative exponents", _("show negative exponents"))) SET_BOOL_D(printops.negative_exponents) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "assume nonzero denominators", _("assume nonzero denominators"))) SET_BOOL_E(evalops.assume_denominators_nonzero) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "warn nonzero denominators", _("warn nonzero denominators"))) SET_BOOL_E(evalops.warn_about_denominators_assumed_nonzero) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "prefixes", _("prefixes"))) SET_BOOL_D(printops.use_unit_prefixes) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "denominator prefixes", _("denominator prefixes"))) SET_BOOL_D(printops.use_denominator_prefix) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "place units separately", _("place units separately"))) SET_BOOL_D(printops.place_units_separately) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "calculate variables", _("calculate variables"))) SET_BOOL_E(evalops.calculate_variables) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "calculate functions", _("calculate functions"))) SET_BOOL_E(evalops.calculate_functions) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "sync units", _("sync units"))) SET_BOOL_E(evalops.sync_units) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "round to even", _("round to even"))) SET_BOOL_D(printops.round_halfway_to_even) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "rpn", _("rpn"))) {SET_BOOL(rpn_mode) if(!rpn_mode) CALCULATOR->clearRPNStack();} else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "rpn syntax", _("rpn syntax"))) SET_BOOL_E(evalops.parse_options.rpn) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "short multiplication", _("short multiplication"))) SET_BOOL_D(printops.short_multiplication) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "lowercase e", _("lowercase e"))) SET_BOOL_D(printops.lower_case_e) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "lowercase numbers", _("lowercase numbers"))) SET_BOOL_D(printops.lower_case_numbers) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "base display", _("base display"))) { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "none", _("none"))) v = BASE_DISPLAY_NONE; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "normal", _("normal"))) v = BASE_DISPLAY_NORMAL; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "alternative", _("alternative"))) v = BASE_DISPLAY_ALTERNATIVE; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { printops.base_display = (BaseDisplay) v; result_display_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "spell out logical", _("spell out logical"))) SET_BOOL_D(printops.spell_out_logical_operators) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "dot as separator", _("dot as separator"))) SET_BOOL_E(evalops.parse_options.dot_as_separator) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "limit implicit multiplication", _("limit implicit multiplication"))) { int v = s2b(svalue); if(v < 0) {PUTS_UNICODE(_("Illegal value"));} else {printops.limit_implicit_multiplication = v; evalops.parse_options.limit_implicit_multiplication = v; expression_format_updated();} } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "spacious", _("spacious"))) SET_BOOL_D(printops.spacious) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "unicode", _("unicode"))) { int v = s2b(svalue); if(v < 0) {PUTS_UNICODE(_("Illegal value"));} else {printops.use_unicode_signs = v; result_display_updated();} enable_unicode = -1; } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "units", _("units"))) SET_BOOL_E(evalops.parse_options.units_enabled) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "unknowns", _("unknowns"))) SET_BOOL_E(evalops.parse_options.unknowns_enabled) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "variables", _("variables"))) SET_BOOL_E(evalops.parse_options.variables_enabled) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "abbreviations", _("abbreviations"))) SET_BOOL_D(printops.abbreviate_names) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "show ending zeroes", _("show ending zeroes"))) SET_BOOL_D(printops.show_ending_zeroes) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "indicate infinite series", _("indicate infinite series"))) SET_BOOL_D(printops.indicate_infinite_series) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "angle unit", _("angle unit"))) { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "rad", _("rad")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "radians", _("radians"))) v = ANGLE_UNIT_RADIANS; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "deg", _("deg")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "degrees", _("degrees"))) v = ANGLE_UNIT_DEGREES; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "gra", _("gra")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "gradians", _("gradians"))) v = ANGLE_UNIT_GRADIANS; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "none", _("none"))) v = ANGLE_UNIT_NONE; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { evalops.parse_options.angle_unit = (AngleUnit) v; expression_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "multiplication sign", _("multiplication sign"))) { int v = -1; if(svalue == SIGN_MULTIDOT || svalue == ".") v = MULTIPLICATION_SIGN_DOT; else if(svalue == SIGN_MULTIPLICATION || svalue == "x") v = MULTIPLICATION_SIGN_X; else if(svalue == "*") v = MULTIPLICATION_SIGN_ASTERISK; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { printops.multiplication_sign = (MultiplicationSign) v; result_display_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "division sign", _("division sign"))) { int v = -1; if(svalue == SIGN_DIVISION_SLASH) v = DIVISION_SIGN_DIVISION_SLASH; else if(svalue == SIGN_DIVISION) v = DIVISION_SIGN_DIVISION; else if(svalue == "/") v = DIVISION_SIGN_SLASH; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { printops.division_sign = (DivisionSign) v; result_display_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "approximation", _("approximation"))) { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "exact", _("exact"))) v = APPROXIMATION_EXACT; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "try exact", _("try exact"))) v = APPROXIMATION_TRY_EXACT; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "approximate", _("approximate"))) v = APPROXIMATION_APPROXIMATE; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { evalops.approximation = (ApproximationMode) v; expression_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "autoconversion", _("autoconversion"))) { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "none", _("none"))) v = POST_CONVERSION_NONE; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "best", _("best"))) v = POST_CONVERSION_BEST; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "base", _("base"))) v = POST_CONVERSION_BASE; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { evalops.auto_post_conversion = (AutoPostConversion) v; expression_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "algebra mode", _("algebra mode"))) { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "none", _("none"))) v = STRUCTURING_NONE; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "simplify", _("simplify"))) v = STRUCTURING_SIMPLIFY; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "factorize", _("factorize"))) v = STRUCTURING_FACTORIZE; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { evalops.structuring = (StructuringMode) v; printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE); expression_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "exact", _("exact"))) { int v = s2b(svalue); if(v < 0) { PUTS_UNICODE(_("Illegal value")); } else if(v > 0) { evalops.approximation = APPROXIMATION_EXACT; expression_format_updated(); } else { evalops.approximation = APPROXIMATION_TRY_EXACT; expression_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "save mode", _("save mode"))) { int v = s2b(svalue); if(v < 0) { PUTS_UNICODE(_("Illegal value")); } else if(v > 0) { save_mode_on_exit = true; } else { save_mode_on_exit = false; } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "save definitions", _("save definitions"))) { int v = s2b(svalue); if(v < 0) { PUTS_UNICODE(_("Illegal value")); } else if(v > 0) { save_defs_on_exit = true; } else { save_defs_on_exit = false; } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "exp mode", _("exp mode"))) { int v = -2; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "off", _("off"))) v = EXP_NONE; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "auto", _("auto"))) v = EXP_PRECISION; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "pure", _("pure"))) v = EXP_PURE; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "scientific", _("scientific"))) v = EXP_SCIENTIFIC; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "engineering", _("engineering"))) v = EXP_BASE_3; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); if(v < 0) v = -2; } if(v <= -2) { PUTS_UNICODE(_("Illegal value.")); } else { printops.min_exp = v; result_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "precision", _("precision"))) { int v = 0; if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) v = s2i(svalue); if(v < 1) { PUTS_UNICODE(_("Illegal value.")); } else { CALCULATOR->setPrecision(v); expression_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "max decimals", _("max decimals"))) { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "off", _("off"))) v = -1; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) v = s2i(svalue); if(v < 0) { printops.use_max_decimals = false; result_format_updated(); } else { printops.max_decimals = v; printops.use_max_decimals = true; result_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "min decimals", _("min decimals"))) { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "off", _("off"))) v = -1; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) v = s2i(svalue); if(v < 0) { printops.min_decimals = 0; printops.use_min_decimals = false; result_format_updated(); } else { printops.min_decimals = v; printops.use_min_decimals = true; result_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "fractions", _("fractions"))) { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "off", _("off"))) v = FRACTION_DECIMAL; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "exact", _("exact"))) v = FRACTION_DECIMAL_EXACT; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "on", _("on"))) v = FRACTION_FRACTIONAL; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "combined", _("combined"))) v = FRACTION_COMBINED; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 3) { PUTS_UNICODE(_("Illegal value.")); } else { printops.number_fraction_format = (NumberFractionFormat) v; result_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "read precision", _("read precision"))) { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "off", _("off"))) v = DONT_READ_PRECISION; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "always", _("always"))) v = ALWAYS_READ_PRECISION; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "when decimals", _("when decimals")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "on", _("on"))) v = READ_PRECISION_WHEN_DECIMALS; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { evalops.parse_options.read_precision = (ReadPrecisionMode) v; expression_format_updated(); } } else { if(index != string::npos) { if((index = svalue.find_first_of(SPACES)) != string::npos) { str = svalue; svalue = str.substr(index + 1, str.length() - (index + 1)); remove_blank_ends(svalue); svar += " "; str = str.substr(0, index); remove_blank_ends(str); svar += str; gsub("_", " ", svar); goto set_option_place; } } PUTS_UNICODE(_("Unrecognized option.")); } } int main (int argc, char *argv[]) { string calc_arg; vector set_option_strings; bool calc_arg_begun = false; string command_file; cfile = NULL; bool batch = false; result_only = false; bool load_units = true, load_functions = true, load_variables = true, load_currencies = true, load_datasets = true; load_global_defs = true; printops.use_unicode_signs = false; for(int i = 1; i < argc; i++) { if(calc_arg_begun) { calc_arg += " "; } if(!calc_arg_begun && (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "-help") == 0 || strcmp(argv[i], "--help") == 0)) { PUTS_UNICODE(_("usage: qalc [options] [expression]")); printf("\n"); PUTS_UNICODE(_("where options are:")); fputs("\n\t-/+u8\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("turn on/off unicode support")); fputs("\n\t-set", stdout); fputs(" \"", stdout); FPUTS_UNICODE(_("OPTION"), stdout); fputs(" ", stdout); FPUTS_UNICODE(_("VALUE"), stdout); fputs("\"\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("as set command in interactive program session (ex. -set \"base 16\")")); fputs("\n\t-f, -file", stdout); fputs(" ", stdout); FPUTS_UNICODE(_("FILE"), stdout); fputs("\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("executes commands from a file first")); fputs("\n\t-t, -terse\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("reduces output to just the result of the input expression")); fputs("\n\t-n, -nodefs\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("do not load any functions, units, or variables from file")); fputs("\n\t-nocurrencies\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("do not load any global currencies from file")); fputs("\n\t-nodatasets\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("do not load any global data sets from file")); fputs("\n\t-nofunctions\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("do not load any global functions from file")); fputs("\n\t-nounits\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("do not load any global units from file")); fputs("\n\t-novariables\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("do not load any global variables from file")); puts(""); PUTS_UNICODE(_("The program will start in interactive mode if no expression is specified.")); puts(""); return 0; } else if(!calc_arg_begun && strcmp(argv[i], "-u8") == 0) { enable_unicode = 1; } else if(!calc_arg_begun && strcmp(argv[i], "+u8") == 0) { enable_unicode = 0; } else if(!calc_arg_begun && (strcmp(argv[i], "-terse") == 0 || strcmp(argv[i], "--terse") == 0 || strcmp(argv[i], "-t") == 0)) { result_only = true; } else if(!calc_arg_begun && strcmp(argv[i], "-nounits") == 0) { load_units = false; } else if(!calc_arg_begun && strcmp(argv[i], "-nocurrencies") == 0) { load_currencies = false; } else if(!calc_arg_begun && strcmp(argv[i], "-nofunctions") == 0) { load_functions = false; } else if(!calc_arg_begun && strcmp(argv[i], "-novariables") == 0) { load_variables = false; } else if(!calc_arg_begun && strcmp(argv[i], "-nodatasets") == 0) { load_datasets = false; } else if(!calc_arg_begun && (strcmp(argv[i], "-nodefs") == 0 || strcmp(argv[i], "-n") == 0)) { load_global_defs = false; } else if(!calc_arg_begun && (strcmp(argv[i], "-set") == 0 || strcmp(argv[i], "--set") == 0)) { i++; if(i < argc) { set_option_strings.push_back(argv[i]); } else { puts(_("No option and value specified for set command.")); } } else if(!calc_arg_begun && (strcmp(argv[i], "-file") == 0 || strcmp(argv[i], "-f") == 0 || strcmp(argv[i], "--file") == 0)) { i++; if(i < argc) { command_file = argv[i]; remove_blank_ends(command_file); } else { puts(_("No file specified.")); } } else { if(strlen(argv[i]) >= 2 && ((argv[i][0] == '\"' && argv[i][strlen(argv[i] - 1)] == '\"') || (argv[i][0] == '\'' && argv[i][strlen(argv[i] - 1)] == '\''))) { calc_arg += argv[i] + 1; calc_arg.erase(calc_arg.length() - 1); } else { calc_arg += argv[i]; } calc_arg_begun = true; } } #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); #endif b_busy = false; //create the almighty Calculator object new Calculator(); //load application specific preferences load_preferences(); for(size_t i = 0; i < set_option_strings.size(); i++) { set_option(set_option_strings[i]); } if(enable_unicode >= 0) { if(printops.use_unicode_signs == enable_unicode) { enable_unicode = -1; } else { printops.use_unicode_signs = enable_unicode; } } mstruct = new MathStructure(); parsed_mstruct = new MathStructure(); bool canfetch = CALCULATOR->canFetch(); string str; #ifdef HAVE_LIBREADLINE static char* rlbuffer; #endif //exchange rates if(load_global_defs && load_currencies) { if(first_qalculate_run && canfetch && command_file.empty()) { if(ask_question(_("You need the download exchange rates to be able to convert between different currencies.\nYou can later get current exchange rates with the \"exchange rates\" command.\nDo you want to fetch exchange rates now from the Internet (default yes)?"))) { CALCULATOR->fetchExchangeRates(5); } } else if(fetch_exchange_rates_at_startup && canfetch) { CALCULATOR->fetchExchangeRates(5); } CALCULATOR->loadExchangeRates(); } string ans_str = _("ans"); vans[0] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str, m_undefined, _("Last Answer"), false)); vans[0]->addName(_("answer")); vans[0]->addName(ans_str + "1"); vans[1] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "2", m_undefined, _("Answer 2"), false)); vans[2] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "3", m_undefined, _("Answer 3"), false)); vans[3] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "4", m_undefined, _("Answer 4"), false)); vans[4] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "5", m_undefined, _("Answer 5"), false)); //load global definitions if(load_global_defs) { bool b = true; if(load_units && !CALCULATOR->loadGlobalPrefixes()) b = false; if(load_units && !CALCULATOR->loadGlobalUnits()) b = false; else if(load_currencies && !CALCULATOR->loadGlobalCurrencies()) b = false; if(load_functions && !CALCULATOR->loadGlobalFunctions()) b = false; if(load_datasets && !CALCULATOR->loadGlobalDataSets()) b = false; if(load_variables && !CALCULATOR->loadGlobalVariables()) b = false; if(!b) PUTS_UNICODE(_("Failed to load global definitions!")); } //load local definitions if(load_global_defs) CALCULATOR->loadLocalDefinitions(); //reset result_text = "0"; parsed_text = "0"; int pipe_wr[] = {0, 0}; pipe(pipe_wr); view_pipe_r = fdopen(pipe_wr[0], "r"); view_pipe_w = fdopen(pipe_wr[1], "w"); pthread_attr_init(&view_thread_attr); pthread_create(&view_thread, &view_thread_attr, view_proc, view_pipe_r); int pipe_wr2[] = {0, 0}; pipe(pipe_wr2); command_pipe_r = fdopen(pipe_wr2[0], "r"); command_pipe_w = fdopen(pipe_wr2[1], "w"); pthread_attr_init(&command_thread_attr); command_thread_started = false; timeout.tv_sec = 0; timeout.tv_usec = 100000; if(!command_file.empty()) { if(command_file == "-") { cfile = stdin; } else { cfile = fopen(command_file.c_str(), "r"); if(!cfile) { printf(_("Could not open \"%s\".\n"), command_file.c_str()); } } } if(!cfile && !calc_arg.empty()) { if(!printops.use_unicode_signs && contains_unicode_char(calc_arg.c_str())) { gchar *gstr = g_locale_to_utf8(calc_arg.c_str(), -1, NULL, NULL, NULL); if(gstr) { expression_str = gstr; g_free(gstr); } else { expression_str = calc_arg; } } else { expression_str = calc_arg; } size_t index = expression_str.find_first_of(ID_WRAPS); if(index != string::npos) { printf(_("Illegal character, \'%c\', in expression."), expression_str[index]); puts(""); } else { execute_expression(false); } pthread_cancel(view_thread); CALCULATOR->terminateThreads(); return 0; } #ifdef HAVE_LIBREADLINE rl_catch_signals = 1; rl_catch_sigwinch = rl_readline_version >= 0x0500; rl_readline_name = "qalc"; rl_basic_word_break_characters = NOT_IN_NAMES NUMBERS; rl_completion_entry_function = qalc_completion; rl_bind_key('\t', rlcom_tab); #endif string scom; size_t slen, ispace; while(true) { if(cfile) { if(!fgets(buffer, 1000, cfile)) { if(batch) { break; } else { if(cfile != stdin) { fclose(cfile); } cfile = NULL; if(!calc_arg.empty()) { if(!printops.use_unicode_signs && contains_unicode_char(calc_arg.c_str())) { gchar *gstr = g_locale_to_utf8(calc_arg.c_str(), -1, NULL, NULL, NULL); if(gstr) { expression_str = gstr; g_free(gstr); } else { expression_str = calc_arg; } } else { expression_str = calc_arg; } size_t index = expression_str.find_first_of(ID_WRAPS); if(index != string::npos) { printf(_("Illegal character, \'%c\', in expression."), expression_str[index]); puts(""); } else { execute_expression(false); } pthread_cancel(view_thread); CALCULATOR->terminateThreads(); return 0; } continue; } } if(!printops.use_unicode_signs && contains_unicode_char(buffer)) { gchar *gstr = g_locale_to_utf8(buffer, -1, NULL, NULL, NULL); if(gstr) { str = gstr; g_free(gstr); } else { str = buffer; } } else { str = buffer; } } else { #ifdef HAVE_LIBREADLINE rlbuffer = readline("> "); if(rlbuffer == NULL) break; if(!printops.use_unicode_signs && contains_unicode_char(rlbuffer)) { gchar *gstr = g_locale_to_utf8(rlbuffer, -1, NULL, NULL, NULL); if(gstr) { str = gstr; g_free(gstr); } else { str = rlbuffer; } } else { str = rlbuffer; } #else fputs("> ", stdout); fgets(buffer, 1000, stdin); if(!printops.use_unicode_signs && contains_unicode_char(buffer)) { gchar *gstr = g_locale_to_utf8(buffer, -1, NULL, NULL, NULL); if(gstr) { str = gstr; g_free(gstr); } else { str = buffer; } } else { str = buffer; } #endif } slen = str.length(); remove_blank_ends(str); ispace = str.find_first_of(SPACES); if(ispace == string::npos) { scom = ""; } else { scom = str.substr(0, ispace); } //The qalc command "set" as in "set precision 10". The original text string for commands is kept in addition to the translation. if(EQUALS_IGNORECASE_AND_LOCAL(scom, "set", _("set"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); set_option(str); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "save", _("save")) || EQUALS_IGNORECASE_AND_LOCAL(scom, "store", _("store"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); if(EQUALS_IGNORECASE_AND_LOCAL(str, "mode", _("mode"))) { if(save_mode()) { PUTS_UNICODE(_("mode saved")); } } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "definitions", _("definitions"))) { if(save_defs()) { PUTS_UNICODE(_("definitions saved")); } } else { string name = str, cat, title; if(str[0] == '\"') { size_t i = str.find('\"', 1); if(i != string::npos) { name = str.substr(1, i - 1); str = str.substr(i + 1, str.length() - (i + 1)); remove_blank_ends(str); } else { str = ""; } } else { size_t i = str.find_first_of(SPACES, 1); if(i != string::npos) { name = str.substr(0, i); str = str.substr(i + 1, str.length() - (i + 1)); remove_blank_ends(str); } else { str = ""; } } bool catset = false; if(str.empty()) { cat = _("Temporary"); } else { if(str[0] == '\"') { size_t i = str.find('\"', 1); if(i != string::npos) { cat = str.substr(1, i - 1); title = str.substr(i + 1, str.length() - (i + 1)); remove_blank_ends(title); } } else { size_t i = str.find_first_of(SPACES, 1); if(i != string::npos) { cat = str.substr(0, i); title = str.substr(i + 1, str.length() - (i + 1)); remove_blank_ends(title); } } catset = true; } bool b = true; if(!CALCULATOR->variableNameIsValid(name)) { name = CALCULATOR->convertToValidVariableName(name); size_t l = name.length() + strlen(_("Illegal name. Save as %s instead?")); char *cstr = (char*) malloc(sizeof(char) * (l + 1)); snprintf(cstr, l, _("Illegal name. Save as %s instead?"), name.c_str()); if(!ask_question(cstr)) { b = false; } free(cstr); } if(b && CALCULATOR->variableNameTaken(name)) { if(!ask_question(_("An unit or variable with the same name already exists.\nDo you want to overwrite it?"))) { b = false; } } if(b) { Variable *v = CALCULATOR->getActiveVariable(name); if(v && v->isLocal() && v->isKnown()) { if(catset) v->setCategory(cat); if(!title.empty()) v->setTitle(title); ((KnownVariable*) v)->set(*mstruct); if(v->countNames() == 0) { ExpressionName ename(name); ename.reference = true; v->setName(ename, 1); } else { v->setName(name, 1); } } else { CALCULATOR->addVariable(new KnownVariable(cat, name, *mstruct, title)); } } } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "assume", _("assume"))) { string str2 = "assumptions "; set_option(str2 + str.substr(ispace + 1, slen - (ispace + 1))); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "base", _("base"))) { set_option(str); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "rpn", _("rpn"))) { set_option(str); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "exrates", _("exrates"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); CALCULATOR->fetchExchangeRates(15, str); CALCULATOR->loadExchangeRates(); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "exrates", _("exrates"))) { CALCULATOR->fetchExchangeRates(15); CALCULATOR->loadExchangeRates(); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "stack", _("stack"))) { if(CALCULATOR->RPNStackSize() == 0) { PUTS_UNICODE(_("The RPN stack is empty.")); } else { puts(""); MathStructure m; for(size_t i = 1; i <= CALCULATOR->RPNStackSize(); i++) { m = *CALCULATOR->getRPNRegister(i); m.format(printops); printf(" %i:\t%s\n", (int) i, m.print(printops).c_str()); } puts(""); } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "clear stack", _("clear stack"))) { CALCULATOR->clearRPNStack(); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "exact", _("exact"))) { if(evalops.approximation != APPROXIMATION_EXACT) { evalops.approximation = APPROXIMATION_EXACT; expression_format_updated(); } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "approximate", _("approximate"))) { if(evalops.approximation != APPROXIMATION_TRY_EXACT) { evalops.approximation = APPROXIMATION_TRY_EXACT; expression_format_updated(); } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "convert", _("convert")) || EQUALS_IGNORECASE_AND_LOCAL(scom, "to", _("to"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); if(EQUALS_IGNORECASE_AND_LOCAL(str, "best", _("best"))) { mstruct->set(CALCULATOR->convertToBestUnit(*mstruct, evalops)); result_action_executed(); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "base", _("base"))) { mstruct->set(CALCULATOR->convertToBaseUnits(*mstruct, evalops)); result_action_executed(); } else { mstruct->set(CALCULATOR->convert(*mstruct, str, evalops)); result_action_executed(); } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "factor", _("factor"))) { execute_command(COMMAND_FACTORIZE); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "simplify", _("simplify"))) { execute_command(COMMAND_SIMPLIFY); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "mode", _("mode"))) { INIT_SCREEN_CHECK puts(""); CHECK_IF_SCREEN_FILLED int pctl; #define PRINT_AND_COLON_TABS(x) FPUTS_UNICODE(x, stdout); pctl = unicode_length_check(x); if(pctl >= 24) fputs("\t", stdout); else if(pctl >= 16) fputs("\t\t", stdout); else if(pctl >= 8) fputs("\t\t\t", stdout); else fputs("\t\t\t\t", stdout); PRINT_AND_COLON_TABS(_("abbreviations")); PUTS_UNICODE(b2oo(printops.abbreviate_names, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("algebra mode")); switch(evalops.structuring) { case STRUCTURING_NONE: {PUTS_UNICODE(_("none")); break;} case STRUCTURING_SIMPLIFY: {PUTS_UNICODE(_("simplify")); break;} case STRUCTURING_FACTORIZE: {PUTS_UNICODE(_("factorize")); break;} } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("all prefixes")); PUTS_UNICODE(b2oo(printops.use_all_prefixes, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("angle unit")); switch(evalops.parse_options.angle_unit) { case ANGLE_UNIT_RADIANS: {PUTS_UNICODE(_("rad")); break;} case ANGLE_UNIT_DEGREES: {PUTS_UNICODE(_("rad")); break;} case ANGLE_UNIT_GRADIANS: {PUTS_UNICODE(_("gra")); break;} default: {PUTS_UNICODE(_("none")); break;} } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("approximation")); switch(evalops.approximation) { case APPROXIMATION_EXACT: {PUTS_UNICODE(_("exact")); break;} case APPROXIMATION_TRY_EXACT: {PUTS_UNICODE(_("try exact")); break;} case APPROXIMATION_APPROXIMATE: {PUTS_UNICODE(_("approximate")); break;} } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("assume nonzero denominators")); PUTS_UNICODE(b2oo(evalops.assume_denominators_nonzero, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("warn nonzero denominators")); PUTS_UNICODE(b2oo(evalops.warn_about_denominators_assumed_nonzero, false)); CHECK_IF_SCREEN_FILLED string value; switch(CALCULATOR->defaultAssumptions()->sign()) { case ASSUMPTION_SIGN_POSITIVE: {value = _("positive"); break;} case ASSUMPTION_SIGN_NONPOSITIVE: {value = _("non-positive"); break;} case ASSUMPTION_SIGN_NEGATIVE: {value = _("negative"); break;} case ASSUMPTION_SIGN_NONNEGATIVE: {value = _("non-negative"); break;} case ASSUMPTION_SIGN_NONZERO: {value = _("non-zero"); break;} default: {} } if(!value.empty() && !CALCULATOR->defaultAssumptions()->type() == ASSUMPTION_TYPE_NONE) value += " "; switch(CALCULATOR->defaultAssumptions()->type()) { case ASSUMPTION_TYPE_INTEGER: {value += _("integer"); break;} case ASSUMPTION_TYPE_RATIONAL: {value += _("rational"); break;} case ASSUMPTION_TYPE_REAL: {value += _("real"); break;} case ASSUMPTION_TYPE_COMPLEX: {value += _("complex"); break;} case ASSUMPTION_TYPE_NUMBER: {value += _("number"); break;} case ASSUMPTION_TYPE_NONMATRIX: {value += _("non-matrix"); break;} default: {} } if(value.empty()) value = _("unknown"); PRINT_AND_COLON_TABS(_("assumptions")); PUTS_UNICODE(value.c_str()); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("autoconversion")); switch(evalops.auto_post_conversion) { case POST_CONVERSION_NONE: {PUTS_UNICODE(_("none")); break;} case POST_CONVERSION_BEST: {PUTS_UNICODE(_("best")); break;} case POST_CONVERSION_BASE: {PUTS_UNICODE(_("base")); break;} } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("base")); switch(printops.base) { case BASE_ROMAN_NUMERALS: {PUTS_UNICODE(_("roman")); break;} case BASE_SEXAGESIMAL: {PUTS_UNICODE(_("sexagesimal")); break;} case BASE_TIME: {PUTS_UNICODE(_("time")); break;} default: {printf("%i\n", printops.base);} } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("base display")); switch(printops.base_display) { case BASE_DISPLAY_NONE: {PUTS_UNICODE(_("none")); break;} case BASE_DISPLAY_NORMAL: {PUTS_UNICODE(_("normal")); break;} case BASE_DISPLAY_ALTERNATIVE: {PUTS_UNICODE(_("alternative")); break;} } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("calculate functions")); PUTS_UNICODE(b2oo(evalops.calculate_functions, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("calculate variables")); PUTS_UNICODE(b2oo(evalops.calculate_variables, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("complex numbers")); PUTS_UNICODE(b2oo(evalops.allow_complex, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("denominator prefixes")); PUTS_UNICODE(b2oo(printops.use_denominator_prefix, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("division sign")); switch(printops.division_sign) { case DIVISION_SIGN_DIVISION_SLASH: {puts(SIGN_DIVISION_SLASH); break;} case DIVISION_SIGN_DIVISION: {puts(SIGN_DIVISION); break;} default: {puts("/"); break;} } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("dot as separator")); PUTS_UNICODE(b2oo(evalops.parse_options.dot_as_separator, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("excessive parenthesis")); PUTS_UNICODE(b2oo(printops.excessive_parenthesis, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("exp mode")); switch(printops.min_exp) { case EXP_NONE: {PUTS_UNICODE(_("off")); break;} case EXP_PRECISION: {PUTS_UNICODE(_("auto")); break;} case EXP_PURE: {PUTS_UNICODE(_("pure")); break;} case EXP_SCIENTIFIC: {PUTS_UNICODE(_("scientific")); break;} case EXP_BASE_3: {PUTS_UNICODE(_("engineering")); break;} default: {printf("%i\n", printops.min_exp); break;} } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("fractions")); switch(printops.number_fraction_format) { case FRACTION_DECIMAL: {PUTS_UNICODE(_("off")); break;} case FRACTION_DECIMAL_EXACT: {PUTS_UNICODE(_("exact")); break;} case FRACTION_FRACTIONAL: {PUTS_UNICODE(_("on")); break;} case FRACTION_COMBINED: {PUTS_UNICODE(_("combined")); break;} } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("functions")); PUTS_UNICODE(b2oo(evalops.parse_options.functions_enabled, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("input base")); switch(evalops.parse_options.base) { case BASE_ROMAN_NUMERALS: {PUTS_UNICODE(_("roman")); break;} default: {printf("%i\n", evalops.parse_options.base);} } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("indicate infinite series")); PUTS_UNICODE(b2oo(printops.indicate_infinite_series, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("infinite numbers")); PUTS_UNICODE(b2oo(evalops.allow_infinite, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("limit implicit multiplication")); PUTS_UNICODE(b2oo(evalops.parse_options.limit_implicit_multiplication, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("lowercase e")); PUTS_UNICODE(b2oo(printops.lower_case_e, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("lowercase numbers")); PUTS_UNICODE(b2oo(printops.lower_case_numbers, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("max decimals")); if(printops.use_max_decimals && printops.max_decimals >= 0) { printf("%i\n", printops.max_decimals); } else { PUTS_UNICODE(_("off")); } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("min decimals")); if(printops.use_min_decimals && printops.min_decimals > 0) { printf("%i\n", printops.min_decimals); } else { PUTS_UNICODE(_("off")); } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("multiplication sign")); switch(printops.multiplication_sign) { case MULTIPLICATION_SIGN_X: {puts(SIGN_MULTIPLICATION); break;} case MULTIPLICATION_SIGN_DOT: {puts(SIGN_MULTIDOT); break;} default: {puts("*"); break;} } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("place units separately")); PUTS_UNICODE(b2oo(printops.place_units_separately, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("precision")) printf("%i\n", CALCULATOR->getPrecision()); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("prefixes")); PUTS_UNICODE(b2oo(printops.use_unit_prefixes, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("read precision")); switch(evalops.parse_options.read_precision) { case DONT_READ_PRECISION: {PUTS_UNICODE(_("off")); break;} case ALWAYS_READ_PRECISION: {PUTS_UNICODE(_("always")); break;} case READ_PRECISION_WHEN_DECIMALS: {PUTS_UNICODE(_("when decimals")); break;} } CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("round to even")); PUTS_UNICODE(b2oo(printops.round_halfway_to_even, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("rpn")); PUTS_UNICODE(b2oo(rpn_mode, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("rpn syntax")); PUTS_UNICODE(b2oo(evalops.parse_options.rpn, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("save definitions")); PUTS_UNICODE(b2yn(save_defs_on_exit, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("save mode")); PUTS_UNICODE(b2yn(save_mode_on_exit, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("show ending zeroes")); PUTS_UNICODE(b2oo(printops.show_ending_zeroes, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("show negative exponents")); PUTS_UNICODE(b2oo(printops.negative_exponents, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("short multiplication")); PUTS_UNICODE(b2oo(printops.short_multiplication, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("spacious")); PUTS_UNICODE(b2oo(printops.spacious, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("spell out logical")); PUTS_UNICODE(b2oo(printops.spell_out_logical_operators, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("sync units")); PUTS_UNICODE(b2oo(evalops.sync_units, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("unicode")); PUTS_UNICODE(b2oo(printops.use_unicode_signs, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("units")); PUTS_UNICODE(b2oo(evalops.parse_options.units_enabled, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("unknowns")); PUTS_UNICODE(b2oo(evalops.parse_options.unknowns_enabled, false)); CHECK_IF_SCREEN_FILLED PRINT_AND_COLON_TABS(_("variables")); PUTS_UNICODE(b2oo(evalops.parse_options.variables_enabled, false)); CHECK_IF_SCREEN_FILLED puts(""); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "help", _("help")) || str == "?") { puts(""); FPUTS_UNICODE(_("Enter a mathematical expression or a command."), stdout); fputs(" ", stdout); PUTS_UNICODE(_("Complete functions, units and variables with the tabulator key.")); puts(""); PUTS_UNICODE(_("Available commands are:")); puts(""); PUTS_UNICODE(_("approximate")); FPUTS_UNICODE(_("assume"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("ASSUMPTIONS")); FPUTS_UNICODE(_("base"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("BASE")); PUTS_UNICODE(_("clear stack")); FPUTS_UNICODE(_("convert"), stdout); fputs("/", stdout); FPUTS_UNICODE(_("to"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("UNIT")); PUTS_UNICODE(_("exact")); FPUTS_UNICODE(_("exrates"), stdout); if(!CALCULATOR->hasGnomeVFS()) { fputs(" ", stdout); FPUTS_UNICODE("[", stdout); fputs(_("WGET ARGUMENTS"), stdout); FPUTS_UNICODE("]", stdout); } puts(""); PUTS_UNICODE(_("factor")); PUTS_UNICODE(_("info")); PUTS_UNICODE(_("mode")); FPUTS_UNICODE(_("rpn"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("ON/OFF")); FPUTS_UNICODE(_("save"), stdout); fputs("/", stdout); FPUTS_UNICODE(_("store"), stdout); fputs(" ", stdout); FPUTS_UNICODE(_("NAME"), stdout); fputs(" [", stdout); FPUTS_UNICODE(_("CATEGORY"), stdout); fputs("] [", stdout); FPUTS_UNICODE("[", stdout); fputs(_("TITLE"), stdout); PUTS_UNICODE("]"); FPUTS_UNICODE(_("set"), stdout); fputs(" ", stdout); FPUTS_UNICODE(_("OPTION"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("VALUE")); PUTS_UNICODE(_("simplify")); PUTS_UNICODE(_("stack")); FPUTS_UNICODE(_("quit"), stdout); fputs("/", stdout); PUTS_UNICODE(_("exit")); puts(""); PUTS_UNICODE(_("Type help COMMAND for more help (example: help save).")); PUTS_UNICODE(_("Type info NAME for info about a function, variable or unit (example: info sin).")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "info", _("info"))) { int pctl; #define PRINT_AND_COLON_TABS_INFO(x) FPUTS_UNICODE(x, stdout); pctl = unicode_length_check(x); if(pctl >= 15) fputs(":\t", stdout); else if(pctl >= 7) fputs(":\t\t", stdout); else fputs(":\t\t\t", stdout); str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); show_info: ExpressionItem *item = CALCULATOR->getActiveExpressionItem(str); if(!item) { PUTS_UNICODE(_("No function, variable or unit with specified name exist.")); } else { switch(item->type()) { case TYPE_FUNCTION: { INIT_SCREEN_CHECK CHECK_IF_SCREEN_FILLED_PUTS(""); MathFunction *f = (MathFunction*) item; Argument *arg; Argument default_arg; string str2; str = _("Function"); if(!f->title(false).empty()) { str += ": "; str += f->title(); } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); CHECK_IF_SCREEN_FILLED_PUTS(""); const ExpressionName *ename = &f->preferredName(false, printops.use_unicode_signs); str = ename->name; int iargs = f->maxargs(); if(iargs < 0) { iargs = f->minargs() + 1; } str += "("; if(iargs != 0) { for(int i2 = 1; i2 <= iargs; i2++) { if(i2 > f->minargs()) { str += "["; } if(i2 > 1) { str += CALCULATOR->getComma(); str += " "; } arg = f->getArgumentDefinition(i2); if(arg && !arg->name().empty()) { str2 = arg->name(); } else { str2 = _("argument"); str2 += " "; str2 += i2s(i2); } str += str2; if(i2 > f->minargs()) { str += "]"; } } if(f->maxargs() < 0) { str += CALCULATOR->getComma(); str += " ..."; } } str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); for(size_t i2 = 1; i2 <= f->countNames(); i2++) { if(&f->getName(i2) != ename) { CHECK_IF_SCREEN_FILLED_PUTS(f->getName(i2).name.c_str()); } } if(f->subtype() == SUBTYPE_DATA_SET) { CHECK_IF_SCREEN_FILLED_PUTS(""); snprintf(buffer, 1000, _("Retrieves data from the %s data set for a given object and property. If \"info\" is typed as property, all properties of the object will be listed."), f->title().c_str()); CHECK_IF_SCREEN_FILLED_PUTS(buffer); } if(!f->description().empty()) { CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(f->description().c_str()); } if(f->subtype() == SUBTYPE_DATA_SET && !((DataSet*) f)->copyright().empty()) { CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(((DataSet*) f)->copyright().c_str()); } if(iargs) { CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Arguments")); for(int i2 = 1; i2 <= iargs; i2++) { arg = f->getArgumentDefinition(i2); if(arg && !arg->name().empty()) { str = arg->name(); } else { str = i2s(i2); } str += ": "; if(arg) { str2 = arg->printlong(); } else { str2 = default_arg.printlong(); } if(i2 > f->minargs()) { str2 += " ("; //optional argument, in description str2 += _("optional"); if(!f->getDefaultValue(i2).empty()) { str2 += ", "; //argument default, in description str2 += _("default: "); str2 += f->getDefaultValue(i2); } str2 += ")"; } str += str2; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); } } if(!f->condition().empty()) { CHECK_IF_SCREEN_FILLED_PUTS(""); str = _("Requirement"); str += ": "; str += f->printCondition(); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); } if(f->subtype() == SUBTYPE_DATA_SET) { DataSet *ds = (DataSet*) f; CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Properties")); DataPropertyIter it; DataProperty *dp = ds->getFirstProperty(&it); while(dp) { if(!dp->isHidden()) { if(!dp->title(false).empty()) { str = dp->title(); str += ": "; } for(size_t i = 1; i <= dp->countNames(); i++) { if(i > 1) str += ", "; str += dp->getName(i); } if(dp->isKey()) { str += " ("; str += _("key"); str += ")"; } if(!dp->description().empty()) { str += "\n"; str += dp->description(); } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); } dp = ds->getNextProperty(&it); } } CHECK_IF_SCREEN_FILLED_PUTS(""); break; } case TYPE_UNIT: { puts(""); if(!item->title(false).empty()) { PRINT_AND_COLON_TABS_INFO(_("Unit")); FPUTS_UNICODE(item->title().c_str(), stdout); } else { FPUTS_UNICODE(_("Unit"), stdout); } puts(""); PRINT_AND_COLON_TABS_INFO(_("Names")); if(item->subtype() != SUBTYPE_COMPOSITE_UNIT) { const ExpressionName *ename = &item->preferredName(true, printops.use_unicode_signs); FPUTS_UNICODE(ename->name.c_str(), stdout); for(size_t i2 = 1; i2 <= item->countNames(); i2++) { if(&item->getName(i2) != ename) { fputs(" / ", stdout); FPUTS_UNICODE(item->getName(i2).name.c_str(), stdout); } } } puts(""); switch(item->subtype()) { case SUBTYPE_BASE_UNIT: { break; } case SUBTYPE_ALIAS_UNIT: { AliasUnit *au = (AliasUnit*) item; PRINT_AND_COLON_TABS_INFO(_("Base Unit")); FPUTS_UNICODE(au->firstBaseUnit()->preferredDisplayName(printops.abbreviate_names, printops.use_unicode_signs).name.c_str(), stdout); if(au->firstBaseExponent() != 1) { fputs(POWER, stdout); printf("%i", au->firstBaseExponent()); } puts(""); PRINT_AND_COLON_TABS_INFO(_("Relation")); FPUTS_UNICODE(CALCULATOR->localizeExpression(au->expression()).c_str(), stdout); if(item->isApproximate()) { fputs(" (", stdout); FPUTS_UNICODE(_("approximate"), stdout); fputs(")", stdout); } if(!au->inverseExpression().empty()) { puts(""); PRINT_AND_COLON_TABS_INFO(_("Inverse Relation")); FPUTS_UNICODE(CALCULATOR->localizeExpression(au->inverseExpression()).c_str(), stdout); if(item->isApproximate()) { fputs(" (", stdout); FPUTS_UNICODE(_("approximate"), stdout); fputs(")", stdout); } } puts(""); break; } case SUBTYPE_COMPOSITE_UNIT: { PRINT_AND_COLON_TABS_INFO(_("Base Units")); PUTS_UNICODE(((CompositeUnit*) item)->print(false, true, printops.use_unicode_signs).c_str()); break; } } if(!item->description().empty()) { puts(""); PUTS_UNICODE(item->description().c_str()); } puts(""); break; } case TYPE_VARIABLE: { puts(""); if(!item->title(false).empty()) { PRINT_AND_COLON_TABS_INFO(_("Variable")); FPUTS_UNICODE(item->title().c_str(), stdout); } else { FPUTS_UNICODE(_("Variable"), stdout); } puts(""); PRINT_AND_COLON_TABS_INFO(_("Names")); const ExpressionName *ename = &item->preferredName(false, printops.use_unicode_signs); FPUTS_UNICODE(ename->name.c_str(), stdout); for(size_t i2 = 1; i2 <= item->countNames(); i2++) { if(&item->getName(i2) != ename) { fputs(" / ", stdout); FPUTS_UNICODE(item->getName(i2).name.c_str(), stdout); } } Variable *v = (Variable*) item; string value; if(is_answer_variable(v)) { value = _("a previous result"); } else if(v->isKnown()) { if(((KnownVariable*) v)->isExpression()) { value = CALCULATOR->localizeExpression(((KnownVariable*) v)->expression()); if(value.length() > 40) { value = value.substr(0, 30); value += "..."; } } else { if(((KnownVariable*) v)->get().isMatrix()) { value = _("matrix"); } else if(((KnownVariable*) v)->get().isVector()) { value = _("vector"); } else { value = CALCULATOR->printMathStructureTimeOut(((KnownVariable*) v)->get(), 30); } } } else { if(((UnknownVariable*) v)->assumptions()) { switch(((UnknownVariable*) v)->assumptions()->sign()) { case ASSUMPTION_SIGN_POSITIVE: {value = _("positive"); break;} case ASSUMPTION_SIGN_NONPOSITIVE: {value = _("non-positive"); break;} case ASSUMPTION_SIGN_NEGATIVE: {value = _("negative"); break;} case ASSUMPTION_SIGN_NONNEGATIVE: {value = _("non-negative"); break;} case ASSUMPTION_SIGN_NONZERO: {value = _("non-zero"); break;} default: {} } if(!value.empty() && !((UnknownVariable*) v)->assumptions()->type() == ASSUMPTION_TYPE_NONE) value += " "; switch(((UnknownVariable*) v)->assumptions()->type()) { case ASSUMPTION_TYPE_INTEGER: {value += _("integer"); break;} case ASSUMPTION_TYPE_RATIONAL: {value += _("rational"); break;} case ASSUMPTION_TYPE_REAL: {value += _("real"); break;} case ASSUMPTION_TYPE_COMPLEX: {value += _("complex"); break;} case ASSUMPTION_TYPE_NUMBER: {value += _("number"); break;} case ASSUMPTION_TYPE_NONMATRIX: {value += _("non-matrix"); break;} default: {} } if(value.empty()) value = _("unknown"); } else { value = _("default assumptions"); } } puts(""); PRINT_AND_COLON_TABS_INFO(_("Value")); FPUTS_UNICODE(value.c_str(), stdout); if(item->isApproximate()) { fputs(" (", stdout); FPUTS_UNICODE(_("approximate"), stdout); fputs(")", stdout); } puts(""); if(!item->description().empty()) { fputs("\n", stdout); FPUTS_UNICODE(item->description().c_str(), stdout); fputs("\n", stdout); } puts(""); break; } } } } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "help", _("help"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); if(EQUALS_IGNORECASE_AND_LOCAL(str, "factor", _("factor"))) { puts(""); PUTS_UNICODE(_("Factorizes the current result.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "simplify", _("simplify"))) { puts(""); PUTS_UNICODE(_("Simplifies the current result.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "set", _("set"))) { INIT_SCREEN_CHECK int pctl; #define STR_AND_TABS(x) str = x; pctl = unicode_length_check(x); if(pctl >= 24) str += "\t"; else if(pctl >= 16) str += "\t\t"; else if(pctl >= 8) str += "\t\t\t"; else str += "\t\t\t\t"; CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Sets the value of an option.")); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Available options and accepted values are:")); CHECK_IF_SCREEN_FILLED_PUTS(""); STR_AND_TABS(_("abbreviations")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("algebra mode")); str += "(0 = "; str += _("none"); str += ", 1 = "; str += _("simplify"); str += ", 2 = "; str += _("factorize"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("all prefixes")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("angle unit")); str += "(0 = "; str += _("none"); str += ", 1 = "; str += _("radians"); str += ", 2 = "; str += _("degrees"); str += ", 3 = "; str += _("gradians"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("approximation")); str += "(0 = "; str += _("exact"); str += ", 1 = "; str += _("try exact"); str += ", 2 = "; str += _("approximate"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("assume nonzero denominators")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("warn nonzero denominators")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("assumptions")); str += "("; str += _("unknown"); str += ", "; str += _("non-zero"); str += ", "; str += _("positive"); str += ", "; str += _("negative"); str += ", "; str += _("non-positive"); str += ", "; str += _("non-negative"); str += " / "; str += _("unknown"); str += ", "; str += _("number"); str += ", "; str += _("complex"); str += ", "; str += _("real"); str += ", "; str += _("rational"); str += ", "; str += _("integer"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("autoconversion")); str += "(0 = "; str += _("none"); str += ", 1 = "; str += _("best"); str += ", 2 = "; str += _("base"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("base")); str += "(2 - 36"; str += ", "; str += _("bin"); str += ", "; str += _("oct"); str += ", "; str += _("dec"); str += ", "; str += _("hex"); str += ", "; str += _("sex"); str += ", "; str += _("time"); str += ", "; str += _("roman"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("base display")); str += "(0 = "; str += _("none"); str += ", 1 = "; str += _("normal"); str += ", 2 = "; str += _("alternative"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("calculate functions")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("calculate variables")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("complex numbers")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("denominator prefixes")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("division sign")); str += "(0 = /, 1 = " SIGN_DIVISION_SLASH ", 2 = " SIGN_DIVISION ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("dot as separator")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("exact")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("excessive parenthesis")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("exp mode")); str += "("; str += _("off"); str += ", "; str += _("auto"); str += ", "; str += _("engineering"); str += ", "; str += _("pure"); str += ", "; str += _("scientific"); str += ", >= 0)"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("fractions")); str += "(0 = "; str += _("off"); str += ", 1 = "; str += _("exact"); str += ", 2 = "; str += _("on"); str += ", 3 = "; str += _("combined"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("functions")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("input base")); str += "(2 - 36"; str += ", "; str += _("bin"); str += ", "; str += _("oct"); str += ", "; str += _("dec"); str += ", "; str += _("hex"); str += ", "; str += _("roman"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("infinite numbers")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("indicate infinite series")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("limit implicit multiplication")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("lowercase e")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("lowercase numbers")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("max decimals")); str += "("; str += _("off"); str += ", >= 0)"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("min decimals")); str += "("; str += _("off"); str += ", >= 0)"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("multiplication sign")); str += "(0 = *, 1 = " SIGN_MULTIDOT ", 2 = " SIGN_MULTIPLICATION ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("place units separately")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("precision")); str += "(> 0)"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("prefixes")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("read precision")); str += "(0 = "; str += _("off"); str += ", 1 = "; str += _("always"); str += ", 2 = "; str += _("on"); str += " = "; str += _("when decimals"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("round to even")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("rpn")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("rpn syntax")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("save definitions")); str += "("; str += _("yes"); str += ", "; str += _("no"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("save mode")); str += "("; str += _("yes"); str += ", "; str += _("no"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("show ending zeroes")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("show negative exponents")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("short multiplication")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("spacious")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("spell out logical")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("sync units")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("unicode")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("units")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("unknowns")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("variables")); str += "("; str += _("on"); str += ", "; str += _("off"); str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Example: set base 16.")); CHECK_IF_SCREEN_FILLED_PUTS(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "assume", _("assume"))) { puts(""); PUTS_UNICODE(_("Set default assumptions for unknown variables.")); string str = "("; str += _("unknown"); str += ", "; str += _("non-zero"); str += ", "; str += _("positive"); str += ", "; str += _("negative"); str += ", "; str += _("non-positive"); str += ", "; str += _("non-negative"); str += " / "; str += _("unknown"); str += ", "; str += _("non-matrix"); str += ", "; str += _("number"); str += ", "; str += _("complex"); str += ", "; str += _("real"); str += ", "; str += _("rational"); str += ", "; str += _("integer"); str += ")"; PUTS_UNICODE(str.c_str()); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "save", _("save")) || EQUALS_IGNORECASE_AND_LOCAL(str, "store", _("store"))) { puts(""); PUTS_UNICODE(_("Saves the current result in a variable with the specified name. You may optionally also provide a category (default \"Temporary\") and a title.")); PUTS_UNICODE(_("If name equals \"mode\" or \"definitions\", the current mode and definitions, respectively, will be saved.")); puts(""); PUTS_UNICODE(_("Example: store var1.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "mode", _("mode"))) { puts(""); PUTS_UNICODE(_("Displays the current mode.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "info", _("info"))) { puts(""); PUTS_UNICODE(_("Displays information about a function, variable or unit.")); puts(""); PUTS_UNICODE(_("Example: info sin.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "exrates", _("exrates"))) { puts(""); PUTS_UNICODE(_("Downloads current exchange rates from the Internet.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "rpn", _("rpn"))) { puts(""); PUTS_UNICODE(_("(De)activates the Reverse Polish Notation mode.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "clear stack", _("clear stack"))) { puts(""); PUTS_UNICODE(_("Clears the RPN stack.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "stack", _("stack"))) { puts(""); PUTS_UNICODE(_("Displays the RPN stack.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "base", _("base"))) { puts(""); PUTS_UNICODE(_("Sets the result base (equivalent to set base).")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "exact", _("exact"))) { puts(""); PUTS_UNICODE(_("Equivalent to set approximation exact.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "approximate", _("approximate"))) { puts(""); PUTS_UNICODE(_("Equivalent to set approximation try exact.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "convert", _("convert")) || EQUALS_IGNORECASE_AND_LOCAL(str, "to", _("to"))) { puts(""); PUTS_UNICODE(_("Converts units in current result.")); puts(""); PUTS_UNICODE(_("Possible unit values are:")); puts(""); PUTS_UNICODE(_("a unit (example meter)")); PUTS_UNICODE(_("a unit expression (example km/h)")); PUTS_UNICODE(_("base (convert to base units)")); PUTS_UNICODE(_("best (convert best unit)")); puts(""); PUTS_UNICODE(_("Example: convert best.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "quit", _("quit")) || EQUALS_IGNORECASE_AND_LOCAL(str, "exit", _("exit"))) { puts(""); PUTS_UNICODE(_("Terminates this program.")); puts(""); } else { goto show_info; } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "quit", _("quit")) || EQUALS_IGNORECASE_AND_LOCAL(str, "exit", _("exit"))) { #ifdef HAVE_LIBREADLINE if(!cfile) { free(rlbuffer); } #endif break; } else { size_t index = str.find_first_of(ID_WRAPS); if(index != string::npos) { printf(_("Illegal character, \'%c\', in expression."), str[index]); puts(""); } else { expression_str = str; execute_expression(); } } #ifdef HAVE_LIBREADLINE if(!cfile) { add_history(rlbuffer); free(rlbuffer); } #endif } if(cfile && cfile != stdin) { fclose(cfile); } handle_exit(); return 0; } void RPNRegisterAdded(string, int = 0) {} void RPNRegisterRemoved(int) {} void RPNRegisterChanged(string, int) {} bool display_errors(bool goto_input) { if(!CALCULATOR->message()) return false; bool b = false; while(true) { MessageType mtype = CALCULATOR->message()->type(); if(b && goto_input) fputs(" ", stdout); if(mtype == MESSAGE_ERROR) { FPUTS_UNICODE(_("error"), stdout); fputs(": ", stdout); PUTS_UNICODE(CALCULATOR->message()->message().c_str()); } else if(mtype == MESSAGE_WARNING) { FPUTS_UNICODE(_("warning"), stdout); fputs(": ", stdout); PUTS_UNICODE(CALCULATOR->message()->message().c_str()); } else { PUTS_UNICODE(CALCULATOR->message()->message().c_str()); } if(!CALCULATOR->nextMessage()) break; b = true; } return true; } void on_abort_display() { pthread_cancel(view_thread); CALCULATOR->restoreState(); CALCULATOR->clearBuffers(); b_busy = false; pthread_create(&view_thread, &view_thread_attr, view_proc, view_pipe_r); } void *view_proc(void *pipe) { pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); FILE *view_pipe = (FILE*) pipe; while(true) { void *x = NULL; fread(&x, sizeof(void*), 1, view_pipe); MathStructure m(*((MathStructure*) x)); bool b_stack = false; fread(&b_stack, sizeof(bool), 1, view_pipe); fread(&x, sizeof(void*), 1, view_pipe); if(x) { PrintOptions po; po.preserve_format = true; po.show_ending_zeroes = true; po.lower_case_e = printops.lower_case_e; po.lower_case_numbers = printops.lower_case_numbers; po.base_display = printops.base_display; po.abbreviate_names = false; po.use_unicode_signs = printops.use_unicode_signs; po.multiplication_sign = printops.multiplication_sign; po.division_sign = printops.division_sign; po.short_multiplication = false; po.excessive_parenthesis = true; po.improve_division_multipliers = false; po.restrict_to_parent_precision = false; po.spell_out_logical_operators = printops.spell_out_logical_operators; MathStructure mp(*((MathStructure*) x)); fread(&po.is_approximate, sizeof(bool*), 1, view_pipe); mp.format(po); parsed_text = mp.print(po); } printops.allow_non_usable = false; m.format(printops); result_text = m.print(printops); if(result_text == _("aborted")) { *printops.is_approximate = false; } b_busy = false; } return NULL; } void setResult(Prefix *prefix = NULL, bool update_parse = false, bool goto_input = true, size_t stack_index = 0, bool register_moved = false) { b_busy = true; string prev_result_text = result_text; result_text = "?"; if(update_parse) { parsed_text = "aborted"; } if(!rpn_mode) stack_index = 0; if(stack_index != 0) { update_parse = false; } if(register_moved) { update_parse = false; } if(register_moved) { result_text = _("RPN Register Moved"); } printops.prefix = prefix; CALCULATOR->saveState(); bool parsed_approx = false; if(stack_index == 0) { fwrite(&mstruct, sizeof(void*), 1, view_pipe_w); } else { MathStructure *mreg = CALCULATOR->getRPNRegister(stack_index + 1); fwrite(&mreg, sizeof(void*), 1, view_pipe_w); } bool b_stack = stack_index != 0; fwrite(&b_stack, sizeof(bool), 1, view_pipe_w); if(update_parse) { fwrite(&parsed_mstruct, sizeof(void*), 1, view_pipe_w); bool *parsed_approx_p = &parsed_approx; fwrite(&parsed_approx_p, sizeof(void*), 1, view_pipe_w); } else { void *x = NULL; fwrite(&x, sizeof(void*), 1, view_pipe_w); } fflush(view_pipe_w); struct timespec rtime; rtime.tv_sec = 0; rtime.tv_nsec = 10000000; int i = 0; bool has_printed = false; while(b_busy && i < 75) { nanosleep(&rtime, NULL); i++; } i = 0; if(b_busy && !cfile) { if(!result_only) { FPUTS_UNICODE(_("Processing (press Enter to abort)"), stdout); has_printed = true; fflush(stdout); } } #ifdef HAVE_LIBREADLINE int c = 0; #else char c = 0; #endif rtime.tv_nsec = 100000000; while(b_busy) { if(cfile) { nanosleep(&rtime, NULL); } else { FD_ZERO(&in_set); FD_SET(STDIN_FILENO, &in_set); if(select(FD_SETSIZE, &in_set, NULL, NULL, &timeout) > 0) { #ifdef HAVE_LIBREADLINE c = rl_read_key(); #else read(STDIN_FILENO, &c, 1); #endif if(c == '\n') { on_abort_display(); } } else { if(!result_only) { printf("."); fflush(stdout); } nanosleep(&rtime, NULL); } } } b_busy = true; if(has_printed) printf("\n"); if(goto_input) printf("\n "); if(register_moved) { update_parse = true; parsed_text = result_text; } if(!result_only && display_errors(goto_input) && goto_input) printf(" "); if(stack_index != 0) { RPNRegisterChanged(result_text, stack_index); } else { if(!result_only) { if(update_parse) { FPUTS_UNICODE(parsed_text.c_str(), stdout); } else { FPUTS_UNICODE(prev_result_text.c_str(), stdout); } if(!(*printops.is_approximate) && !mstruct->isApproximate()) { printf(" = "); } else { if(printops.use_unicode_signs) { printf(" " SIGN_ALMOST_EQUAL " "); } else { printf(" = %s ", _("approx.")); } } } PUTS_UNICODE(result_text.c_str()); if(goto_input) printf("\n"); } printops.prefix = NULL; b_busy = false; } void viewresult(Prefix *prefix = NULL) { setResult(prefix); } void result_display_updated() { if(expression_executed) setResult(NULL, false); } void result_format_updated() { if(expression_executed) setResult(NULL, false); } void result_action_executed() { if(expression_executed) { printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE); setResult(NULL, false); } } void result_prefix_changed(Prefix *prefix) { if(expression_executed) setResult(prefix, false); } void expression_format_updated() { if(expression_executed && !rpn_mode) execute_expression(); } void on_abort_command() { pthread_cancel(command_thread); CALCULATOR->restoreState(); CALCULATOR->clearBuffers(); b_busy = false; command_aborted = true; command_thread_started = false; } void *command_proc(void *pipe) { pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); FILE *command_pipe = (FILE*) pipe; while(true) { void *x = NULL; int command_type; fread(&command_type, sizeof(int), 1, command_pipe); fread(&x, sizeof(void*), 1, command_pipe); switch(command_type) { case COMMAND_FACTORIZE: { if(!((MathStructure*) x)->integerFactorize()) { ((MathStructure*) x)->factorize(evalops); } break; } case COMMAND_SIMPLIFY: { ((MathStructure*) x)->simplify(evalops); break; } } b_busy = false; } return NULL; } void execute_command(int command_type) { b_busy = true; command_aborted = false; CALCULATOR->saveState(); if(!command_thread_started) { pthread_create(&command_thread, &command_thread_attr, command_proc, command_pipe_r); command_thread_started = true; } fwrite(&command_type, sizeof(int), 1, command_pipe_w); MathStructure *mfactor = new MathStructure(*mstruct); fwrite(&mfactor, sizeof(void*), 1, command_pipe_w); fflush(command_pipe_w); struct timespec rtime; rtime.tv_sec = 0; rtime.tv_nsec = 10000000; int i = 0; bool has_printed = false; while(b_busy && i < 75) { nanosleep(&rtime, NULL); i++; } i = 0; if(b_busy && !cfile) { if(!result_only) { switch(command_type) { case COMMAND_FACTORIZE: { FPUTS_UNICODE(_("Factorizing (press Enter to abort)"), stdout); break; } case COMMAND_SIMPLIFY: { FPUTS_UNICODE(_("Simplifying (press Enter to abort)"), stdout); break; } } has_printed = true; fflush(stdout); } } #ifdef HAVE_LIBREADLINE int c = 0; #else char c = 0; #endif rtime.tv_nsec = 100000000; while(b_busy) { if(cfile) { nanosleep(&rtime, NULL); } else { FD_ZERO(&in_set); FD_SET(STDIN_FILENO, &in_set); if(select(FD_SETSIZE, &in_set, NULL, NULL, &timeout) > 0) { #ifdef HAVE_LIBREADLINE c = rl_read_key(); #else read(STDIN_FILENO, &c, 1); #endif if(c == '\n') { on_abort_command(); } } else { if(!result_only) { printf("."); fflush(stdout); } nanosleep(&rtime, NULL); } } } if(has_printed) printf("\n"); b_busy = false; if(!command_aborted) { mstruct->unref(); mstruct = mfactor; switch(command_type) { case COMMAND_FACTORIZE: { printops.allow_factorization = true; break; } case COMMAND_SIMPLIFY: { printops.allow_factorization = false; break; } } setResult(NULL, false); } } void execute_expression(bool goto_input, bool do_mathoperation, MathOperation op, MathFunction *f, bool do_stack, size_t stack_index) { string str; if(do_stack) { } else { str = expression_str; } expression_executed = true; b_busy = true; size_t stack_size = 0; if(do_stack) { stack_size = CALCULATOR->RPNStackSize(); CALCULATOR->setRPNRegister(stack_index + 1, CALCULATOR->unlocalizeExpression(str, evalops.parse_options), 0, evalops, parsed_mstruct, NULL, !printops.negative_exponents); } else if(rpn_mode) { stack_size = CALCULATOR->RPNStackSize(); if(do_mathoperation) { if(f) CALCULATOR->calculateRPN(f, 0, evalops, parsed_mstruct); else CALCULATOR->calculateRPN(op, 0, evalops, parsed_mstruct); } else { string str2 = CALCULATOR->unlocalizeExpression(str, evalops.parse_options); CALCULATOR->parseSigns(str2); remove_blank_ends(str2); if(str2.length() == 1) { do_mathoperation = true; switch(str2[0]) { case '^': {CALCULATOR->calculateRPN(OPERATION_RAISE, 0, evalops, parsed_mstruct); break;} case '+': {CALCULATOR->calculateRPN(OPERATION_ADD, 0, evalops, parsed_mstruct); break;} case '-': {CALCULATOR->calculateRPN(OPERATION_SUBTRACT, 0, evalops, parsed_mstruct); break;} case '*': {CALCULATOR->calculateRPN(OPERATION_MULTIPLY, 0, evalops, parsed_mstruct); break;} case '/': {CALCULATOR->calculateRPN(OPERATION_DIVIDE, 0, evalops, parsed_mstruct); break;} case '&': {CALCULATOR->calculateRPN(OPERATION_BITWISE_AND, 0, evalops, parsed_mstruct); break;} case '|': {CALCULATOR->calculateRPN(OPERATION_BITWISE_OR, 0, evalops, parsed_mstruct); break;} case '~': {CALCULATOR->calculateRPNBitwiseNot(0, evalops, parsed_mstruct); break;} case '!': {CALCULATOR->calculateRPN(CALCULATOR->f_factorial, 0, evalops, parsed_mstruct); break;} case '>': {CALCULATOR->calculateRPN(OPERATION_GREATER, 0, evalops, parsed_mstruct); break;} case '<': {CALCULATOR->calculateRPN(OPERATION_LESS, 0, evalops, parsed_mstruct); break;} case '=': {CALCULATOR->calculateRPN(OPERATION_EQUALS, 0, evalops, parsed_mstruct); break;} default: {do_mathoperation = false;} } } else if(str2.length() == 2) { if(str2 == "**") { CALCULATOR->calculateRPN(OPERATION_RAISE, 0, evalops, parsed_mstruct); do_mathoperation = true; } else if(str2 == "!!") { CALCULATOR->calculateRPN(CALCULATOR->f_factorial2, 0, evalops, parsed_mstruct); do_mathoperation = true; } else if(str2 == "!=" || str == "=!" || str == "<>") { CALCULATOR->calculateRPN(OPERATION_NOT_EQUALS, 0, evalops, parsed_mstruct); do_mathoperation = true; } else if(str2 == "<=" || str == "=<") { CALCULATOR->calculateRPN(OPERATION_EQUALS_LESS, 0, evalops, parsed_mstruct); do_mathoperation = true; } else if(str2 == ">=" || str == "=>") { CALCULATOR->calculateRPN(OPERATION_EQUALS_GREATER, 0, evalops, parsed_mstruct); do_mathoperation = true; } else if(str2 == "==") { CALCULATOR->calculateRPN(OPERATION_EQUALS, 0, evalops, parsed_mstruct); do_mathoperation = true; } } if(!do_mathoperation) { bool had_nonnum = false, test_function = true; int in_par = 0; for(size_t i = 0; i < str2.length(); i++) { if(is_in(NUMBERS, str2[i])) { if(!had_nonnum || in_par) { test_function = false; break; } } else if(str2[i] == '(') { if(in_par || !had_nonnum) { test_function = false; break; } in_par = i; } else if(str2[i] == ')') { if(i != str2.length() - 1) { test_function = false; break; } } else if(str2[i] == ' ') { if(!in_par) { test_function = false; break; } } else if(is_in(NOT_IN_NAMES, str2[i])) { test_function = false; break; } else { if(in_par) { test_function = false; break; } had_nonnum = true; } } f = NULL; if(test_function) { if(in_par) f = CALCULATOR->getActiveFunction(str2.substr(0, in_par)); else f = CALCULATOR->getActiveFunction(str2); } if(f && f->minargs() > 1) { printf("Can only apply functions wich requires one argument on RPN stack.\n"); f = NULL; return; } if(f && f->minargs() > 0) { do_mathoperation = true; CALCULATOR->calculateRPN(f, 0, evalops, parsed_mstruct); } else { CALCULATOR->RPNStackEnter(str2, 0, evalops, parsed_mstruct, NULL, !printops.negative_exponents); } } } } else { CALCULATOR->calculate(mstruct, CALCULATOR->unlocalizeExpression(str, evalops.parse_options), 0, evalops, parsed_mstruct, NULL, !printops.negative_exponents); } struct timespec rtime; rtime.tv_sec = 0; rtime.tv_nsec = 10000000; int i = 0; while(CALCULATOR->busy() && i < 75) { nanosleep(&rtime, NULL); i++; } i = 0; bool has_printed = false; if(CALCULATOR->busy() && !cfile) { if(!result_only) { FPUTS_UNICODE(_("Calculating (press Enter to abort)"), stdout); fflush(stdout); has_printed = true; } } #ifdef HAVE_LIBREADLINE int c = 0; #else char c = 0; #endif rtime.tv_nsec = 100000000; while(CALCULATOR->busy()) { if(cfile) { nanosleep(&rtime, NULL); } else { FD_ZERO(&in_set); FD_SET(STDIN_FILENO, &in_set); if(select(FD_SETSIZE, &in_set, NULL, NULL, &timeout) > 0) { #ifdef HAVE_LIBREADLINE c = rl_read_key(); #else read(STDIN_FILENO, &c, 1); #endif if(c == '\n') { CALCULATOR->abort(); } } else { if(!result_only) { printf("."); fflush(stdout); } nanosleep(&rtime, NULL); } } } if(has_printed) printf("\n"); b_busy = false; if(rpn_mode && (!do_stack || stack_index == 0)) { mstruct->unref(); mstruct = CALCULATOR->getRPNRegister(1); if(!mstruct) mstruct = new MathStructure(); else mstruct->ref(); } //update "ans" variables if(!do_stack || stack_index == 0) { vans[4]->set(vans[3]->get()); vans[3]->set(vans[2]->get()); vans[2]->set(vans[1]->get()); vans[1]->set(vans[0]->get()); vans[0]->set(*mstruct); } if(do_stack && stack_index > 0) { } else if(rpn_mode && do_mathoperation) { result_text = _("RPN Operation"); } else { result_text = str; } printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE); if(rpn_mode && (!do_stack || stack_index == 0)) { if(CALCULATOR->RPNStackSize() < stack_size) { RPNRegisterRemoved(1); } else if(CALCULATOR->RPNStackSize() > stack_size) { RPNRegisterAdded(""); } } setResult(NULL, (!do_stack || stack_index == 0), goto_input, do_stack ? stack_index : 0); } /* save mode to file */ bool save_mode() { return save_preferences(true); } /* remember current mode */ void set_saved_mode() { saved_precision = CALCULATOR->getPrecision(); saved_printops = printops; saved_printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE); saved_evalops = evalops; saved_assumption_type = CALCULATOR->defaultAssumptions()->type(); saved_assumption_sign = CALCULATOR->defaultAssumptions()->sign(); } void load_preferences() { printops.is_approximate = new bool(false); printops.prefix = NULL; printops.use_min_decimals = false; printops.use_denominator_prefix = true; printops.min_decimals = 0; printops.use_max_decimals = false; printops.max_decimals = 2; printops.base = 10; printops.min_exp = EXP_PRECISION; printops.negative_exponents = false; printops.sort_options.minus_last = true; printops.indicate_infinite_series = false; printops.show_ending_zeroes = false; printops.round_halfway_to_even = false; printops.number_fraction_format = FRACTION_DECIMAL; printops.abbreviate_names = true; printops.use_unicode_signs = false; printops.use_unit_prefixes = true; printops.spacious = true; printops.short_multiplication = true; printops.limit_implicit_multiplication = false; printops.place_units_separately = true; printops.use_all_prefixes = false; printops.excessive_parenthesis = false; printops.allow_non_usable = false; printops.lower_case_numbers = false; printops.lower_case_e = false; printops.base_display = BASE_DISPLAY_NORMAL; printops.division_sign = DIVISION_SIGN_SLASH; printops.multiplication_sign = MULTIPLICATION_SIGN_ASTERISK; printops.allow_factorization = false; printops.spell_out_logical_operators = true; evalops.parse_options.limit_implicit_multiplication = false; evalops.approximation = APPROXIMATION_TRY_EXACT; evalops.sync_units = true; evalops.structuring = STRUCTURING_SIMPLIFY; evalops.parse_options.unknowns_enabled = false; evalops.parse_options.read_precision = DONT_READ_PRECISION; evalops.parse_options.base = BASE_DECIMAL; evalops.allow_complex = true; evalops.allow_infinite = true; evalops.auto_post_conversion = POST_CONVERSION_NONE; evalops.assume_denominators_nonzero = true; evalops.warn_about_denominators_assumed_nonzero = true; evalops.parse_options.angle_unit = ANGLE_UNIT_RADIANS; evalops.parse_options.dot_as_separator = CALCULATOR->default_dot_as_separator; rpn_mode = false; save_mode_on_exit = true; save_defs_on_exit = true; fetch_exchange_rates_at_startup = false; first_time = false; string filename = getLocalDir(); DIR *dir = opendir(filename.c_str()); if(!dir) { first_qalculate_run = true; first_time = true; set_saved_mode(); return; } else { first_qalculate_run = false; closedir(dir); } #ifdef HAVE_LIBREADLINE stifle_history(100); string historyfile = filename; historyfile += "qalc.history"; read_history(historyfile.c_str()); #endif int version_numbers[] = {0, 9, 6}; FILE *file = NULL; filename += "qalc.cfg"; file = fopen(filename.c_str(), "r"); if(file) { char line[10000]; string stmp, svalue, svar; size_t i; int v; while(true) { if(fgets(line, 10000, file) == NULL) break; stmp = line; remove_blank_ends(stmp); if((i = stmp.find_first_of("=")) != string::npos) { svar = stmp.substr(0, i); remove_blank_ends(svar); svalue = stmp.substr(i + 1, stmp.length() - (i + 1)); remove_blank_ends(svalue); v = s2i(svalue); if(svar == "version") { parse_qalculate_version(svalue, version_numbers); } else if(svar == "save_mode_on_exit") { save_mode_on_exit = v; } else if(svar == "save_definitions_on_exit") { save_defs_on_exit = v; } else if(svar == "fetch_exchange_rates_at_startup") { fetch_exchange_rates_at_startup = v; } else if(svar == "min_deci") { printops.min_decimals = v; } else if(svar == "use_min_deci") { printops.use_min_decimals = v; } else if(svar == "max_deci") { printops.max_decimals = v; } else if(svar == "use_max_deci") { printops.use_max_decimals = v; } else if(svar == "precision") { CALCULATOR->setPrecision(v); } else if(svar == "min_exp") { printops.min_exp = v; } else if(svar == "negative_exponents") { printops.negative_exponents = v; } else if(svar == "sort_minus_last") { printops.sort_options.minus_last = v; } else if(svar == "spacious") { printops.spacious = v; } else if(svar == "excessive_parenthesis") { printops.excessive_parenthesis = v; } else if(svar == "short_multiplication") { printops.short_multiplication = v; } else if(svar == "limit_implicit_multiplication") { evalops.parse_options.limit_implicit_multiplication = v; printops.limit_implicit_multiplication = v; } else if(svar == "place_units_separately") { printops.place_units_separately = v; } else if(svar == "use_prefixes") { printops.use_unit_prefixes = v; } else if(svar == "number_fraction_format") { if(v >= FRACTION_DECIMAL && v <= FRACTION_COMBINED) { printops.number_fraction_format = (NumberFractionFormat) v; } } else if(svar == "number_base") { printops.base = v; } else if(svar == "number_base_expression") { evalops.parse_options.base = v; } else if(svar == "read_precision") { if(v >= DONT_READ_PRECISION && v <= READ_PRECISION_WHEN_DECIMALS) { evalops.parse_options.read_precision = (ReadPrecisionMode) v; } } else if(svar == "assume_denominators_nonzero") { if(version_numbers[0] == 0 && (version_numbers[1] < 9 || (version_numbers[1] == 9 && version_numbers[2] == 0))) { v = true; } evalops.assume_denominators_nonzero = v; } else if(svar == "warn_about_denominators_assumed_nonzero") { evalops.warn_about_denominators_assumed_nonzero = v; } else if(svar == "structuring") { if(v >= STRUCTURING_NONE && v <= STRUCTURING_FACTORIZE) { evalops.structuring = (StructuringMode) v; printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE); } } else if(svar == "angle_unit") { if(version_numbers[0] == 0 && (version_numbers[1] < 7 || (version_numbers[1] == 7 && version_numbers[2] == 0))) { v++; } if(v >= ANGLE_UNIT_NONE && v <= ANGLE_UNIT_GRADIANS) { evalops.parse_options.angle_unit = (AngleUnit) v; } } else if(svar == "functions_enabled") { evalops.parse_options.functions_enabled = v; } else if(svar == "variables_enabled") { evalops.parse_options.variables_enabled = v; } else if(svar == "calculate_variables") { evalops.calculate_variables = v; } else if(svar == "calculate_functions") { evalops.calculate_functions = v; } else if(svar == "sync_units") { evalops.sync_units = v; } else if(svar == "unknownvariables_enabled") { evalops.parse_options.unknowns_enabled = v; } else if(svar == "units_enabled") { evalops.parse_options.units_enabled = v; } else if(svar == "allow_complex") { evalops.allow_complex = v; } else if(svar == "allow_infinite") { evalops.allow_infinite = v; } else if(svar == "use_short_units") { printops.abbreviate_names = v; } else if(svar == "abbreviate_names") { printops.abbreviate_names = v; } else if(svar == "all_prefixes_enabled") { printops.use_all_prefixes = v; } else if(svar == "denominator_prefix_enabled") { printops.use_denominator_prefix = v; } else if(svar == "auto_post_conversion") { if(v >= POST_CONVERSION_NONE && v <= POST_CONVERSION_BASE) { evalops.auto_post_conversion = (AutoPostConversion) v; } } else if(svar == "use_unicode_signs") { printops.use_unicode_signs = v; } else if(svar == "lower_case_numbers") { printops.lower_case_numbers = v; } else if(svar == "lower_case_e") { printops.lower_case_e = v; } else if(svar == "base_display") { if(v >= BASE_DISPLAY_NONE && v <= BASE_DISPLAY_ALTERNATIVE) printops.base_display = (BaseDisplay) v; } else if(svar == "spell_out_logical_operators") { printops.spell_out_logical_operators = v; } else if(svar == "dot_as_separator") { evalops.parse_options.dot_as_separator = v; } else if(svar == "multiplication_sign") { if(v >= MULTIPLICATION_SIGN_ASTERISK && v <= MULTIPLICATION_SIGN_X) printops.multiplication_sign = (MultiplicationSign) v; } else if(svar == "division_sign") { if(v >= DIVISION_SIGN_SLASH && v <= DIVISION_SIGN_DIVISION) printops.division_sign = (DivisionSign) v; } else if(svar == "indicate_infinite_series") { printops.indicate_infinite_series = v; } else if(svar == "show_ending_zeroes") { printops.show_ending_zeroes = v; } else if(svar == "round_halfway_to_even") { printops.round_halfway_to_even = v; } else if(svar == "approximation") { if(v >= APPROXIMATION_EXACT && v <= APPROXIMATION_APPROXIMATE) { evalops.approximation = (ApproximationMode) v; } } else if(svar == "in_rpn_mode") { rpn_mode = v; } else if(svar == "rpn_syntax") { evalops.parse_options.rpn = v; } else if(svar == "default_assumption_type") { if(v >= ASSUMPTION_TYPE_NONE && v <= ASSUMPTION_TYPE_INTEGER) { if(v == ASSUMPTION_TYPE_NONE && version_numbers[0] == 0 && (version_numbers[1] < 9 || (version_numbers[1] == 9 && version_numbers[2] == 0))) { v = ASSUMPTION_TYPE_NONMATRIX; } CALCULATOR->defaultAssumptions()->setType((AssumptionType) v); } } else if(svar == "default_assumption_sign") { if(v >= ASSUMPTION_SIGN_UNKNOWN && v <= ASSUMPTION_SIGN_NONZERO) { if(v == ASSUMPTION_SIGN_NONZERO && version_numbers[0] == 0 && (version_numbers[1] < 9 || (version_numbers[1] == 9 && version_numbers[2] == 0))) { v = ASSUMPTION_SIGN_UNKNOWN; } CALCULATOR->defaultAssumptions()->setSign((AssumptionSign) v); } } } } } else { first_time = true; } //remember start mode for when we save preferences set_saved_mode(); } /* save preferences to ~/.qalculate/qalc.cfg set mode to true to save current calculator mode */ bool save_preferences(bool mode) { FILE *file = NULL; string filename = getLocalDir(); mkdir(filename.c_str(), S_IRWXU); #ifdef HAVE_LIBREADLINE string historyfile = filename; historyfile += "qalc.history"; write_history(historyfile.c_str()); #endif filename += "qalc.cfg"; file = fopen(filename.c_str(), "w+"); if(file == NULL) { fprintf(stderr, _("Couldn't write preferences to\n%s"), filename.c_str()); return false; } fprintf(file, "\n[General]\n"); fprintf(file, "version=%s\n", VERSION); fprintf(file, "save_mode_on_exit=%i\n", save_mode_on_exit); fprintf(file, "save_definitions_on_exit=%i\n", save_defs_on_exit); fprintf(file, "fetch_exchange_rates_at_startup=%i\n", fetch_exchange_rates_at_startup); fprintf(file, "spacious=%i\n", printops.spacious); fprintf(file, "excessive_parenthesis=%i\n", printops.excessive_parenthesis); fprintf(file, "short_multiplication=%i\n", printops.short_multiplication); fprintf(file, "use_unicode_signs=%i\n", printops.use_unicode_signs); fprintf(file, "lower_case_numbers=%i\n", printops.lower_case_numbers); fprintf(file, "lower_case_e=%i\n", printops.lower_case_e); fprintf(file, "base_display=%i\n", printops.base_display); fprintf(file, "spell_out_logical_operators=%i\n", printops.spell_out_logical_operators); fprintf(file, "dot_as_separator=%i\n", evalops.parse_options.dot_as_separator); fprintf(file, "multiplication_sign=%i\n", printops.multiplication_sign); fprintf(file, "division_sign=%i\n", printops.division_sign); if(mode) set_saved_mode(); fprintf(file, "\n[Mode]\n"); fprintf(file, "min_deci=%i\n", saved_printops.min_decimals); fprintf(file, "use_min_deci=%i\n", saved_printops.use_min_decimals); fprintf(file, "max_deci=%i\n", saved_printops.max_decimals); fprintf(file, "use_max_deci=%i\n", saved_printops.use_max_decimals); fprintf(file, "precision=%i\n", saved_precision); fprintf(file, "min_exp=%i\n", saved_printops.min_exp); fprintf(file, "negative_exponents=%i\n", saved_printops.negative_exponents); fprintf(file, "sort_minus_last=%i\n", saved_printops.sort_options.minus_last); fprintf(file, "number_fraction_format=%i\n", saved_printops.number_fraction_format); fprintf(file, "use_prefixes=%i\n", saved_printops.use_unit_prefixes); fprintf(file, "abbreviate_names=%i\n", saved_printops.abbreviate_names); fprintf(file, "all_prefixes_enabled=%i\n", saved_printops.use_all_prefixes); fprintf(file, "denominator_prefix_enabled=%i\n", saved_printops.use_denominator_prefix); fprintf(file, "place_units_separately=%i\n", saved_printops.place_units_separately); fprintf(file, "auto_post_conversion=%i\n", saved_evalops.auto_post_conversion); fprintf(file, "number_base=%i\n", saved_printops.base); fprintf(file, "number_base_expression=%i\n", saved_evalops.parse_options.base); fprintf(file, "read_precision=%i\n", saved_evalops.parse_options.read_precision); fprintf(file, "assume_denominators_nonzero=%i\n", saved_evalops.assume_denominators_nonzero); fprintf(file, "warn_about_denominators_assumed_nonzero=%i\n", saved_evalops.warn_about_denominators_assumed_nonzero); fprintf(file, "structuring=%i\n", saved_evalops.structuring); fprintf(file, "angle_unit=%i\n", saved_evalops.parse_options.angle_unit); fprintf(file, "functions_enabled=%i\n", saved_evalops.parse_options.functions_enabled); fprintf(file, "variables_enabled=%i\n", saved_evalops.parse_options.variables_enabled); fprintf(file, "calculate_variables=%i\n", saved_evalops.calculate_variables); fprintf(file, "calculate_functions=%i\n", saved_evalops.calculate_functions); fprintf(file, "sync_units=%i\n", saved_evalops.sync_units); fprintf(file, "unknownvariables_enabled=%i\n", saved_evalops.parse_options.unknowns_enabled); fprintf(file, "units_enabled=%i\n", saved_evalops.parse_options.units_enabled); fprintf(file, "allow_complex=%i\n", saved_evalops.allow_complex); fprintf(file, "allow_infinite=%i\n", saved_evalops.allow_infinite); fprintf(file, "indicate_infinite_series=%i\n", saved_printops.indicate_infinite_series); fprintf(file, "show_ending_zeroes=%i\n", saved_printops.show_ending_zeroes); fprintf(file, "round_halfway_to_even=%i\n", saved_printops.round_halfway_to_even); fprintf(file, "approximation=%i\n", saved_evalops.approximation); fprintf(file, "in_rpn_mode=%i\n", rpn_mode); fprintf(file, "rpn_syntax=%i\n", saved_evalops.parse_options.rpn); fprintf(file, "limit_implicit_multiplication=%i\n", evalops.parse_options.limit_implicit_multiplication); fprintf(file, "default_assumption_type=%i\n", CALCULATOR->defaultAssumptions()->type()); fprintf(file, "default_assumption_sign=%i\n", CALCULATOR->defaultAssumptions()->sign()); fclose(file); return true; } /* save definitions to ~/.qalculate/qalculate.cfg the hard work is done in the Calculator class */ bool save_defs() { if(!CALCULATOR->saveDefinitions()) { PUTS_UNICODE(_("Couldn't write definitions")); return false; } return true; } libqalculate-0.9.7/src/Makefile.am0000644000175100017510000000112611305546374013747 00000000000000# # src/Makefile.am for qalculate # INCLUDES = \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ -I../libqalculate \ @GLIB_CFLAGS@ bin_PROGRAMS = @QALCULATE_TEXT@ noinst_PROGRAMS = @QALCULATE_DEFS2DOC@ EXTRA_PROGRAMS = qalc defs2doc qalc_SOURCES = qalc.cc qalc_LDADD = \ @GLIB_LIBS@ \ @READLINE_LIBS@ \ ../libqalculate/libqalculate.la defs2doc_SOURCES = defs2doc.cc defs2doc_LDADD = \ @GLIB_LIBS@ \ ../libqalculate/libqalculate.la #install-exec-local: # cd $(DESTDIR)$(bindir) && rm -f qalculate; $(LN_S) @LN_QALCULATE@ qalculate libqalculate-0.9.7/src/Makefile.in0000644000175100017510000004173411320655032013756 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ # # src/Makefile.am for qalculate # VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ EXTRA_PROGRAMS = qalc$(EXEEXT) defs2doc$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_defs2doc_OBJECTS = defs2doc.$(OBJEXT) defs2doc_OBJECTS = $(am_defs2doc_OBJECTS) defs2doc_DEPENDENCIES = ../libqalculate/libqalculate.la am_qalc_OBJECTS = qalc.$(OBJEXT) qalc_OBJECTS = $(am_qalc_OBJECTS) qalc_DEPENDENCIES = ../libqalculate/libqalculate.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(defs2doc_SOURCES) $(qalc_SOURCES) DIST_SOURCES = $(defs2doc_SOURCES) $(qalc_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_CPPFLAGS = @CLN_CPPFLAGS@ CLN_LIBS = @CLN_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@ INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@ INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@ INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@ INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@ INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@ INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@ INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@ INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@ INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@ INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@ INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@ INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NMEDIT = @NMEDIT@ 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@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ -I../libqalculate \ @GLIB_CFLAGS@ bin_PROGRAMS = @QALCULATE_TEXT@ noinst_PROGRAMS = @QALCULATE_DEFS2DOC@ qalc_SOURCES = qalc.cc qalc_LDADD = \ @GLIB_LIBS@ \ @READLINE_LIBS@ \ ../libqalculate/libqalculate.la defs2doc_SOURCES = defs2doc.cc defs2doc_LDADD = \ @GLIB_LIBS@ \ ../libqalculate/libqalculate.la all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done defs2doc$(EXEEXT): $(defs2doc_OBJECTS) $(defs2doc_DEPENDENCIES) @rm -f defs2doc$(EXEEXT) $(CXXLINK) $(defs2doc_OBJECTS) $(defs2doc_LDADD) $(LIBS) qalc$(EXEEXT): $(qalc_OBJECTS) $(qalc_DEPENDENCIES) @rm -f qalc$(EXEEXT) $(CXXLINK) $(qalc_OBJECTS) $(qalc_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defs2doc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qalc.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonemtpy = 1; } \ END { if (nonempty) { 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; nonempty = 1; } \ END { if (nonempty) { 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=; \ 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; nonempty = 1; } \ END { if (nonempty) { 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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 $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; 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-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-noinstPROGRAMS ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am 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-binPROGRAMS #install-exec-local: # cd $(DESTDIR)$(bindir) && rm -f qalculate; $(LN_S) @LN_QALCULATE@ qalculate # 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: libqalculate-0.9.7/src/defs2doc.cc0000644000175100017510000006147711305546374013732 00000000000000/* Qalculate Copyright (C) 2004 Niklas Knutsson (nq@altern.org) 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. */ #include "support.h" #include #include #include #include #include #include #include #include #include #include KnownVariable *vans[5]; PrintOptions printops; EvaluationOptions evalops; char buffer[1000]; FILE *ffile, *vfile, *ufile; bool is_answer_variable(Variable *v) { return v == vans[0] || v == vans[1] || v == vans[2] || v == vans[3] || v == vans[4]; } string fix(string str) { gsub("&", "&", str); gsub("<", "<", str); gsub(">", ">", str); gsub("\n", "", str); return str; } string fixcat(string str) { gsub(" ", "-", str); gsub(".", "", str); gsub("&", "", str); gsub("<", "", str); gsub(">", "", str); return str; } struct tree_struct { string item; list items; list::iterator it; list::reverse_iterator rit; vector objects; tree_struct *parent; void sort() { items.sort(); for(list::iterator it = items.begin(); it != items.end(); ++it) { it->sort(); } } bool operator < (tree_struct &s1) const { return item < s1.item; } }; tree_struct function_cats, unit_cats, variable_cats; vector ia_units, ia_variables, ia_functions; void generate_units_tree_struct() { size_t cat_i, cat_i_prev; bool b; string str, cat, cat_sub; Unit *u = NULL; unit_cats.items.clear(); unit_cats.objects.clear(); unit_cats.parent = NULL; ia_units.clear(); list::iterator it; for(size_t i = 0; i < CALCULATOR->units.size(); i++) { if(!CALCULATOR->units[i]->isActive()) { b = false; for(size_t i3 = 0; i3 < ia_units.size(); i3++) { u = (Unit*) ia_units[i3]; if(CALCULATOR->units[i]->title() < u->title()) { b = true; ia_units.insert(ia_units.begin() + i3, (void*) CALCULATOR->units[i]); break; } } if(!b) ia_units.push_back((void*) CALCULATOR->units[i]); } else { tree_struct *item = &unit_cats; if(!CALCULATOR->units[i]->category().empty()) { cat = CALCULATOR->units[i]->category(); cat_i = cat.find("/"); cat_i_prev = 0; b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(it = item->items.begin(); it != item->items.end(); ++it) { if(cat_sub == it->item) { item = &*it; b = true; break; } } if(!b) { tree_struct cat; item->items.push_back(cat); it = item->items.end(); --it; it->parent = item; item = &*it; item->item = cat_sub; } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } b = false; for(size_t i3 = 0; i3 < item->objects.size(); i3++) { u = (Unit*) item->objects[i3]; if(CALCULATOR->units[i]->title() < u->title()) { b = true; item->objects.insert(item->objects.begin() + i3, (void*) CALCULATOR->units[i]); break; } } if(!b) item->objects.push_back((void*) CALCULATOR->units[i]); } } unit_cats.sort(); } void generate_variables_tree_struct() { size_t cat_i, cat_i_prev; bool b; string str, cat, cat_sub; Variable *v = NULL; variable_cats.items.clear(); variable_cats.objects.clear(); variable_cats.parent = NULL; ia_variables.clear(); list::iterator it; for(size_t i = 0; i < CALCULATOR->variables.size(); i++) { if(!CALCULATOR->variables[i]->isActive()) { //deactivated variable b = false; for(size_t i3 = 0; i3 < ia_variables.size(); i3++) { v = (Variable*) ia_variables[i3]; if(CALCULATOR->variables[i]->title() < v->title()) { b = true; ia_variables.insert(ia_variables.begin() + i3, (void*) CALCULATOR->variables[i]); break; } } if(!b) ia_variables.push_back((void*) CALCULATOR->variables[i]); } else { tree_struct *item = &variable_cats; if(!CALCULATOR->variables[i]->category().empty()) { cat = CALCULATOR->variables[i]->category(); cat_i = cat.find("/"); cat_i_prev = 0; b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(it = item->items.begin(); it != item->items.end(); ++it) { if(cat_sub == it->item) { item = &*it; b = true; break; } } if(!b) { tree_struct cat; item->items.push_back(cat); it = item->items.end(); --it; it->parent = item; item = &*it; item->item = cat_sub; } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } b = false; for(size_t i3 = 0; i3 < item->objects.size(); i3++) { v = (Variable*) item->objects[i3]; if(CALCULATOR->variables[i]->title() < v->title()) { b = true; item->objects.insert(item->objects.begin() + i3, (void*) CALCULATOR->variables[i]); break; } } if(!b) item->objects.push_back((void*) CALCULATOR->variables[i]); } } variable_cats.sort(); } void generate_functions_tree_struct() { size_t cat_i, cat_i_prev; bool b; string str, cat, cat_sub; MathFunction *f = NULL; function_cats.items.clear(); function_cats.objects.clear(); function_cats.parent = NULL; ia_functions.clear(); list::iterator it; for(size_t i = 0; i < CALCULATOR->functions.size(); i++) { if(!CALCULATOR->functions[i]->isActive()) { //deactivated function b = false; for(size_t i3 = 0; i3 < ia_functions.size(); i3++) { f = (MathFunction*) ia_functions[i3]; if(CALCULATOR->functions[i]->title() < f->title()) { b = true; ia_functions.insert(ia_functions.begin() + i3, (void*) CALCULATOR->functions[i]); break; } } if(!b) ia_functions.push_back((void*) CALCULATOR->functions[i]); } else { tree_struct *item = &function_cats; if(!CALCULATOR->functions[i]->category().empty()) { cat = CALCULATOR->functions[i]->category(); cat_i = cat.find("/"); cat_i_prev = 0; b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(it = item->items.begin(); it != item->items.end(); ++it) { if(cat_sub == it->item) { item = &*it; b = true; break; } } if(!b) { tree_struct cat; item->items.push_back(cat); it = item->items.end(); --it; it->parent = item; item = &*it; item->item = cat_sub; } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } b = false; for(size_t i3 = 0; i3 < item->objects.size(); i3++) { f = (MathFunction*) item->objects[i3]; if(CALCULATOR->functions[i]->title() < f->title()) { b = true; item->objects.insert(item->objects.begin() + i3, (void*) CALCULATOR->functions[i]); break; } } if(!b) item->objects.push_back((void*) CALCULATOR->functions[i]); } } function_cats.sort(); } void print_function(MathFunction *f) { string str; fputs("\n", ffile); fprintf(ffile, "%s\n", f->title(false).c_str()); fputs("\n", ffile); Argument *arg; Argument default_arg; string str2; const ExpressionName *ename = &f->preferredName(false, printops.use_unicode_signs); str = ename->name; int iargs = f->maxargs(); if(iargs < 0) { iargs = f->minargs() + 1; } str += "("; if(iargs != 0) { for(int i2 = 1; i2 <= iargs; i2++) { if(i2 > f->minargs()) { str += "["; } if(i2 > 1) { str += CALCULATOR->getComma(); str += " "; } arg = f->getArgumentDefinition(i2); if(arg && !arg->name().empty()) { str2 = arg->name(); } else { str2 = _("argument"); str2 += " "; str2 += i2s(i2); } str += str2; if(i2 > f->minargs()) { str += "]"; } } if(f->maxargs() < 0) { str += CALCULATOR->getComma(); str += " ..."; } } str += ")"; fprintf(ffile, "%s\n", str.c_str()); for(size_t i2 = 1; i2 <= f->countNames(); i2++) { if(&f->getName(i2) != ename) { fprintf(ffile, "%s", f->getName(i2).name.c_str()); } } if(f->subtype() == SUBTYPE_DATA_SET) { fputs("", ffile); fprintf(ffile, _("Retrieves data from the %s data set for a given object and property. If \"info\" is typed as property, all properties of the object will be listed."), f->title().c_str()); fputs("", ffile); } if(!f->description().empty()) { fprintf(ffile, "%s\n", fix(f->description()).c_str()); } if(f->subtype() == SUBTYPE_DATA_SET && !((DataSet*) f)->copyright().empty()) { fprintf(ffile, "%s\n", fix(((DataSet*) f)->copyright()).c_str()); } if(iargs) { fputs("\n", ffile); fprintf(ffile, "%s", _("Arguments")); fputs("\n", ffile); for(int i2 = 1; i2 <= iargs; i2++) { arg = f->getArgumentDefinition(i2); if(arg && !arg->name().empty()) { str = arg->name(); } else { str = i2s(i2); } str += ": "; if(arg) { str2 = fix(arg->printlong()); } else { str2 = fix(default_arg.printlong()); } if(i2 > f->minargs()) { str2 += " ("; str2 += _("optional"); if(!f->getDefaultValue(i2).empty()) { str2 += ", "; str2 += _("default: "); str2 += f->getDefaultValue(i2); } str2 += ")"; } str += str2; fprintf(ffile, "%s\n", str.c_str()); } fputs("\n", ffile); fputs("\n", ffile); } if(!f->condition().empty()) { fputs("\n", ffile); fprintf(ffile, "%s", _("Requirement")); fputs("\n", ffile); fputs(fix(f->printCondition()).c_str(), ffile); fputs("\n", ffile); fputs("\n", ffile); fputs("\n", ffile); } if(f->subtype() == SUBTYPE_DATA_SET) { DataSet *ds = (DataSet*) f; fputs("\n", ffile); fprintf(ffile, "%s", _("Properties")); fputs("\n", ffile); DataPropertyIter it; DataProperty *dp = ds->getFirstProperty(&it); while(dp) { if(!dp->isHidden()) { if(!dp->title(false).empty()) { str = dp->title(); str += ": "; } for(size_t i = 1; i <= dp->countNames(); i++) { if(i > 1) str += ", "; str += dp->getName(i); } if(dp->isKey()) { str += " ("; str += _("key"); str += ")"; } if(!dp->description().empty()) { str += ""; str += fix(dp->description()); } fprintf(ffile, "%s\n", str.c_str()); } dp = ds->getNextProperty(&it); } fputs("\n", ffile); fputs("\n", ffile); } fputs("\n", ffile); fputs("\n", ffile); } void print_variable(Variable *v) { string value, str; fputs("\n", vfile); fprintf(vfile, "%s\n", v->title().c_str()); for(size_t i2 = 1; i2 <= v->countNames(); i2++) { if(i2 > 1) str += " / "; str += v->getName(i2).name; } fprintf(vfile, "%s\n", str.c_str()); value = ""; if(is_answer_variable(v)) { value = _("a previous result"); } else if(v->isKnown()) { if(((KnownVariable*) v)->isExpression()) { value = fix(CALCULATOR->localizeExpression(((KnownVariable*) v)->expression())); if(value.length() > 40) { value = value.substr(0, 30); value += "..."; } } else { if(((KnownVariable*) v)->get().isMatrix()) { value = _("matrix"); } else if(((KnownVariable*) v)->get().isVector()) { value = _("vector"); } else { value = fix(CALCULATOR->printMathStructureTimeOut(((KnownVariable*) v)->get(), 30)); } } } else { if(((UnknownVariable*) v)->assumptions()) { switch(((UnknownVariable*) v)->assumptions()->sign()) { case ASSUMPTION_SIGN_POSITIVE: {value = _("positive"); break;} case ASSUMPTION_SIGN_NONPOSITIVE: {value = _("non-positive"); break;} case ASSUMPTION_SIGN_NEGATIVE: {value = _("negative"); break;} case ASSUMPTION_SIGN_NONNEGATIVE: {value = _("non-negative"); break;} case ASSUMPTION_SIGN_NONZERO: {value = _("non-zero"); break;} default: {} } if(!value.empty() && !((UnknownVariable*) v)->assumptions()->type() == ASSUMPTION_TYPE_NONE) value += " "; switch(((UnknownVariable*) v)->assumptions()->type()) { case ASSUMPTION_TYPE_INTEGER: {value += _("integer"); break;} case ASSUMPTION_TYPE_RATIONAL: {value += _("rational"); break;} case ASSUMPTION_TYPE_REAL: {value += _("real"); break;} case ASSUMPTION_TYPE_COMPLEX: {value += _("complex"); break;} case ASSUMPTION_TYPE_NUMBER: {value += _("number"); break;} case ASSUMPTION_TYPE_NONMATRIX: {value += _("non-matrix"); break;} default: {} } if(value.empty()) value = _("unknown"); } else { value = _("default assumptions"); } } if(v->isApproximate()) { value += " ("; value += _("approximate"); value += ")"; } fprintf(vfile, "%s\n", value.c_str()); fputs("\n", vfile); } void print_unit(Unit *u) { string str, base_unit, relation; fputs("\n", ufile); fprintf(ufile, "%s\n", u->title().c_str()); for(size_t i2 = 1; i2 <= u->countNames(); i2++) { if(i2 > 1) str += " / "; str += u->getName(i2).name; } if(u->subtype() == SUBTYPE_COMPOSITE_UNIT) { fprintf(ufile, "(%s)\n", str.c_str()); } else { fprintf(ufile, "%s\n", str.c_str()); } switch(u->subtype()) { case SUBTYPE_BASE_UNIT: { base_unit = ""; relation = ""; break; } case SUBTYPE_ALIAS_UNIT: { AliasUnit *au = (AliasUnit*) u; base_unit = au->firstBaseUnit()->preferredDisplayName(printops.abbreviate_names, printops.use_unicode_signs).name; if(au->firstBaseExponent() != 1) { base_unit += POWER; base_unit += i2s(au->firstBaseExponent()); } if(au->firstBaseUnit() == CALCULATOR->u_euro && au->isBuiltin()) { relation = "exchange rate"; } else { relation = fix(CALCULATOR->localizeExpression(au->expression()).c_str()); } if(u->isApproximate()) { relation += " ("; relation += _("approximate"); relation += ")"; } break; } case SUBTYPE_COMPOSITE_UNIT: { base_unit = fix(((CompositeUnit*) u)->print(false, true, printops.use_unicode_signs)); relation = ""; break; } } fprintf(ufile, "%s\n", base_unit.c_str()); fprintf(ufile, "%s\n", relation.c_str()); fputs("\n", ufile); } int main(int, char *[]) { #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); #endif //create the almighty Calculator object new Calculator(); ffile = fopen("appendixa.xml", "w+"); vfile = fopen("appendixb.xml", "w+"); ufile = fopen("appendixc.xml", "w+"); string str; CALCULATOR->loadExchangeRates(); string ans_str = _("ans"); vans[0] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str, m_undefined, _("Last Answer"), false)); vans[0]->addName(_("answer")); vans[0]->addName(ans_str + "1"); vans[1] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "2", m_undefined, _("Answer 2"), false)); vans[2] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "3", m_undefined, _("Answer 3"), false)); vans[3] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "4", m_undefined, _("Answer 4"), false)); vans[4] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "5", m_undefined, _("Answer 5"), false)); //load global definitions if(!CALCULATOR->loadGlobalDefinitions()) { printf(_("Failed to load global definitions!\n")); } printops.use_unicode_signs = true; generate_functions_tree_struct(); generate_variables_tree_struct(); generate_units_tree_struct(); fputs("\n", ffile); fputs("Function List\n", ffile); tree_struct *item, *item2; function_cats.it = function_cats.items.begin(); if(function_cats.it != function_cats.items.end()) { item = &*function_cats.it; ++function_cats.it; item->it = item->items.begin(); } else { item = NULL; } str = ""; int level = 1; while(item) { fprintf(ffile, "\n", level, level, fixcat(item->item).c_str()); fprintf(ffile, "%s\n", fix(item->item).c_str()); if(item->objects.size() > 0) { fputs("\n", ffile); for(size_t i = 0; i < item->objects.size(); i++) { print_function((MathFunction*) item->objects[i]); } fputs("\n", ffile); } while(item && item->it == item->items.end()) { item = item->parent; if(item) { fprintf(ffile, "\n", level); level--; } } if(item) { item2 = &*item->it; ++item->it; item = item2; item->it = item->items.begin(); level++; } } if(!function_cats.objects.empty()) { fputs("\n", ffile); fprintf(ffile, "%s\n", _("Uncategorized")); fputs("\n", ffile); for(size_t i = 0; i < function_cats.objects.size(); i++) { print_function((MathFunction*) function_cats.objects[i]); } fputs("\n", ffile); fputs("\n", ffile); } fputs("\n", ffile); fclose(ffile); fputs("\n", vfile); fputs("Variable List\n", vfile); variable_cats.it = variable_cats.items.begin(); if(variable_cats.it != variable_cats.items.end()) { item = &*variable_cats.it; ++variable_cats.it; item->it = item->items.begin(); } else { item = NULL; } str = ""; level = 1; while(item) { fprintf(vfile, "\n", level, level, fixcat(item->item).c_str()); fprintf(vfile, "%s\n", fix(item->item).c_str()); if(item->objects.size() > 0) { fprintf(vfile, "\n", fixcat(item->item).c_str()); fprintf(vfile, "Variables: %s\n", fix(item->item).c_str()); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("Title\n", vfile); fputs("Names\n", vfile); fputs("Value\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); for(size_t i = 0; i < item->objects.size(); i++) { print_variable((Variable*) item->objects[i]); } fputs("\n", vfile); fputs("\n", vfile); fputs("
\n", vfile); } while(item && item->it == item->items.end()) { item = item->parent; if(item) { fprintf(vfile, "
\n", level); level--; } } if(item) { item2 = &*item->it; ++item->it; item = item2; item->it = item->items.begin(); level++; } } if(!variable_cats.objects.empty()) { fputs("\n", vfile); fprintf(vfile, "%s\n", _("Uncategorized")); fprintf(vfile, "\n", _("Uncategorized")); fprintf(vfile, "Variables: %s\n", _("Uncategorized")); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("Title\n", vfile); fputs("Names\n", vfile); fputs("Value\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); for(size_t i = 0; i < variable_cats.objects.size(); i++) { print_variable((Variable*) function_cats.objects[i]); } fputs("\n", vfile); fputs("\n", vfile); fputs("
\n", vfile); fputs("
\n", vfile); } fputs("
\n", vfile); fclose(vfile); fputs("\n", ufile); fputs("Unit List\n", ufile); unit_cats.it = unit_cats.items.begin(); if(unit_cats.it != unit_cats.items.end()) { item = &*unit_cats.it; ++unit_cats.it; item->it = item->items.begin(); } else { item = NULL; } str = ""; level = 1; while(item) { fprintf(ufile, "\n", level, level, fixcat(item->item).c_str()); fprintf(ufile, "%s\n", fix(item->item).c_str()); if(item->objects.size() > 0) { fprintf(ufile, "\n", fixcat(item->item).c_str()); fprintf(ufile, "Units: %s\n", fix(item->item).c_str()); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("Title\n", ufile); fputs("Names\n", ufile); fputs("Base Unit(s)\n", ufile); fputs("Relation\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); for(size_t i = 0; i < item->objects.size(); i++) { print_unit((Unit*) item->objects[i]); } fputs("\n", ufile); fputs("\n", ufile); fputs("
\n", ufile); } while(item && item->it == item->items.end()) { item = item->parent; if(item) { fprintf(ufile, "
\n", level); level--; } } if(item) { item2 = &*item->it; ++item->it; item = item2; item->it = item->items.begin(); level++; } } if(!unit_cats.objects.empty()) { fputs("\n", ufile); fprintf(ufile, "%s\n", _("Uncategorized")); fprintf(ufile, "\n", _("Uncategorized")); fprintf(ufile, "Units: %s\n", _("Uncategorized")); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("Title\n", ufile); fputs("Names\n", ufile); fputs("Base Unit(s)\n", ufile); fputs("Relation\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); for(size_t i = 0; i < unit_cats.objects.size(); i++) { print_unit((Unit*) function_cats.objects[i]); } fputs("\n", ufile); fputs("\n", ufile); fputs("
\n", ufile); fputs("
\n", ufile); } fputs("
\n", ufile); fclose(ufile); return 0; } libqalculate-0.9.7/libqalculate.pc.in0000644000175100017510000000041311305546371014512 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libqalculate Description: libqalculate Requires: glib-2.0 libxml-2.0 Version: @VERSION@ Libs: -L${libdir} @CLN_LIBS@ -lpthread -lqalculate Cflags: -I${includedir} @CLN_CPPFLAGS@ libqalculate-0.9.7/docs/0000777000175100017510000000000011320655052012127 500000000000000libqalculate-0.9.7/docs/Makefile.am0000644000175100017510000000007211305546373014106 00000000000000# # docs/Makefile.am for qalculate # SUBDIRS = reference libqalculate-0.9.7/docs/reference/0000777000175100017510000000000011320655052014065 500000000000000libqalculate-0.9.7/docs/reference/Makefile.am0000644000175100017510000000033011305546374016042 00000000000000# # docs/reference/Makefile.am for qalculate # referencedir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/reference/html reference_DATA = html/*.png html/*.html html/*.css EXTRA_DIST = html/*.png html/*.html html/*.css libqalculate-0.9.7/docs/reference/html/0000777000175100017510000000000011320655053015032 500000000000000libqalculate-0.9.7/docs/reference/html/classExpressionItem.html0000644000175100017510000017746211320655045021662 00000000000000 libqalculate-0.9.7: ExpressionItem Class Reference

ExpressionItem Class Reference

Abstract base class for functions, variables and units. More...

#include <ExpressionItem.h>

Inheritance diagram for ExpressionItem:

MathFunction Unit Variable DataSet UserFunction AliasUnit CompositeUnit KnownVariable UnknownVariable AliasUnit_Composite DynamicVariable

List of all members.

Public Member Functions

 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
virtual ExpressionItemcopy () const =0
virtual void set (const ExpressionItem *item)
virtual bool destroy ()
bool isRegistered () const
void setRegistered (bool is_registered)
 For internal use.
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const string & referenceName () const
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const ExpressionNamegetName (size_t index) const
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
virtual void setName (string sname, size_t index, bool force=true)
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
virtual void addName (string sname, size_t index=0, bool force=true)
virtual size_t countNames () const
virtual void clearNames ()
virtual void clearNonReferenceNames ()
virtual void removeName (size_t index)
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
virtual size_t hasNameCaseSensitive (const string &sname) const
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual void setTitle (string title_)
virtual const string & description () const
virtual void setDescription (string descr_)
virtual const string & category () const
virtual void setCategory (string cat_)
virtual bool hasChanged () const
virtual void setChanged (bool has_changed)
virtual bool isLocal () const
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
virtual bool isBuiltin () const
virtual bool isApproximate () const
virtual void setApproximate (bool is_approx=true)
virtual int precision () const
virtual void setPrecision (int prec)
virtual bool isActive () const
virtual void setActive (bool is_active)
virtual bool isHidden () const
virtual void setHidden (bool is_hidden)
virtual int refcount () const
virtual void ref ()
virtual void unref ()
virtual void ref (ExpressionItem *o)
virtual void unref (ExpressionItem *o)
virtual ExpressionItemgetReferencer (size_t index=1) const
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
virtual int type () const =0
virtual int subtype () const =0

Protected Attributes

string scat
string stitle
string sdescr
bool b_local
bool b_changed
bool b_builtin
bool b_approx
bool b_active
bool b_registered
bool b_hidden
bool b_destroyed
int i_ref
int i_precision
vector< ExpressionItem * > v_refs
vector< ExpressionNamenames


Detailed Description

Abstract base class for functions, variables and units.

Expression items have one or more names used to reference it in mathematical expressions and display them in a result. Each name must be fully unique, with the exception that functions can have names used by other types of items (for example "min" is used as a name for the minute unit but also for a function returning smallest value in a vector).

Items have an optional title and description for information to the end user. The categoy property is used to organize items, so that the end user can easily find them. Subcategories are separated by a slash, '/' (ex. "Physical Constants/Electromagnetic Constants").

A local item is created/edited by the end user.

A builtin item has defining properties that can/should not be edited by the user and is usually an item not loaded from the definition files.

An inactive item can not be used in expressions and can share the name of an active item.

The hidden propery defines if the item should be hidden from the end user.

Before an item can be used in expressions, it must be added to the Calculator object using CALCULATOR->addExpressionItem(). It is then said to be registered.

To delete an ExpressionItem object you should use destroy() to make sure that the item is removed from the Calculator and does not have any referrer.


Member Function Documentation

virtual const ExpressionName& ExpressionItem::preferredName ( bool  abbreviation = false,
bool  use_unicode = false,
bool  plural = false,
bool  reference = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const [virtual]

Returns the name that best fulfils provided criterias. If two names are equally preferred, the one with lowest index is returned.

Parameters:
abbreviation If an abbreviated name is preferred.
use_unicode If a name with unicode characters can be displayed/is preferred (prioritized if false).
plural If a name in plural form is preferred.
reference If a reference name is preferred (ignored if false).
can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected.
can_display_unicode_string_arg Argument to pass to the above test function.
Returns:
The preferred name.

virtual const ExpressionName& ExpressionItem::preferredInputName ( bool  abbreviation = false,
bool  use_unicode = false,
bool  plural = false,
bool  reference = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const [virtual]

Returns the name that best fulfils provided criterias and is suitable for user input. If two names are equally preferred, the one with lowest index is returned.

Parameters:
abbreviation If an abbreviated name is preferred.
use_unicode If a name with unicode characters can be displayed/is preferred (prioritized if false).
plural If a name in plural form is preferred.
reference If a reference name is preferred (ignored if false).
can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected.
can_display_unicode_string_arg Argument to pass to the above test function.
Returns:
The preferred name.

virtual const ExpressionName& ExpressionItem::preferredDisplayName ( bool  abbreviation = false,
bool  use_unicode = false,
bool  plural = false,
bool  reference = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const [virtual]

Returns the name that best fulfils provided criterias and is suitable for display. If two names are equally preferred, the one with lowest index is returned.

Parameters:
abbreviation If an abbreviated name is preferred.
use_unicode If a name with unicode characters can be displayed/is preferred (prioritized if false).
plural If a name in plural form is preferred.
reference If a reference name is preferred (ignored if false).
can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected.
can_display_unicode_string_arg Argument to pass to the above test function.
Returns:
The preferred name.

virtual const ExpressionName& ExpressionItem::getName ( size_t  index  )  const [virtual]

Returns name for an index (starting at one). All functions can be traversed by starting at index one and increasing the index until empty_expression_name is returned.

Parameters:
index Index of name.
Returns:
Name for index or empty_expression_name if not found.

virtual void ExpressionItem::setName ( const ExpressionName ename,
size_t  index = 1,
bool  force = true 
) [virtual]

Changes a name. If a name for the provided index is not present, it is added (equivalent to addName(ename, index, force)).

Parameters:
ename The new name.
index Index of name to change.
force If true, expression items with conflicting names are replaced, otherwise . Only applies if the item is registered.

virtual void ExpressionItem::setName ( string  sname,
size_t  index,
bool  force = true 
) [virtual]

Changes the text string of a name. If a name for the provided index is not present, it is added (equivalent to addName(sname, index, force)).

Parameters:
sname The new name text string.
index Index of name to change.
force If true, expression items with conflicting names are replaced, otherwise . Only applies if the item is registered.

virtual void ExpressionItem::clearNames (  )  [virtual]

Removes all names.

virtual void ExpressionItem::clearNonReferenceNames (  )  [virtual]

Removes all names that are not used for reference (ExpressionName.reference = true).

virtual size_t ExpressionItem::hasName ( const string &  sname,
bool  case_sensitive = true 
) const [virtual]

Checks if the expression item has a name with a specific text string.

Parameters:
sname A text string to look for (not case sensitive)
case_sensitive If the name is case sensitive.
Returns:
Index of the name with the given text string or zero if such a name was not found.

virtual size_t ExpressionItem::hasNameCaseSensitive ( const string &  sname  )  const [virtual]

Checks if the expression item has a name with a specific case sensitive text string.

Parameters:
sname A text string to look for (case sensitive)
Returns:
Index of the name with the given text string or zero if such a name was not found.

virtual const ExpressionName& ExpressionItem::findName ( int  abbreviation = -1,
int  use_unicode = -1,
int  plural = -1,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const [virtual]

Searches for a name with specific properties.

Parameters:
abbreviation If the name must be abbreviated. 1=true, 0=false, -1=ignore.
use_unicode If the name must have unicode characters. 1=true, 0=false, -1=ignore.
plural If the name must be in plural form. 1=true, 0=false, -1=ignore.
can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected.
can_display_unicode_string_arg Argument to pass to the above test function.
Returns:
The first found name with the specified properties or empty_expression_name if none found.

virtual const string& ExpressionItem::title ( bool  return_name_if_no_title = true,
bool  use_unicode = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const [virtual]

Returns the title, descriptive name, of the item.

Parameters:
return_name_if_no_title If true, a name is returned if the title string is empty (using preferredName(false, use_unicode, false, false, can_display_unicode_string_function, can_display_unicode_string_arg)).
use_unicode If a name with unicode characters can be displayed/is preferred (passed to preferredName()).
can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected (passed to preferredName()).
can_display_unicode_string_arg Argument to pass to the above test function (passed to preferredName()).
Returns:
Item title.

virtual void ExpressionItem::setTitle ( string  title_  )  [virtual]

Sets the title, descriptive name, of the item. The title can not be used in expressions.

Parameters:
title_ The new title.

virtual const string& ExpressionItem::description (  )  const [virtual]

Returns the expression items description.

Returns:
Description.

virtual void ExpressionItem::setDescription ( string  descr_  )  [virtual]

Sets the expression items description.

Parameters:
descr_ Description.

virtual const string& ExpressionItem::category (  )  const [virtual]

Returns the category that the expression item belongs to. Subcategories are separated by '/'.

Returns:
Category.

virtual void ExpressionItem::setCategory ( string  cat_  )  [virtual]

Sets which category the expression belongs to. Subcategories are separated by '/'.

Parameters:
cat_ Category.

virtual bool ExpressionItem::hasChanged (  )  const [virtual]

If the object has been changed since it was created/loaded.

virtual bool ExpressionItem::isApproximate (  )  const [virtual]

If the item is approximate or exact. Note that an actual value associated with the item might have a have a lower precision. For, for example, a mathematical function this defines the precision of the formula, not the result.

Returns:
true if the item is approximate

virtual int ExpressionItem::precision (  )  const [virtual]

Returns precision of the item, if it is approximate. Note that an actual value associated with the item might have a have a lower precision. For, for example, a mathematical function this defines the precision of the formula, not the result.

virtual bool ExpressionItem::isActive (  )  const [virtual]

Returns if the expression item is active and can be used in expressions.

Returns:
true if active.

virtual int ExpressionItem::refcount (  )  const [virtual]

The reference count is not used to delete the expression item when it becomes zero, but to stop from being deleted while it is in use.

virtual int ExpressionItem::type (  )  const [pure virtual]

Returns the type of the expression item, corresponding to which subclass the object belongs to.

Returns:
ExpressionItemType.

Implemented in MathFunction, Unit, and Variable.

virtual int ExpressionItem::subtype (  )  const [pure virtual]

Returns the subtype of the expression item, corresponding to which subsubclass the object belongs to.

Returns:
Subtype/subsubclass.

Implemented in DataSet, MathFunction, UserFunction, Unit, AliasUnit, CompositeUnit, Variable, UnknownVariable, and KnownVariable.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classMathStructure.html0000644000175100017510000067246311320655045021517 00000000000000 libqalculate-0.9.7: MathStructure Class Reference

MathStructure Class Reference

A structure representing a mathematical value/expression/result. More...

#include <MathStructure.h>

List of all members.

Public Member Functions

Constructors


 MathStructure ()
 MathStructure (const MathStructure &o)
 MathStructure (int num, int den=1, int exp10=0)
 MathStructure (string sym)
 MathStructure (double float_value)
 MathStructure (const MathStructure *o,...)
 MathStructure (MathFunction *o,...)
 MathStructure (Unit *u, Prefix *p=NULL)
 MathStructure (Variable *o)
 MathStructure (const Number &o)
 ~MathStructure ()
Functions/operators for setting type and content


void set (const MathStructure &o, bool merge_precision=false)
void set_nocopy (MathStructure &o, bool merge_precision=false)
void set (int num, int den=1, int exp10=0, bool preserve_precision=false)
void set (string sym, bool preserve_precision=false)
void set (double float_value, bool preserve_precision=false)
void setVector (const MathStructure *o,...)
void set (MathFunction *o,...)
void set (Unit *u, Prefix *p=NULL, bool preserve_precision=false)
void set (Variable *o, bool preserve_precision=false)
void set (const Number &o, bool preserve_precision=false)
void setInfinity (bool preserve_precision=false)
void setUndefined (bool preserve_precision=false)
void clear (bool preserve_precision=false)
void clearVector (bool preserve_precision=false)
void clearMatrix (bool preserve_precision=false)
void setType (StructureType mtype)
void operator= (const MathStructure &o)
void operator= (const Number &o)
void operator= (int i)
void operator= (Unit *u)
void operator= (Variable *v)
void operator= (string sym)
Functions to keep track of referrers


void ref ()
void unref ()
size_t refcount () const
Functions for numbers


const Numbernumber () const
Numbernumber ()
void numberUpdated ()
Functions for symbols


const string & symbol () const
Functions for units


Unitunit () const
Prefixprefix () const
void setPrefix (Prefix *p)
bool isPlural () const
void setPlural (bool is_plural)
void setUnit (Unit *u)
Functions for mathematical functions


void setFunction (MathFunction *f)
MathFunctionfunction () const
const MathStructurefunctionValue () const
Functions for variables


void setVariable (Variable *v)
Variablevariable () const
Functions for statistical uncertainty/error of value


void setUncertainty (const MathStructure &o)
const MathStructureuncertainty () const
Functions for nested structures (power, muliplication, addition, vector, etc)


void childUpdated (size_t index, bool recursive=false)
void childrenUpdated (bool recursive=false)
MathStructureoperator[] (size_t index)
const MathStructureoperator[] (size_t index) const
void setToChild (size_t index, bool merge_precision=false, MathStructure *mparent=NULL, size_t index_this=1)
void swapChildren (size_t index1, size_t index2)
void childToFront (size_t index)
void addChild (const MathStructure &o)
void addChild_nocopy (MathStructure *o)
void delChild (size_t index)
void insertChild (const MathStructure &o, size_t index)
void insertChild_nocopy (MathStructure *o, size_t index)
void setChild (const MathStructure &o, size_t index=1)
void setChild_nocopy (MathStructure *o, size_t index=1)
const MathStructuregetChild (size_t index) const
MathStructuregetChild (size_t index)
size_t countChildren () const
size_t countTotalChildren (bool count_function_as_one=true) const
size_t size () const
Functions for power


const MathStructurebase () const
const MathStructureexponent () const
MathStructurebase ()
MathStructureexponent ()
Functions for comparisons


ComparisonType comparisonType () const
void setComparisonType (ComparisonType comparison_type)
Functions checking type and value


StructureType type () const
bool isAddition () const
bool isMultiplication () const
bool isPower () const
bool isSymbolic () const
bool isEmptySymbol () const
bool isVector () const
bool isMatrix () const
bool isFunction () const
bool isUnit () const
bool isUnit_exp () const
bool isNumber_exp () const
bool isVariable () const
bool isComparison () const
bool isBitwiseAnd () const
bool isBitwiseOr () const
bool isBitwiseXor () const
bool isBitwiseNot () const
bool isLogicalAnd () const
bool isLogicalOr () const
bool isLogicalXor () const
bool isLogicalNot () const
bool isInverse () const
bool isDivision () const
bool isNegate () const
bool isInfinity () const
bool isUndefined () const
bool isInteger () const
bool isNumber () const
bool isZero () const
bool isOne () const
bool isMinusOne () const
bool hasNegativeSign () const
bool representsBoolean () const
bool representsPositive (bool allow_units=false) const
bool representsNegative (bool allow_units=false) const
bool representsNonNegative (bool allow_units=false) const
bool representsNonPositive (bool allow_units=false) const
bool representsInteger (bool allow_units=false) const
bool representsNumber (bool allow_units=false) const
bool representsRational (bool allow_units=false) const
bool representsReal (bool allow_units=false) const
bool representsComplex (bool allow_units=false) const
bool representsNonZero (bool allow_units=false) const
bool representsZero (bool allow_units=false) const
bool representsEven (bool allow_units=false) const
bool representsOdd (bool allow_units=false) const
bool representsUndefined (bool include_childs=false, bool include_infinite=false, bool be_strict=false) const
bool representsNonMatrix () const
Functions for precision


void setApproximate (bool is_approx=true)
bool isApproximate () const
void setPrecision (int prec)
int precision () const
void mergePrecision (const MathStructure &o)
Operators for structural transformations and additions
These operators transforms or adds to the structure without doing any calculations

MathStructure operator- () const
MathStructure operator* (const MathStructure &o) const
MathStructure operator/ (const MathStructure &o) const
MathStructure operator+ (const MathStructure &o) const
MathStructure operator- (const MathStructure &o) const
MathStructure operator^ (const MathStructure &o) const
MathStructure operator && (const MathStructure &o) const
MathStructure operator|| (const MathStructure &o) const
MathStructure operator! () const
void operator*= (const MathStructure &o)
void operator/= (const MathStructure &o)
void operator+= (const MathStructure &o)
void operator-= (const MathStructure &o)
void operator^= (const MathStructure &o)
void operator*= (const Number &o)
void operator/= (const Number &o)
void operator+= (const Number &o)
void operator-= (const Number &o)
void operator^= (const Number &o)
void operator*= (int i)
void operator/= (int i)
void operator+= (int i)
void operator-= (int i)
void operator^= (int i)
void operator*= (Unit *u)
void operator/= (Unit *u)
void operator+= (Unit *u)
void operator-= (Unit *u)
void operator^= (Unit *u)
void operator*= (Variable *v)
void operator/= (Variable *v)
void operator+= (Variable *v)
void operator-= (Variable *v)
void operator^= (Variable *v)
void operator*= (string sym)
void operator/= (string sym)
void operator+= (string sym)
void operator-= (string sym)
void operator^= (string sym)
Functions for structural transformations and additions
These functions transforms or adds to the structure without doing any calculations

void add (const MathStructure &o, MathOperation op, bool append=false)
void add (const MathStructure &o, bool append=false)
void subtract (const MathStructure &o, bool append=false)
void multiply (const MathStructure &o, bool append=false)
void divide (const MathStructure &o, bool append=false)
void raise (const MathStructure &o)
void add (const Number &o, bool append=false)
void subtract (const Number &o, bool append=false)
void multiply (const Number &o, bool append=false)
void divide (const Number &o, bool append=false)
void raise (const Number &o)
void add (int i, bool append=false)
void subtract (int i, bool append=false)
void multiply (int i, bool append=false)
void divide (int i, bool append=false)
void raise (int i)
void add (Variable *v, bool append=false)
void subtract (Variable *v, bool append=false)
void multiply (Variable *v, bool append=false)
void divide (Variable *v, bool append=false)
void raise (Variable *v)
void add (Unit *u, bool append=false)
void subtract (Unit *u, bool append=false)
void multiply (Unit *u, bool append=false)
void divide (Unit *u, bool append=false)
void raise (Unit *u)
void add (string sym, bool append=false)
void subtract (string sym, bool append=false)
void multiply (string sym, bool append=false)
void divide (string sym, bool append=false)
void raise (string sym)
void add_nocopy (MathStructure *o, MathOperation op, bool append=false)
void add_nocopy (MathStructure *o, bool append=false)
void subtract_nocopy (MathStructure *o, bool append=false)
void multiply_nocopy (MathStructure *o, bool append=false)
void divide_nocopy (MathStructure *o, bool append=false)
void raise_nocopy (MathStructure *o)
void inverse ()
void negate ()
void setLogicalNot ()
void setBitwiseNot ()
void transform (StructureType mtype, const MathStructure &o)
void transform (StructureType mtype, const Number &o)
void transform (StructureType mtype, int i)
void transform (StructureType mtype, Unit *u)
void transform (StructureType mtype, Variable *v)
void transform (StructureType mtype, string sym)
void transform_nocopy (StructureType mtype, MathStructure *o)
void transform (StructureType mtype)
Functions/operators for comparisons


bool equals (const MathStructure &o) const
bool equals (const Number &o) const
bool equals (int i) const
bool equals (Unit *u) const
bool equals (Variable *v) const
bool equals (string sym) const
ComparisonResult compare (const MathStructure &o) const
ComparisonResult compareApproximately (const MathStructure &o) const
bool operator== (const MathStructure &o) const
bool operator== (const Number &o) const
bool operator== (int i) const
bool operator== (Unit *u) const
bool operator== (Variable *v) const
bool operator== (string sym) const
bool operator!= (const MathStructure &o) const
Functions for calculation/evaluation


MathStructureeval (const EvaluationOptions &eo=default_evaluation_options)
void calculateUncertaintyPropagation (const EvaluationOptions &eo)
bool calculateMergeIndex (size_t index, const EvaluationOptions &eo, const EvaluationOptions &feo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateLogicalOrLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateLogicalOrIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateLogicalOr (const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateLogicalXorLast (const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateLogicalXor (const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateLogicalAndLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateLogicalAndIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateLogicalAnd (const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateLogicalNot (const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateBitwiseNot (const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateInverse (const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateNegate (const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateRaiseExponent (const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateRaise (const MathStructure &mexp, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateBitwiseOrLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateBitwiseOrIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateBitwiseOr (const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateBitwiseXorLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateBitwiseXorIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateBitwiseXor (const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateBitwiseAndLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateBitwiseAndIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateBitwiseAnd (const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateMultiplyLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateMultiplyIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateMultiply (const MathStructure &mmul, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateDivide (const MathStructure &mdiv, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateAddLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateAddIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateAdd (const MathStructure &madd, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateSubtract (const MathStructure &msub, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
bool calculateFunctions (const EvaluationOptions &eo, bool recursive=true)
int merge_addition (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
int merge_multiplication (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false, bool do_append=true)
int merge_power (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
int merge_logical_and (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
int merge_logical_or (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
int merge_logical_xor (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
int merge_bitwise_and (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
int merge_bitwise_or (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
int merge_bitwise_xor (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
bool calculatesub (const EvaluationOptions &eo, const EvaluationOptions &feo, bool recursive=true, MathStructure *mparent=NULL, size_t index_this=1)
void evalSort (bool recursive=false)
bool integerFactorize ()
Functions for protection from changes when evaluating


void setProtected (bool do_protect=true)
bool isProtected () const
Functions for format and display


void sort (const PrintOptions &po=default_print_options, bool recursive=true)
bool improve_division_multipliers (const PrintOptions &po=default_print_options)
void setPrefixes (const PrintOptions &po=default_print_options, MathStructure *parent=NULL, size_t pindex=0)
void prefixCurrencies ()
void format (const PrintOptions &po=default_print_options)
void formatsub (const PrintOptions &po=default_print_options, MathStructure *parent=NULL, size_t pindex=0, bool recursive=true)
void postFormatUnits (const PrintOptions &po=default_print_options, MathStructure *parent=NULL, size_t pindex=0)
bool factorizeUnits ()
void unformat (const EvaluationOptions &eo=default_evaluation_options)
bool needsParenthesis (const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool flat_division=true, bool flat_power=true) const
int neededMultiplicationSign (const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool par, bool par_prev, bool flat_division=true, bool flat_power=true) const
string print (const PrintOptions &po=default_print_options, const InternalPrintStruct &ips=top_ips) const
Functions for vectors


MathStructureflattenVector (MathStructure &mstruct) const
bool rankVector (bool ascending=true)
bool sortVector (bool ascending=true)
MathStructuregetRange (int start, int end, MathStructure &mstruct) const
void resizeVector (size_t i, const MathStructure &mfill)
Functions for matrices


size_t rows () const
size_t columns () const
const MathStructuregetElement (size_t row, size_t column) const
MathStructuregetElement (size_t row, size_t column)
MathStructuregetArea (size_t r1, size_t c1, size_t r2, size_t c2, MathStructure &mstruct) const
MathStructurerowToVector (size_t r, MathStructure &mstruct) const
MathStructurecolumnToVector (size_t c, MathStructure &mstruct) const
MathStructurematrixToVector (MathStructure &mstruct) const
void setElement (const MathStructure &mstruct, size_t row, size_t column)
void addRows (size_t r, const MathStructure &mfill)
void addColumns (size_t c, const MathStructure &mfill)
void addRow (const MathStructure &mfill)
void addColumn (const MathStructure &mfill)
void resizeMatrix (size_t r, size_t c, const MathStructure &mfill)
bool matrixIsSquare () const
bool isNumericMatrix () const
int pivot (size_t ro, size_t co, bool symbolic=true)
int gaussianElimination (const EvaluationOptions &eo=default_evaluation_options, bool det=false)
MathStructuredeterminant (MathStructure &mstruct, const EvaluationOptions &eo) const
MathStructurepermanent (MathStructure &mstruct, const EvaluationOptions &eo) const
void setToIdentityMatrix (size_t n)
MathStructuregetIdentityMatrix (MathStructure &mstruct) const
bool invertMatrix (const EvaluationOptions &eo)
bool adjointMatrix (const EvaluationOptions &eo)
bool transposeMatrix ()
MathStructurecofactor (size_t r, size_t c, MathStructure &mstruct, const EvaluationOptions &eo) const
Functions for unit conversion


int isUnitCompatible (const MathStructure &mstruct)
bool syncUnits (bool sync_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options)
bool testDissolveCompositeUnit (Unit *u)
bool testCompositeUnit (Unit *u)
bool dissolveAllCompositeUnits ()
bool convert (Unit *u, bool convert_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options)
bool convert (const MathStructure unit_mstruct, bool convert_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options)
Functions for recursive search and replace


int contains (const MathStructure &mstruct, bool structural_only=true, bool check_variables=false, bool check_functions=false) const
int containsRepresentativeOf (const MathStructure &mstruct, bool check_variables=false, bool check_functions=false) const
int containsType (StructureType mtype, bool structural_only=true, bool check_variables=false, bool check_functions=false) const
int containsRepresentativeOfType (StructureType mtype, bool check_variables=false, bool check_functions=false) const
bool containsOpaqueContents () const
bool containsAdditionPower () const
bool containsUnknowns () const
bool containsDivision () const
size_t countFunctions (bool count_subfunctions=true) const
void findAllUnknowns (MathStructure &unknowns_vector)
bool replace (const MathStructure &mfrom, const MathStructure &mto)
bool calculateReplace (const MathStructure &mfrom, const MathStructure &mto, const EvaluationOptions &eo)
bool replace (const MathStructure &mfrom1, const MathStructure &mto1, const MathStructure &mfrom2, const MathStructure &mto2)
bool removeType (StructureType mtype)
Functions to generate vectors for plotting


MathStructure generateVector (MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector=NULL, const EvaluationOptions &eo=default_evaluation_options) const
MathStructure generateVector (MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector=NULL, const EvaluationOptions &eo=default_evaluation_options) const
MathStructure generateVector (MathStructure x_mstruct, const MathStructure &x_vector, const EvaluationOptions &eo=default_evaluation_options) const
Differentiation and integration


bool differentiate (const MathStructure &x_var, const EvaluationOptions &eo)
bool integrate (const MathStructure &x_var, const EvaluationOptions &eo)
Functions for polynomials


bool simplify (const EvaluationOptions &eo=default_evaluation_options, bool unfactorize=true)
bool factorize (const EvaluationOptions &eo=default_evaluation_options)
bool isRationalPolynomial () const
const NumberoverallCoefficient () const
const Numberdegree (const MathStructure &xvar) const
const Numberldegree (const MathStructure &xvar) const
void lcoefficient (const MathStructure &xvar, MathStructure &mcoeff) const
void tcoefficient (const MathStructure &xvar, MathStructure &mcoeff) const
void coefficient (const MathStructure &xvar, const Number &pownr, MathStructure &mcoeff) const
Number maxCoefficient ()
int polynomialUnit (const MathStructure &xvar) const
void polynomialContent (const MathStructure &xvar, MathStructure &mcontent, const EvaluationOptions &eo) const
void polynomialPrimpart (const MathStructure &xvar, MathStructure &mprim, const EvaluationOptions &eo) const
void polynomialPrimpart (const MathStructure &xvar, const MathStructure &c, MathStructure &mprim, const EvaluationOptions &eo) const
void polynomialUnitContentPrimpart (const MathStructure &xvar, int &munit, MathStructure &mcontent, MathStructure &mprim, const EvaluationOptions &eo) const
Functions for equations


const MathStructurefind_x_var () const
bool isolate_x (const EvaluationOptions &eo, const MathStructure &x_var=m_undefined, bool check_result=false)
bool isolate_x (const EvaluationOptions &eo, const EvaluationOptions &feo, const MathStructure &x_var=m_undefined, bool check_result=false)

Static Public Member Functions

static bool polynomialDivide (const MathStructure &mnum, const MathStructure &mden, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args=true)
static bool polynomialQuotient (const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args=true)
static bool lcm (const MathStructure &m1, const MathStructure &m2, MathStructure &mlcm, const EvaluationOptions &eo, bool check_args=true)
static bool gcd (const MathStructure &m1, const MathStructure &m2, MathStructure &mresult, const EvaluationOptions &eo, MathStructure *ca=NULL, MathStructure *cb=NULL, bool check_args=true)

Protected Member Functions

bool isolate_x_sub (const EvaluationOptions &eo, EvaluationOptions &eo2, const MathStructure &x_var, MathStructure *morig=NULL)
void init ()
MathStructureCHILD (size_t v_index) const

Protected Attributes

size_t i_ref
StructureType m_type
bool b_approx
int i_precision
vector< MathStructure * > v_subs
vector< size_t > v_order
string s_sym
Number o_number
Variableo_variable
Unito_unit
Prefixo_prefix
bool b_plural
MathFunctiono_function
MathStructurefunction_value
MathStructureo_uncertainty
ComparisonType ct_comp
bool b_protected


Detailed Description

A structure representing a mathematical value/expression/result.

A MathStructure can both be container representing an operation with an ordered list of children or simple value representing a number, , variable etc. The children of a container might be of any type, allowing a tree-like nested structure.

These are the most common conatiner/operation types:

  • Addition: contains two or more children, representing terms (x+y+...)
  • Multiplication: contains two or more children, representing factors (x*y*...)
  • Power: contains exactly two children, representing base and exponent (x^y)
  • Function: contains a two or more children, representing arguments, and a reference to a MathFunction object ( f(x,y,...) )
  • Comparison: an equality or inequality containing exactly two children, represening the expressions right and left of the sign, specified with a ComparisonType (x=y, x!=y, x>y, ...)
  • Vector: contains zero or more children, representing elements in a vector ( [x, y, z, ...] )

Also available are containers representing logical and bitwise operations. Subtraction is represented by an addition structure with negated children and division by a multiplication structure with inverted children. Matrices is represented by a vector with vectors as children.

For formatted structures, the following types is also available:

  • Negation: contains exactly one child (-x)
  • Invertion: contains exactly one child (1/x)
  • Division: contains exactly two children representing numerator and denominator (x/y)

The following value types are available:

  • Number: has a Number object, representing a rational, floating point, complex or infinite numeric value
  • Variable: has a reference to a Variable object, with a known or unknown value
  • Symbolic: has an associated text string, with assumptions about the represented value controlled by the default assumptions
  • Unit: has a reference to a Unit object, and might in a formatted structure also have a reference to a Prefix object
  • Undefined: represents an undefined value

To create a MathStructure, you can either create a simple structure using the constructors and then expanding it with structural operations, or use the parse or calculation functions of the global Calculator object to convert an expression string.

The expression "(5x + 2) * 3" can be turned into a MathStructure either using

 MathStructure mstruct = CALCULATOR->parse("(5x + 2) * 3");
or
 MathStructure mstruct(5);
 mstruct *= CALCULATOR->v_x;
 mstruct += 2;
 mstruct *= 3:
The first variant is obviously simpler, but slower and allows less control.

Then, to evaluate/calculate/simplify (whatever) a structure, eval() should normally be used. The EvaluationOptions passed to eval() allows much control over the process and the outcome.

 EvaluationOptions eo;
 mstruct.eval(eo);

After that, to display the result, you should first format the structure using format() and then display it using print(), passing the PrintOptions to both.

 PrintOptions po;
 mstruct.format(po);
 std::cout << mstruct.print(po) << std::endl;

Most low-level functions expect the structure to be unformatted och require that unformat() is called after an expression string has been parsed or format() has been called.

To access a child structure either the [] operator or the safer getChild() can be used. Note however that the index passed to the operator start at zero and the index argument for getChild() starts at one.

 MathStructure mstruct(5);
 mstruct += 2;
 std::cout << mstruct.print() << std::endl; // output: "5 + 2"
 std::cout << mstruct.getChild(1)->print() << std::endl; // output: "5"
 std::cout << mstruct[1].print() << std::endl; // output: "2"

MathStructure uses reference count for management of objects allocated with new. Call ref() when starting to use the object and unref() when done. Note that the reference count is initialized to 1 in the constructors, so ref() should not be called after the object creation. This system is used for all child objects, so the following is perfectly legal:

 MathStructure *mchild_p = mstruct->getChild(1);
 mchild_p->ref(); // mchild_p reference count = 2
 mstruct->unref(); //mstruct reference count = 0, mstruct deleted, mchild_p reference count = 1
 (...)
 mchild_p->unref(); // mchild_p reference count = 0, mchild_p deleted

Constructor & Destructor Documentation

MathStructure::MathStructure (  ) 

Create a new structure, initialized to zero.

MathStructure::MathStructure ( const MathStructure o  ) 

Create a copy of a structure. Child structures are copied.

Parameters:
o The structure to copy.

MathStructure::MathStructure ( int  num,
int  den = 1,
int  exp10 = 0 
)

Create a new numeric structure (value=num/den*10^exp10). Equivalent to MathStructure(Number(num, den, exp10)).

Parameters:
num The numerator of the numeric value.
den The denominator of the numeric value.
exp10 The base 10 exponent of the numeric value.

MathStructure::MathStructure ( string  sym  ) 

Create a new symbolic/text structure.

Parameters:
sym Symbolic/text value.

MathStructure::MathStructure ( double  float_value  ) 

Create a new numeric structure with floating point value. Uses Number::setFloat().

Parameters:
o Numeric value.

MathStructure::MathStructure ( const MathStructure o,
  ... 
)

Create a new vector.

Parameters:
o The first element (copied) in the vector.
... Elements (copied) in the vector. End with NULL.

MathStructure::MathStructure ( MathFunction o,
  ... 
)

Create a new function structure.

Parameters:
o Function value.
... Arguments (copied) to the function. End with NULL.

MathStructure::MathStructure ( Unit u,
Prefix p = NULL 
)

Create a new unit structure.

Parameters:
u The unit value.
p Prefix of the unit.

MathStructure::MathStructure ( Variable o  ) 

Create a new variable structure.

Parameters:
o Variable value.

MathStructure::MathStructure ( const Number o  ) 

Create a new numeric structure.

Parameters:
o Numeric value.


Member Function Documentation

void MathStructure::set ( const MathStructure o,
bool  merge_precision = false 
)

Set the structure to a copy of another structure. Child structures are copied.

Parameters:
o The structure to copy.
merge_precision Preserve the current precision (unless the new value has a lower precision).

void MathStructure::set_nocopy ( MathStructure o,
bool  merge_precision = false 
)

Set the structure to a copy of another structure. Pointers to child structures are copied.

Parameters:
o The structure to copy.
merge_precision Preserve the current precision (unless the new value has a lower precision).

void MathStructure::set ( int  num,
int  den = 1,
int  exp10 = 0,
bool  preserve_precision = false 
)

Set the structure to a number (num/den*10^exp10). Equivalent to set(Number(num, den, exp10), precerve_precision).

Parameters:
num The numerator of the new numeric value.
den The denominator of the new numeric value.
exp10 The base 10 exponent of the new numeric value.
preserve_precision Preserve the current precision (unless the new value has a lower precision).

void MathStructure::set ( string  sym,
bool  preserve_precision = false 
)

Set the structure to a symbolic/text value.

Parameters:
o The new symolic/text value.
preserve_precision Preserve the current precision.

void MathStructure::set ( double  float_value,
bool  preserve_precision = false 
)

Set the structure to a number with a floating point value. Uses Number::setFloat().

Parameters:
o The new numeric value.
preserve_precision Preserve the current precision (unless the new value has a lower precision).

void MathStructure::setVector ( const MathStructure o,
  ... 
)

Set the structure to a vector.

Parameters:
o The first element (copied) in the new vector.
... Elements (copied) in the new vector. End with NULL.

void MathStructure::set ( MathFunction o,
  ... 
)

Set the structure to a mathematical function.

Parameters:
o The new function value.
... Arguments (copied) to the function. End with NULL.

void MathStructure::set ( Unit u,
Prefix p = NULL,
bool  preserve_precision = false 
)

Set the structure to a unit.

Parameters:
u The new unit value.
p Prefix of the unit.
preserve_precision Preserve the current precision (unless the new value has a lower precision).

void MathStructure::set ( Variable o,
bool  preserve_precision = false 
)

Set the structure to a variable.

Parameters:
o The new variable value.
preserve_precision Preserve the current precision.

void MathStructure::set ( const Number o,
bool  preserve_precision = false 
)

Set the structure to a number.

Parameters:
o The new numeric value.
preserve_precision Preserve the current precision (unless the new value has a lower precision).

void MathStructure::setUndefined ( bool  preserve_precision = false  ) 

Set the value of the structure to undefined.

Parameters:
preserve_precision Preserve the current precision.

void MathStructure::clear ( bool  preserve_precision = false  ) 

Reset the value (to zero) and parameters of the structure.

Parameters:
preserve_precision Preserve the current precision.

void MathStructure::clearVector ( bool  preserve_precision = false  ) 

Set the structure to an empty vector.

Parameters:
preserve_precision Preserve the current precision.

void MathStructure::clearMatrix ( bool  preserve_precision = false  ) 

Set the structure to an empty matrix.

Parameters:
preserve_precision Preserve the current precision.

void MathStructure::setType ( StructureType  mtype  ) 

Explicitely sets the type of the structure. setType() is dangerous and might crash the program if used unwisely.

Parameters:
mtype The new structure type

void MathStructure::childUpdated ( size_t  index,
bool  recursive = false 
)

Call this function when you have updated a child. Updates the precision.

Parameters:
index Index (starting at 1) of the updated child. If true, do the same for each child of the child.

void MathStructure::childrenUpdated ( bool  recursive = false  ) 

Call this function when you have updated children. Updates the precision.

If true, do the same for each child of the children.

MathStructure& MathStructure::operator[] ( size_t  index  ) 

Returns a child. Does not check if a child exists at the index.

Parameters:
index Index (starting at zero).

const MathStructure& MathStructure::operator[] ( size_t  index  )  const

Returns a child. Does not check if a child exists at the index.

Parameters:
index Index (starting at zero).

bool MathStructure::isRationalPolynomial (  )  const

If the structure represents a rational polynomial. This is true for

  • rational numbers;
  • functions, units, variables and symbols that do not represent a matrix or undefined;
  • a power with a positive integer exponent and any of the previous as base;
  • a multiplication with the previous as factors; or
  • an addition with the previous as terms.

Returns:
true if structure represents a rational polynomial.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/index.html0000644000175100017510000001016011320655044016741 00000000000000 libqalculate-0.9.7: Index

Index

Introduction

libqalculate is math libary for expression evaluation with units, variables and functions support and CAS functionality.

The main parts of the library is the almighty Calculator class, the MathStructure class for mathematical expressions and classes for objects in an epxression, mostly of the class Numbers and sub classes of ExpressionItem.

A simple application using libqalculate need only create a calculator object, perhaps load definitions (functions, variables, units, etc.) and use the calculate function as follows:

 new Calculator();
 CALCULATOR->loadGlobalDefinitions();
 CALCULATOR->loadLocalDefinitions();
 EvaluationOptions eo;
 MathStructure result = CALCULATOR->calculate("1 + 1", eo);

More complex usage mainly involves manipulating objects of the MathStructure class directly.

To display the resulting expression you will normally use MathStructure::format() followed by MathStructure::print() as follows:

 PrintOptions po;
 result.format(po);
 string result_str = result.print(po); 

Central to the flexiblity of libqalculate is the many options passed to evaluating and display functions with EvaluationOptions and PrintOptions.

Using the library

libqalculate uses pkg-config.

For a simple program use pkg-config on the command line:

 c++ `pkg-config --cflags --libs libqalculate` hello.c -o hello 

If the program uses autoconf, put the following in configure.in:

 PKG_CHECK_MODULES(QALCULATE, [
        libqalculate >= 0.9.7
        ])
 AC_SUBST(QALCULATE_CFLAGS)
 AC_SUBST(QALCULATE_LIBS) 

Generated on Tue Jan 5 08:26:28 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/structEvaluationOptions-members.html0000644000175100017510000001433211320655045024220 00000000000000 libqalculate-0.9.7: Member List
Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDataObjectArgument.html0000644000175100017510000002760411320655045022377 00000000000000 libqalculate-0.9.7: DataObjectArgument Class Reference

DataObjectArgument Class Reference

Data object function argument. More...

#include <DataSet.h>

Inheritance diagram for DataObjectArgument:

Argument

List of all members.

Public Member Functions

 DataObjectArgument (DataSet *data_set, string name_="", bool does_test=true, bool does_error=true)
 DataObjectArgument (const DataObjectArgument *arg)
int type () const
Argumentcopy () const
string print () const
DataSetdataSet () const
void setDataSet (DataSet *data_set)

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const

Protected Attributes

DataSeto_data


Detailed Description

Data object function argument.

Member Function Documentation

virtual bool DataObjectArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented from Argument.

virtual string DataObjectArgument::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented from Argument.

int DataObjectArgument::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented from Argument.

Argument* DataObjectArgument::copy (  )  const [virtual]

Returns a copy of the argument definition.

Returns:
A copy.

Reimplemented from Argument.

string DataObjectArgument::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented from Argument.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/structPlotParameters.html0000644000175100017510000003316411320655045022053 00000000000000 libqalculate-0.9.7: PlotParameters Struct Reference

PlotParameters Struct Reference

Parameters passed to plotting functions. More...

#include <Calculator.h>

List of all members.

Public Attributes

string title
 Title label.
string y_label
 Y-axis label.
string x_label
 X-axis label.
string filename
 Image to save plot to. If empty shows plot in a window on the screen.
PlotFileType filetype
 The image type to save as. Set to PLOT_FILETYPE_AUTO to guess from file extension.
string font
 Font used for text.
bool color
 Set to true for colored plot, false for monochrome. Default: true.
bool auto_y_min
 If the minimum y-axis value shall be set automatically (otherwise uses y_min). Default: true.
bool auto_x_min
 If the minimum x-axis value shall be set automatically (otherwise uses x_min). Default: true.
bool auto_y_max
 If the maximum y-axis value shall be set automatically (otherwise uses y_max). Default: true.
bool auto_x_max
 If the maximum x-axis value shall be set automatically (otherwise uses x_max). Default: true.
float y_min
 Minimum y-axis value.
float x_min
 Minimum x-axis value.
float y_max
 Maximum y-axis value.
float x_max
 Maximum x-axis value.
bool y_log
 If a logarithimic scale shall be used for the y-axis. Default: false.
bool x_log
 If a logarithimic scale shall be used for the x-axis. Default: false.
int y_log_base
 Logarithimic base for the y-axis. Default: 10.
int x_log_base
 Logarithimic base for the x-axis. Default: 10.
bool grid
 If a grid shall be shown in the plot. Default: false.
int linewidth
 Width of lines. Default: 2.
bool show_all_borders
 If the plot shall be surrounded by borders on all sides (not just axis). Default: false.
PlotLegendPlacement legend_placement
 Where the plot legend shall be placed. Default: PLOT_LEGEND_TOP_RIGHT.


Detailed Description

Parameters passed to plotting functions.
The documentation for this struct was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classSymbolicArgument.html0000644000175100017510000002523511320655045022156 00000000000000 libqalculate-0.9.7: SymbolicArgument Class Reference

SymbolicArgument Class Reference

A symbolic argument. More...

#include <Function.h>

Inheritance diagram for SymbolicArgument:

Argument

List of all members.

Public Member Functions

 SymbolicArgument (string name_="", bool does_test=true, bool does_error=true)
 SymbolicArgument (const SymbolicArgument *arg)
virtual int type () const
virtual Argumentcopy () const
virtual string print () const

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const


Detailed Description

A symbolic argument.

Accepts variables and symbolic structures.


Member Function Documentation

virtual bool SymbolicArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented from Argument.

virtual string SymbolicArgument::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented from Argument.

virtual int SymbolicArgument::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented from Argument.

virtual Argument* SymbolicArgument::copy (  )  const [virtual]

Returns a copy of the argument definition.

Returns:
A copy.

Reimplemented from Argument.

virtual string SymbolicArgument::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented from Argument.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classExpressionItem.png0000644000175100017510000000416411320655045021466 00000000000000PNG  IHDR&jPLTE`{tRNS@f IDATx]6?[wRvp0\q]siK֧;QPc<<<<M@iEP㉞=~J6s|AE"9T(B`PAE"9T(B`PAE"9T(B`PAE"Wq׿ q 9ȁ@<r1cƿà hbWfNH?dɄQ%_݋) 9sR<Ϛଝ3ӈ9 C =פ9_ SVtK=]6)=-9oL8OB73O{)0'yD2'^z8B}wl8bD=z/I5{bF_u'^O9,,'x ]duYC]~}w\wm׵Q8ȁ@<r1x c GY. ؤYB@`P%CE *rd= FȁƠ"Q(B`PAE"9T(B`PAE"9T(B`P}$q#=5vx x x x x x x _Wc7XVƾ5M0طk5Xu ֨k4?r 4 2~l3൳2 7j4"Bgki-mu^RȣL)zefMRC5Ok7`Z ho%г(~R?Iڳ'Y#]'9ՊK+zHbK`GP#*ɓ n{R +"w='=Hi3[jHFn+;O\?5<It8=)6"YČRac$e?Kr[eƒF5< izgR:Oܴ1x JOe]O5o+7=IǵD=IsZOJ6ߥie:Oz=2>Nٓדܼ7R5szR2O7hffvoqY\z5rSܟؒr~eer6Wʹ9QY<ʶ2q߉>cm zR@`'u ֨k 0F]5 Q@``ϵ,35~'(HB@J/P8@Hp (Bp (B Pz ^p (B Pz ^p (B Pz ^p (B Pz ^p (B Pz ^p (B Pz ^p (hdV^A{ڕ8 A(@@J/P8{!y¶ۚ޽'O, 1< K;]0OfGI;O8 | izC$F8J6DU=8^16=<:ΐ\zΞdl B=y^.o'<'I<%MNq~C,'<'݇]OF':]ʞLa\OMn tSʱoNYw٣]~:}&&E&˯jzp}|Ě libqalculate-0.9.7: Member List

UnknownVariable Member List

This is the complete list of members for UnknownVariable, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
assumptions()UnknownVariable
b_active (defined in ExpressionItem)ExpressionItem [protected]
b_approx (defined in ExpressionItem)ExpressionItem [protected]
b_builtin (defined in ExpressionItem)ExpressionItem [protected]
b_changed (defined in ExpressionItem)ExpressionItem [protected]
b_destroyed (defined in ExpressionItem)ExpressionItem [protected]
b_hidden (defined in ExpressionItem)ExpressionItem [protected]
b_local (defined in ExpressionItem)ExpressionItem [protected]
b_registered (defined in ExpressionItem)ExpressionItem [protected]
category() const ExpressionItem [virtual]
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItem [virtual]
clearNames()ExpressionItem [virtual]
clearNonReferenceNames()ExpressionItem [virtual]
copy() const (defined in UnknownVariable)UnknownVariable [virtual]
countNames() const (defined in ExpressionItem)ExpressionItem [virtual]
description() const ExpressionItem [virtual]
destroy() (defined in ExpressionItem)ExpressionItem [virtual]
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
getName(size_t index) const ExpressionItem [virtual]
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItem [virtual]
hasChanged() const ExpressionItem [virtual]
hasName(const string &sname, bool case_sensitive=true) const ExpressionItem [virtual]
hasNameCaseSensitive(const string &sname) const ExpressionItem [virtual]
i_precision (defined in ExpressionItem)ExpressionItem [protected]
i_ref (defined in ExpressionItem)ExpressionItem [protected]
isActive() const ExpressionItem [virtual]
isApproximate() const ExpressionItem [virtual]
isBuiltin() const (defined in ExpressionItem)ExpressionItem [virtual]
isHidden() const (defined in ExpressionItem)ExpressionItem [virtual]
isKnown() const UnknownVariable [inline, virtual]
isLocal() const (defined in ExpressionItem)ExpressionItem [virtual]
isRegistered() const (defined in ExpressionItem)ExpressionItem
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItem [virtual]
names (defined in ExpressionItem)ExpressionItem [protected]
o_assumption (defined in UnknownVariable)UnknownVariable [protected]
precision() const ExpressionItem [virtual]
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
ref() (defined in ExpressionItem)ExpressionItem [virtual]
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
refcount() const ExpressionItem [virtual]
referenceName() const (defined in ExpressionItem)ExpressionItem [virtual]
removeName(size_t index) (defined in ExpressionItem)ExpressionItem [virtual]
representsBoolean() (defined in Variable)Variable [inline, virtual]
representsComplex(bool=false) (defined in UnknownVariable)UnknownVariable [virtual]
representsEven(bool=false) (defined in Variable)Variable [inline, virtual]
representsInteger(bool=false) (defined in UnknownVariable)UnknownVariable [virtual]
representsNegative(bool=false) (defined in UnknownVariable)UnknownVariable [virtual]
representsNonMatrix() (defined in UnknownVariable)UnknownVariable [virtual]
representsNonNegative(bool=false) (defined in UnknownVariable)UnknownVariable [virtual]
representsNonPositive(bool=false) (defined in UnknownVariable)UnknownVariable [virtual]
representsNonZero(bool=false) (defined in UnknownVariable)UnknownVariable [virtual]
representsNumber(bool=false) (defined in UnknownVariable)UnknownVariable [virtual]
representsOdd(bool=false) (defined in Variable)Variable [inline, virtual]
representsPositive(bool=false)UnknownVariable [virtual]
representsRational(bool=false) (defined in UnknownVariable)UnknownVariable [virtual]
representsReal(bool=false) (defined in UnknownVariable)UnknownVariable [virtual]
representsUndefined(bool=false, bool=false, bool=false) (defined in Variable)Variable [inline, virtual]
scat (defined in ExpressionItem)ExpressionItem [protected]
sdescr (defined in ExpressionItem)ExpressionItem [protected]
set(const ExpressionItem *item) (defined in UnknownVariable)UnknownVariable [virtual]
setActive(bool is_active) (defined in ExpressionItem)ExpressionItem [virtual]
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItem [virtual]
setAssumptions(Assumptions *ass)UnknownVariable
setCategory(string cat_)ExpressionItem [virtual]
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItem [virtual]
setDescription(string descr_)ExpressionItem [virtual]
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItem [virtual]
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItem [virtual]
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItem [virtual]
setName(string sname, size_t index, bool force=true)ExpressionItem [virtual]
setPrecision(int prec) (defined in ExpressionItem)ExpressionItem [virtual]
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItem [virtual]
stitle (defined in ExpressionItem)ExpressionItem [protected]
subtype() const UnknownVariable [inline, virtual]
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
type() const Variable [inline, virtual]
UnknownVariable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)UnknownVariable
UnknownVariable()UnknownVariable
UnknownVariable(const UnknownVariable *variable)UnknownVariable
unref() (defined in ExpressionItem)ExpressionItem [virtual]
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
v_refs (defined in ExpressionItem)ExpressionItem [protected]
Variable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Variable)Variable
Variable() (defined in Variable)Variable
Variable(const Variable *variable) (defined in Variable)Variable
~ExpressionItem() (defined in ExpressionItem)ExpressionItem [virtual]
~UnknownVariable() (defined in UnknownVariable)UnknownVariable [virtual]
~Variable() (defined in Variable)Variable [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classFunctionArgument.png0000644000175100017510000000063711320655045022001 00000000000000PNG  IHDRsPUWMPLTE`{tRNS@f5IDATX]0˞7'X a@_,&X+R> hꞵrwR.>GC8M}}9<[gϬBPz ChJgvP 6T:|DkAuɡ(?nr-a&_''u mhC{j֦t9]|T{Dj& |!gF `D,K:9I1J.AuqN:Y%Zf3PLo)1'([Ph[@i2FV&Mur{t*e"ӯEhaվIENDB`libqalculate-0.9.7/docs/reference/html/classFunctionArgument.html0000644000175100017510000002515511320655045022163 00000000000000 libqalculate-0.9.7: FunctionArgument Class Reference

FunctionArgument Class Reference

A function argument. More...

#include <Function.h>

Inheritance diagram for FunctionArgument:

Argument

List of all members.

Public Member Functions

 FunctionArgument (string name_="", bool does_test=true, bool does_error=true)
 FunctionArgument (const FunctionArgument *arg)
virtual int type () const
virtual Argumentcopy () const
virtual string print () const

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const


Detailed Description

A function argument.

Member Function Documentation

virtual bool FunctionArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented from Argument.

virtual string FunctionArgument::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented from Argument.

virtual int FunctionArgument::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented from Argument.

virtual Argument* FunctionArgument::copy (  )  const [virtual]

Returns a copy of the argument definition.

Returns:
A copy.

Reimplemented from Argument.

virtual string FunctionArgument::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented from Argument.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x7e.html0000644000175100017510000000723311320655045020515 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- ~ -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classArgument.png0000644000175100017510000000531511320655045020271 00000000000000PNG  IHDR6DPLTE`{tRNS@f cIDATx]6Ջ ! J$1j Z+oE_T"ۘ/|;no?І6,綳9_v;{Ilrv:h}E=[_/S،y-a ϶5gD4qz'[8N#vT&}.Іgf (ʯ1+̶gbۯ߿GN3mc6,a mXhBڰІ6,a mX>v]6>Nyg(٬=l-ge5]1Dnl wxPM?#6cm=l@Gw(6wpPlfԮ;wm9!L.7 ;Nk<6;mw^ m}o̟CڰІ6,a mXhBڰІ6,a mX>6ϩF0 K}=mg;•x9_aӾmkr/g3lgy_dv3&4/ _oE>*A_D?N]e;Zd 5"Cm~ζ?6,a mXhBڰІ6,a mXhBڰ|ms3SxۗZEg~( IeS4;"]m. J! [ζdC 8jt~(uDSXuDCuD:ŖӇCZίo쫴 R}:h/0.:"ʶ|6 ̟CڰІ6,a mXhBڰІ6,a mX>6ϩFmW)Ա_uwxi2~!  %1W+"=mUzSͺTyEmFE>!a]Ķ*"!Ozol"8=m"C>N}>z/+" 8nMfoTD~{=m)f ڰІ6,a mXhBڰІ6,a mXh! |N6ʐI'DVH:!xA9"-j[琍n;[s>5eŒdK6p>] 2-F˨뛱XQr|P[cP[cP$m3TmXhBڰІ6,a mXhBڰІ6,ag>Jm6gK -c<>Q1aU67A\/-L, 5n6+ Ue`kݐ|}ܕE1|3ޭlUvՔ/2=V[(}Z=h3UKOK'R|=m7{ő->{JPRا~)ǩJmlf7Y^\Bl{A=:h͔e-Df_BlW RBۓ [?vY nҨ(j98[Cdk 1v\ v\ vh޶?6,a mXhBڰІ6,a mXhBڰ|ms3Sq6~y  Gqao3T 1^:bFa"1de=_fnkc1OKI:bFǶ;N9bF}%1ETiQne戙^Om}m3TmXhBڰІ6,a mXhBڰІ6,ag>JmmWE u۬O{da=DWqΥ`sޕF4/h:5E^8v1MX6[uzv[XڻVZѲ9&Tf=dB1֬ 5!?6ںf ڰІ6,a mXhBڰІ6,a mXh! |N6چܮ{nDe&Hn>4˨/ UcoֲlL?1U#/ӻdyaxאmLym2*oeL9N1^fxzO~ζ?6,a mXhBڰІ6,a mXhBڰ|ms3SQ6]u[6W>%kFsV!!y&[\#*c|,uek>Nw[I)6ϩFX1d26g"!2".kepE[8M:\<_fn/ݧ6s".hKǩѲ5e=\f=\fMh޶?6,a mXhBڰІ6,a mXhBڰ|ms3S6]yMQ7B$\⎈m[gbmbH:"̓e$5O&4nI;"B 9Xc|l-iΓpE=fGdOimo ?{hI WIENDB`libqalculate-0.9.7/docs/reference/html/doxygen.css0000644000175100017510000001775711320655044017156 00000000000000BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { font-family: Geneva, Arial, Helvetica, sans-serif; } BODY,TD { font-size: 90%; } H1 { text-align: center; font-size: 160%; } H2 { font-size: 120%; } H3 { font-size: 100%; } CAPTION { font-weight: bold } DIV.qindex { width: 100%; background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } DIV.navpath { width: 100%; background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } DIV.navtab { background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } TD.navtab { font-size: 70%; } A.qindex { text-decoration: none; font-weight: bold; color: #1A419D; } A.qindex:visited { text-decoration: none; font-weight: bold; color: #1A419D } A.qindex:hover { text-decoration: none; background-color: #ddddff; } A.qindexHL { text-decoration: none; font-weight: bold; background-color: #6666cc; color: #ffffff; border: 1px double #9295C2; } A.qindexHL:hover { text-decoration: none; background-color: #6666cc; color: #ffffff; } A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } A.el { text-decoration: none; font-weight: bold } A.elRef { font-weight: bold } A.code:link { text-decoration: none; font-weight: normal; color: #0000FF } A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF } A.codeRef:link { font-weight: normal; color: #0000FF } A.codeRef:visited { font-weight: normal; color: #0000FF } A:hover { text-decoration: none; background-color: #f2f2ff } DL.el { margin-left: -1cm } .fragment { font-family: monospace, fixed; font-size: 95%; } PRE.fragment { border: 1px solid #CCCCCC; background-color: #f5f5f5; margin-top: 4px; margin-bottom: 4px; margin-left: 2px; margin-right: 8px; padding-left: 6px; padding-right: 6px; padding-top: 4px; padding-bottom: 4px; } DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold; } DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } BODY { background: white; color: black; margin-right: 20px; margin-left: 20px; } TD.indexkey { background-color: #e8eef2; font-weight: bold; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } TD.indexvalue { background-color: #e8eef2; font-style: italic; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } TR.memlist { background-color: #f0f0f0; } P.formulaDsp { text-align: center; } IMG.formulaDsp { } IMG.formulaInl { vertical-align: middle; } SPAN.keyword { color: #008000 } SPAN.keywordtype { color: #604020 } SPAN.keywordflow { color: #e08000 } SPAN.comment { color: #800000 } SPAN.preprocessor { color: #806020 } SPAN.stringliteral { color: #002080 } SPAN.charliteral { color: #008080 } SPAN.vhdldigit { color: #ff00ff } SPAN.vhdlchar { color: #000000 } SPAN.vhdlkeyword { color: #700070 } SPAN.vhdllogic { color: #ff0000 } .mdescLeft { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .mdescRight { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .memItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplParams { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; color: #606060; background-color: #FAFAFA; font-size: 80%; } .search { color: #003399; font-weight: bold; } FORM.search { margin-bottom: 0px; margin-top: 0px; } INPUT.search { font-size: 75%; color: #000080; font-weight: normal; background-color: #e8eef2; } TD.tiny { font-size: 75%; } a { color: #1A41A8; } a:visited { color: #2A3798; } .dirtab { padding: 4px; border-collapse: collapse; border: 1px solid #84b0c7; } TH.dirtab { background: #e8eef2; font-weight: bold; } HR { height: 1px; border: none; border-top: 1px solid black; } /* Style for detailed member documentation */ .memtemplate { font-size: 80%; color: #606060; font-weight: normal; margin-left: 3px; } .memnav { background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } .memitem { padding: 4px; background-color: #eef3f5; border-width: 1px; border-style: solid; border-color: #dedeee; -moz-border-radius: 8px 8px 8px 8px; } .memname { white-space: nowrap; font-weight: bold; } .memdoc{ padding-left: 10px; } .memproto { background-color: #d5e1e8; width: 100%; border-width: 1px; border-style: solid; border-color: #84b0c7; font-weight: bold; -moz-border-radius: 8px 8px 8px 8px; } .paramkey { text-align: right; } .paramtype { white-space: nowrap; } .paramname { color: #602020; font-style: italic; white-space: nowrap; } /* End Styling for detailed member documentation */ /* for the tree view */ .ftvtree { font-family: sans-serif; margin:0.5em; } .directory { font-size: 9pt; font-weight: bold; } .directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } .directory > h3 { margin-top: 0; } .directory p { margin: 0px; white-space: nowrap; } .directory div { display: none; margin: 0px; } .directory img { vertical-align: -30%; } libqalculate-0.9.7/docs/reference/html/classDataSet.html0000644000175100017510000005463111320655045020221 00000000000000 libqalculate-0.9.7: DataSet Class Reference

DataSet Class Reference

A data set. More...

#include <DataSet.h>

Inheritance diagram for DataSet:

MathFunction ExpressionItem

List of all members.

Public Member Functions

 DataSet (string s_category="", string s_name="", string s_default_file="", string s_title="", string s_description="", bool is_local=true)
 DataSet (const DataSet *o)
ExpressionItemcopy () const
void set (const ExpressionItem *item)
int subtype () const
void setCopyright (string s_copyright)
const string & copyright () const
void setDefaultDataFile (string s_file)
const string & defaultDataFile () const
void setDefaultProperty (string property)
const string & defaultProperty () const
virtual int calculate (MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)
bool loadObjects (const char *file_name=NULL, bool is_user_defs=true)
int saveObjects (const char *file_name=NULL, bool save_global=false)
bool objectsLoaded () const
void setObjectsLoaded (bool objects_loaded)
void addProperty (DataProperty *dp)
void delProperty (DataProperty *dp)
void delProperty (DataPropertyIter *it)
DataPropertygetPrimaryKeyProperty ()
DataPropertygetProperty (string property)
DataPropertygetFirstProperty (DataPropertyIter *it)
DataPropertygetNextProperty (DataPropertyIter *it)
const string & getFirstPropertyName (DataPropertyIter *it)
const string & getNextPropertyName (DataPropertyIter *it)
void addObject (DataObject *o)
void delObject (DataObject *o)
void delObject (DataObjectIter *it)
DataObjectgetObject (string object)
DataObjectgetObject (const MathStructure &object)
DataObjectgetFirstObject (DataObjectIter *it)
DataObjectgetNextObject (DataObjectIter *it)
const MathStructuregetObjectProperyStruct (string property, string object)
const string & getObjectProperty (string property, string object)
string getObjectPropertyInputString (string property, string object)
string getObjectPropertyDisplayString (string property, string object)
string printProperties (string object)
string printProperties (DataObject *o)

Protected Attributes

string sfile
string scopyright
bool b_loaded
vector< DataProperty * > properties
vector< DataObject * > objects


Detailed Description

A data set.

This is a simple database class for storage of many grouped values, when ordinary variables is not practical.

A data set consists of properties and objects, with values for the properties. Qalculate! includes for example a "Planets" data set with properties such as name, mass, speed and density, and an object for each planet in solar system.

A data set is also mathemtical function, dataset(object, property), which retrieves values for objects and properties. Data sets can be saved and loaded from a XML file.


Member Function Documentation

int DataSet::subtype (  )  const [virtual]

Returns the subtype of the mathematical function, corresponding to which subsubclass the object belongs to.

Returns:
FunctionSubtype.

Reimplemented from MathFunction.

virtual int DataSet::calculate ( MathStructure mstruct,
const MathStructure vargs,
const EvaluationOptions eo 
) [virtual]

The main function for subclasses to reimplement. Calculates a value from arguments in vargs and puts it in mstruct.

This function expects the number of arguments to be equal to the maximum number of arguments, and checked by the argument definitions.

If the return value is negative, then argument -(return value) has been evaluated in mstruct. If -(return value) is greater than max arguments, then mstruct is a vector of evaluated argument values.

Parameters:
[out] mstruct Structure that is set with the result of the calculation.
vargs Arguments passed to the mathematical function.
eo Evaluation options.
Returns:
1 if the calculation was successful.

Reimplemented from MathFunction.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classExpressionItemArgument.html0000644000175100017510000002626211320655045023354 00000000000000 libqalculate-0.9.7: ExpressionItemArgument Class Reference

ExpressionItemArgument Class Reference

Argument for functions, variables and units. More...

#include <Function.h>

Inheritance diagram for ExpressionItemArgument:

Argument

List of all members.

Public Member Functions

 ExpressionItemArgument (string name_="", bool does_test=true, bool does_error=true)
 ExpressionItemArgument (const ExpressionItemArgument *arg)
virtual int type () const
virtual Argumentcopy () const
virtual string print () const

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const


Detailed Description

Argument for functions, variables and units.

Text string representing a function, variable or unit name.


Member Function Documentation

virtual bool ExpressionItemArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented from Argument.

virtual string ExpressionItemArgument::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented from Argument.

virtual int ExpressionItemArgument::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented from Argument.

virtual Argument* ExpressionItemArgument::copy (  )  const [virtual]

Returns a copy of the argument definition.

Returns:
A copy.

Reimplemented from Argument.

virtual string ExpressionItemArgument::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented from Argument.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x7a.html0000644000175100017510000000737611320655045020521 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- z -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classNumberArgument.png0000644000175100017510000000062711320655045021443 00000000000000PNG  IHDRnP ]PLTE`{tRNS@f-IDATXK @eӵx*?B`b>jLh'CD'i,r;."#:"*82(\P>zxyX59-G6ǻۭ7|dq?c8$/KP܀Z?X[n|]R~vs\*6qT dyJ)}!pA4ҙzppbDjAQlQ̰dgR̷p5[,UN N֜Js:gnFO8gq?%ѩrtmm U:gOMIENDB`libqalculate-0.9.7/docs/reference/html/structExpressionName-members.html0000644000175100017510000001051311320655045023472 00000000000000 libqalculate-0.9.7: Member List

ExpressionName Member List

This is the complete list of members for ExpressionName, including all inherited members.

abbreviationExpressionName
avoid_inputExpressionName
case_sensitiveExpressionName
ExpressionName()ExpressionName
ExpressionName(string sname)ExpressionName
nameExpressionName
operator!=(const ExpressionName &ename) const (defined in ExpressionName)ExpressionName
operator=(const ExpressionName &ename) (defined in ExpressionName)ExpressionName
operator==(const ExpressionName &ename) const (defined in ExpressionName)ExpressionName
pluralExpressionName
referenceExpressionName
suffixExpressionName
unicodeExpressionName


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/doxygen.png0000644000175100017510000000240111320655044017126 00000000000000PNG  IHDRd-ok>gAMAOX2tEXtSoftwareAdobe ImageReadyqe<]PLTEǾ"&ﶻޠ{ԍ눙נED9hg]_X<@:#mhU1tRNSvIDATxbC: d#h` @X",***LK.], X@t b @BD6%""  % B:Hf@ RPy"K`\PbC(!II!h(!Cąl!0[X\J\$TM(>a$S @ Ш@R.$LJBRAG1 (FPhhT%!`&q%u P    CT$B|Wl!B`R$( @A%%@,(%$RPmB U`1IYB  99\1 yCCCf"[N'=TGȒl8^K5<SRɤ%@@  b1qAXH&BR y nP4A j>  t!+(.WQA2MU܂ `1%`19F< 3cZ`e!\ D+. 83!lYYA -6EJV @XXX 4 @86`RdB4I " "@xrʌHA`f ȰC"XV0C b@2H ȓ p)!( 04)(%R $Tʀbb,s@7 Ѱ?f֗\PIx!I"Ȉ3 QYt^^gv- }>WJOAV`$&#88\FF SFJ$ƀƊ 4 - Hf ?5 k1d, ."FˀI"4Hgx|fm)))9. aMD& X@t b @%DK.], X@t b @d`ɽSOIENDB`libqalculate-0.9.7/docs/reference/html/functions_0x70.html0000644000175100017510000001676211320655045020437 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- p -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func.html0000644000175100017510000001135411320655045020664 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- a -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x74.html0000644000175100017510000001401711320655045021445 00000000000000 libqalculate-0.9.7: Class Members - Functions
Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classNumber.html0000644000175100017510000026503211320655045020123 00000000000000 libqalculate-0.9.7: Number Class Reference

Number Class Reference

A number. More...

#include <Number.h>

List of all members.

Public Member Functions

 Number ()
 Number (string number, const ParseOptions &po=default_parse_options)
 Number (int numerator, int denominator=1, int exp_10=0)
 Number (const Number &o)
void set (string number, const ParseOptions &po=default_parse_options)
void set (int numerator, int denominator=1, int exp_10=0)
void setInfinity ()
void setPlusInfinity ()
void setMinusInfinity ()
void setFloat (double d_value)
void setInternal (const cln::cl_N &cln_value)
void setImaginaryPart (const Number &o)
void setImaginaryPart (int numerator, int denominator=1, int exp_10=0)
void set (const Number &o)
void clear ()
const cln::cl_N & internalNumber () const
double floatValue () const
int intValue (bool *overflow=NULL) const
bool isApproximate () const
bool isApproximateType () const
void setApproximate (bool is_approximate=true)
int precision () const
void setPrecision (int prec)
bool isUndefined () const
bool isInfinite () const
bool isInfinity () const
bool isPlusInfinity () const
bool isMinusInfinity () const
Number realPart () const
Number imaginaryPart () const
Number numerator () const
Number denominator () const
Number complexNumerator () const
Number complexDenominator () const
void operator= (const Number &o)
void operator-- (int)
void operator++ (int)
Number operator- () const
Number operator* (const Number &o) const
Number operator/ (const Number &o) const
Number operator+ (const Number &o) const
Number operator- (const Number &o) const
Number operator^ (const Number &o) const
Number operator && (const Number &o) const
Number operator|| (const Number &o) const
Number operator! () const
void operator*= (const Number &o)
void operator/= (const Number &o)
void operator+= (const Number &o)
void operator-= (const Number &o)
void operator^= (const Number &o)
bool operator== (const Number &o) const
bool operator!= (const Number &o) const
bool bitAnd (const Number &o)
bool bitOr (const Number &o)
bool bitXor (const Number &o)
bool bitNot ()
bool bitEqv (const Number &o)
bool shiftLeft (const Number &o)
bool shiftRight (const Number &o)
bool shift (const Number &o)
bool hasRealPart () const
bool hasImaginaryPart () const
bool isComplex () const
bool isInteger () const
Number integer () const
bool isRational () const
bool isReal () const
bool isFraction () const
bool isZero () const
bool isOne () const
bool isTwo () const
bool isI () const
bool isMinusI () const
bool isMinusOne () const
bool isNegative () const
bool isNonNegative () const
bool isPositive () const
bool isNonPositive () const
bool realPartIsNegative () const
bool realPartIsPositive () const
bool imaginaryPartIsNegative () const
bool imaginaryPartIsPositive () const
bool hasNegativeSign () const
bool hasPositiveSign () const
bool equalsZero () const
bool equals (const Number &o) const
bool equalsApproximately (const Number &o, int prec) const
ComparisonResult compare (const Number &o) const
ComparisonResult compareApproximately (const Number &o, int prec=EQUALS_PRECISION_LOWEST) const
ComparisonResult compareImaginaryParts (const Number &o) const
ComparisonResult compareRealParts (const Number &o) const
bool isGreaterThan (const Number &o) const
bool isLessThan (const Number &o) const
bool isGreaterThanOrEqualTo (const Number &o) const
bool isLessThanOrEqualTo (const Number &o) const
bool isEven () const
bool denominatorIsEven () const
bool denominatorIsTwo () const
bool numeratorIsEven () const
bool numeratorIsOne () const
bool numeratorIsMinusOne () const
bool isOdd () const
int integerLength () const
bool add (const Number &o)
bool subtract (const Number &o)
bool multiply (const Number &o)
bool divide (const Number &o)
bool recip ()
bool raise (const Number &o, bool try_exact=true)
bool exp10 (const Number &o)
bool exp2 (const Number &o)
bool exp10 ()
bool exp2 ()
bool square ()
bool negate ()
void setNegative (bool is_negative)
bool abs ()
bool signum ()
bool round (const Number &o)
bool floor (const Number &o)
bool ceil (const Number &o)
bool trunc (const Number &o)
bool mod (const Number &o)
bool isqrt ()
bool round ()
bool floor ()
bool ceil ()
bool trunc ()
bool frac ()
bool rem (const Number &o)
bool smod (const Number &o)
bool irem (const Number &o)
bool irem (const Number &o, Number &q)
bool iquo (const Number &o)
bool iquo (const Number &o, Number &r)
int getBoolean () const
void toBoolean ()
void setTrue (bool is_true=true)
void setFalse ()
void setLogicalNot ()
void e ()
void pi ()
void catalan ()
void euler ()
bool zeta ()
bool sin ()
bool asin ()
bool sinh ()
bool asinh ()
bool cos ()
bool acos ()
bool cosh ()
bool acosh ()
bool tan ()
bool atan ()
bool tanh ()
bool atanh ()
bool ln ()
bool log (const Number &o)
bool exp ()
bool lambertW ()
bool gcd (const Number &o)
bool lcm (const Number &o)
bool factorial ()
bool multiFactorial (const Number &o)
bool doubleFactorial ()
bool binomial (const Number &m, const Number &k)
bool factorize (vector< Number > &factors)
bool add (const Number &o, MathOperation op)
string printNumerator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
string printDenominator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
string printImaginaryNumerator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
string printImaginaryDenominator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
string print (const PrintOptions &po=default_print_options, const InternalPrintStruct &ips=top_ips) const

Protected Member Functions

void removeFloatZeroPart ()
void testApproximate ()
void testInteger ()
void setPrecisionAndApproximateFrom (const Number &o)

Protected Attributes

cln::cl_N value
bool b_inf
bool b_pinf
bool b_minf
bool b_approx
int i_precision


Detailed Description

A number.

Can be rational, floating point, complex or infinite. Has arbitrary precision (uses Calculator::precision()) and infinitely large rational numbers. Implimented using CLN numbers.


Constructor & Destructor Documentation

Number::Number (  ) 

Constructs a number initialized as zero.

Number::Number ( string  number,
const ParseOptions po = default_parse_options 
)

Constructs a number parsing a text string.

Parameters:
number Text string to read number from.
po Options for parsing the text string.

Number::Number ( int  numerator,
int  denominator = 1,
int  exp_10 = 0 
)

Constructs a rational number.

Parameters:
numerator 
denominator 
exp_10 

Number::Number ( const Number o  ) 

Constructs a copy of a number.


Member Function Documentation

int Number::intValue ( bool *  overflow = NULL  )  const

Converts a number to an integer. If the number does not represent an integer it will rounded using round().

Parameters:
[out] overflow If overflow is non-null it will be set to true if the number was to large to fit in an int.
Returns:
Resulting integer.

bool Number::isApproximate (  )  const

Returns true if the number is approximate.

Returns:
true if the number is approximate.

bool Number::isApproximateType (  )  const

Returns true if the number has an approximate representation/is of approximate type -- if it is a floating point number. Numbers of approximate type are always approximate, but the reversed relation is not always true.

Returns:
true if the number has an approximate representation.

void Number::setApproximate ( bool  is_approximate = true  ) 

Defines the number as approximate or exact. If a number of approximate type is set as exact, it will be converted to a rational number.

Parameters:
is_approximate If the number shall be regarded as approximate.

int Number::precision (  )  const

Returns the.precision of the number.

Returns:
Precision of the number or -1 if the number is exact or the precision has not been set.

bool Number::isInfinite (  )  const

Returns true if the number is infinity, plus infinity or minus infinity.

Returns:
true if the number is infinite.

bool Number::isInfinity (  )  const

Returns true if the number is infinity, if the number is plus or minus infinity (which is not known).

Returns:
true if the number is infinity.

bool Number::isPlusInfinity (  )  const

Returns true if the number is plus infinity.

Returns:
true if the number is plus infinity.

bool Number::isMinusInfinity (  )  const

Returns true if the number is minus infinity.

Returns:
true if the number is minus infinity.

Number Number::realPart (  )  const

Returns the real part of the number if it is complex, or a copy if it is real.

Returns:
true if the real part of a complex number.

Number Number::imaginaryPart (  )  const

Returns the imaginary part as real number of the number if it is complex, or zero if it is real.

Returns:
true if the imaginary part of a complex number.

bool Number::add ( const Number o  ) 

Add to the number (x+o).

Parameters:
o Number to add.
Returns:
true if the operation was successful.

bool Number::subtract ( const Number o  ) 

Subtracts from to the number (x-o).

Parameters:
o Number to subtract.
Returns:
true if the operation was successful.

bool Number::multiply ( const Number o  ) 

Multiply the number (x*o).

Parameters:
o Number to multiply with.
Returns:
true if the operation was successful.

bool Number::divide ( const Number o  ) 

Divide the number (x/o).

Parameters:
o Number to divide by.
Returns:
true if the operation was successful.

bool Number::recip (  ) 

Invert the number (1/x).

Returns:
true if the operation was successful.

bool Number::raise ( const Number o,
bool  try_exact = true 
)

Raise the number (x^o).

Parameters:
o Number to raise to.
try_exact If an exact solution should be tried first (might be slow).
Returns:
true if the operation was successful.

bool Number::exp10 ( const Number o  ) 

Multiply the number with a power of ten (x*10^o).

Parameters:
o Number to raise 10 by.
Returns:
true if the operation was successful.

bool Number::exp2 ( const Number o  ) 

Multiply the number with a power of two (x*2^o).

Parameters:
o Number to raise 2 by.
Returns:
true if the operation was successful.

bool Number::exp10 (  ) 

Set the number to ten raised by the number (10^x).

Returns:
true if the operation was successful.

bool Number::exp2 (  ) 

Set the number to two raised by the number (2^x).

Returns:
true if the operation was successful.

bool Number::square (  ) 

Raise the number by two (x^2).

Returns:
true if the operation was successful.

bool Number::negate (  ) 

Negate the number (-x).

Returns:
true if the operation was successful.

void Number::e (  ) 

Set the number to e, the base of natural logarithm, calculated with the current default precision.

void Number::pi (  ) 

Set the number to pi, Archimede's constant, calculated with the current default precision.

void Number::catalan (  ) 

Set the number to Catalan's constant, calculated with the current default precision.

void Number::euler (  ) 

Set the number to Euler's constant, calculated with the current default precision.

bool Number::zeta (  ) 

Set the number to Riemann's zeta with the number as integral point. The number must be an integer greater than one.

Returns:
true if the calculation was successful.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classCalculatorMessage-members.html0000644000175100017510000000630611320655045023716 00000000000000 libqalculate-0.9.7: Member List

CalculatorMessage Member List

This is the complete list of members for CalculatorMessage, including all inherited members.

c_message() const (defined in CalculatorMessage)CalculatorMessage
CalculatorMessage(string message_, MessageType type_=MESSAGE_WARNING) (defined in CalculatorMessage)CalculatorMessage
CalculatorMessage(const CalculatorMessage &e) (defined in CalculatorMessage)CalculatorMessage
message() const (defined in CalculatorMessage)CalculatorMessage
mtype (defined in CalculatorMessage)CalculatorMessage [protected]
smessage (defined in CalculatorMessage)CalculatorMessage [protected]
type() const (defined in CalculatorMessage)CalculatorMessage


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x6f.html0000644000175100017510000000675111320655045021534 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- o -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classUserFunction.html0000644000175100017510000004552111320655045021316 00000000000000 libqalculate-0.9.7: UserFunction Class Reference

UserFunction Class Reference

A user defined mathematical function. More...

#include <Function.h>

Inheritance diagram for UserFunction:

MathFunction ExpressionItem

List of all members.

Public Member Functions

 UserFunction (string cat_, string name_, string formula_, bool is_local=true, int argc_=-1, string title_="", string descr_="", int max_argc_=0, bool is_active=true)
 UserFunction (const UserFunction *function)
void set (const ExpressionItem *item)
ExpressionItemcopy () const
string formula () const
string internalFormula () const
int calculate (MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)
void setFormula (string new_formula, int argc_=-1, int max_argc_=0)
void addSubfunction (string subfunction, bool precalculate=true)
void setSubfunction (size_t index, string subfunction)
void delSubfunction (size_t index)
void clearSubfunctions ()
size_t countSubfunctions () const
void setSubfunctionPrecalculated (size_t index, bool precalculate)
const string & getSubfunction (size_t index) const
bool subfunctionPrecalculated (size_t index) const
int subtype () const

Protected Attributes

string sformula
string sformula_calc
vector< string > v_subs
vector< bool > v_precalculate


Detailed Description

A user defined mathematical function.

User functions are functions defined using expression strings, representing mathematical formulas.

The expression/formula of a function is basically a normal expression with placeholders for arguments. These placeholders consists of a backslash and a letter — x, y, z for the 1st, 2nd and 3rd arguments and a to u for argument 4 to 24. They are replaced by entered arguments when a function is calculated. The placeholders naturally also decide the number of arguments that a function requires. For example the function for triangle area ("base * height / 2") has the name triangle and the formula "(\x*\y)/2", which gives that "triangle(2, 3)" equals "(2*3) / 2" and returns "3" as result. An argument can be used more than one time and all arguments must not necessarily be in order in the formula.

Additionally, optional arguments can be put in the formula with upper-case (X, Y, Z, ...) instead of lower-case letters (x, y, z, ...). The default value can be put in brackets after the letter (ex. "\X{2}"). The default value may be omitted and is then zero. All additional arguments after an optional argument must also be optional.

To simplify the formula and make it more efficient, subfunctions can be used. These works just like the main formula, using the arguments of it. Subfunctions are referenced in the formula using ('', '', '', ...). Even though it would be quite meaningless, the formula for triangle function could for example have a subfunction "\x*\y" and the formula "\1/2". Subfunctions must be added before the main formula is set.


Member Function Documentation

string UserFunction::formula (  )  const

Returns the external representation of the formula.

string UserFunction::internalFormula (  )  const

Returns the internal representation of the formula.

int UserFunction::calculate ( MathStructure mstruct,
const MathStructure vargs,
const EvaluationOptions eo 
) [virtual]

The main function for subclasses to reimplement. Calculates a value from arguments in vargs and puts it in mstruct.

This function expects the number of arguments to be equal to the maximum number of arguments, and checked by the argument definitions.

If the return value is negative, then argument -(return value) has been evaluated in mstruct. If -(return value) is greater than max arguments, then mstruct is a vector of evaluated argument values.

Parameters:
[out] mstruct Structure that is set with the result of the calculation.
vargs Arguments passed to the mathematical function.
eo Evaluation options.
Returns:
1 if the calculation was successful.

Reimplemented from MathFunction.

void UserFunction::setFormula ( string  new_formula,
int  argc_ = -1,
int  max_argc_ = 0 
)

Sets the formula of the mathematical function.

Parameters:
new_formula Formula/expression.
arc_ Minimum number of arguments or -1 to read from formula.
max_argc_ Maximum number of arguments (ignored if argc_ < 0)

void UserFunction::setSubfunction ( size_t  index,
string  subfunction 
)

Sets the formula for a subfunction.

Parameters:
index Index (starting at 1).
subfunction Formula/expression.

int UserFunction::subtype (  )  const [virtual]

Returns the subtype of the mathematical function, corresponding to which subsubclass the object belongs to.

Returns:
FunctionSubtype.

Reimplemented from MathFunction.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classMatrixArgument.html0000644000175100017510000002713311320655045021640 00000000000000 libqalculate-0.9.7: MatrixArgument Class Reference

MatrixArgument Class Reference

A matrix argument. More...

#include <Function.h>

Inheritance diagram for MatrixArgument:

Argument

List of all members.

Public Member Functions

 MatrixArgument (string name_="", bool does_test=true, bool does_error=true)
 MatrixArgument (const MatrixArgument *arg)
virtual bool squareDemanded () const
virtual void setSquareDemanded (bool square)
virtual int type () const
virtual Argumentcopy () const
virtual string print () const

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const

Protected Attributes

bool b_square


Detailed Description

A matrix argument.

Member Function Documentation

virtual bool MatrixArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented from Argument.

virtual string MatrixArgument::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented from Argument.

virtual int MatrixArgument::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented from Argument.

virtual Argument* MatrixArgument::copy (  )  const [virtual]

Returns a copy of the argument definition.

Returns:
A copy.

Reimplemented from Argument.

virtual string MatrixArgument::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented from Argument.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classUserFunction.png0000644000175100017510000000077711320655045021142 00000000000000PNG  IHDR`PLTE`{tRNS@fIDATXKn0M7A{YG(d[mZ)$# a w>Ⓗ@p>aOz 4LweAZlJI-Mx]am\!5 lB %54(4G-HqIԃN)S@RʼgSv`3/w~ xۯq1p 0 0: l:`zۋXLJ1mIcxU (JT%@8'X΁Pe3PU6p`V 0hn[;=@e@/^A;@mEYIENDB`libqalculate-0.9.7/docs/reference/html/classDecimalPrefix.html0000644000175100017510000003415611320655045021410 00000000000000 libqalculate-0.9.7: DecimalPrefix Class Reference

DecimalPrefix Class Reference

A decimal (metric) prefix. More...

#include <Prefix.h>

Inheritance diagram for DecimalPrefix:

Prefix

List of all members.

Public Member Functions

 DecimalPrefix (int exp10, string long_name, string short_name="", string unicode_name="")
int exponent (int iexp=1) const
Number exponent (const Number &nexp) const
void setExponent (int iexp)
Number value (const Number &nexp) const
Number value (int iexp) const
Number value () const
int type () const

Protected Attributes

int exp


Detailed Description

A decimal (metric) prefix.

A metric or decimal prefix has an integer exponent which with a base of ten constitutes the value of the prefix (value=10^exponent).


Constructor & Destructor Documentation

DecimalPrefix::DecimalPrefix ( int  exp10,
string  long_name,
string  short_name = "",
string  unicode_name = "" 
)

Create a decimal prefix.

Parameters:
exp10 Exponent for the value.
long_name Long name.
short_name Short name.
unicode_name Unicode name.


Member Function Documentation

int DecimalPrefix::exponent ( int  iexp = 1  )  const

Returns the exponent.

Parameters:
iexp Exponent of the unit.
Returns:
The exponent of the prefix.

Number DecimalPrefix::exponent ( const Number nexp  )  const

Returns the exponent.

Parameters:
nexp Exponent of the unit.
Returns:
The exponent of the prefix.

void DecimalPrefix::setExponent ( int  iexp  ) 

Sets the exponent of the prefix.

Parameters:
iexp New exponent for the prefix.

Number DecimalPrefix::value ( const Number nexp  )  const [virtual]

Returns the value of the prefix.

Parameters:
nexp The power of the prefixed unit.
Returns:
The value of the prefix.

Implements Prefix.

Number DecimalPrefix::value ( int  iexp  )  const [virtual]

Returns the value of the prefix.

Parameters:
iexp The power of the prefixed unit.
Returns:
The value of the prefix.

Implements Prefix.

Number DecimalPrefix::value (  )  const [virtual]

Returns the value of the prefix.

Returns:
The value of the prefix.

Implements Prefix.

int DecimalPrefix::type (  )  const [virtual]

Returns type, subclass, of the prefix. This can be PREFIX_DECIMAL for prefixes of the class DecimalPrefix, PREFIX_BINARY for BinaryPrefix, or PREFIX_NUMBER for NumberPrefix.

Returns:
The type of the prefix.

Implements Prefix.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classAliasUnit__Composite.html0000644000175100017510000002414111320655045022737 00000000000000 libqalculate-0.9.7: AliasUnit_Composite Class Reference

AliasUnit_Composite Class Reference

A subunit in a CompositeUnit. More...

#include <Unit.h>

Inheritance diagram for AliasUnit_Composite:

AliasUnit Unit ExpressionItem

List of all members.

Public Member Functions

 AliasUnit_Composite (Unit *alias, int exp=1, Prefix *prefix_=NULL)
 AliasUnit_Composite (const AliasUnit_Composite *unit)
virtual ExpressionItemcopy () const
virtual void set (const ExpressionItem *item)
virtual string print (bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual Prefixprefix () const
virtual int prefixExponent () const
virtual void set (Unit *u, int exp=1, Prefix *prefix_=NULL)
virtual MathStructureconvertToFirstBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
virtual MathStructureconvertFromFirstBaseUnit (MathStructure &mvalue, MathStructure &mexp) const

Protected Attributes

Prefixprefixv


Detailed Description

A subunit in a CompositeUnit.

Should normally not be used directly.


Member Function Documentation

virtual string AliasUnit_Composite::print ( bool  plural_,
bool  short_,
bool  use_unicode = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const [virtual]

Returns a display string representing the unit in an expression.

Equivalent to preferredName() for Unit and AliasUnit, but closer to MathStructure::print() for CompositeUnit (prints out base expression).

Reimplemented from Unit.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x72.html0000644000175100017510000001347411320655045020436 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- r -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDataObjectArgument.png0000644000175100017510000000071011320655045022204 00000000000000PNG  IHDRP PLTE`{tRNS@f^IDATXKr `隟t ep+(/>b_ž0mnB?!0'I1@9AED& &Il *yi }^+Be )AOAF,<)aB0pg Gq8ׅ libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- u -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classVariable.png0000644000175100017510000000153711320655045020236 00000000000000PNG  IHDRx2PLTE`{tRNS@fIDATxmn0 U7HUWT4?&q>АtZx d΃݊Nʭ>wS% %u,4rٰnP.3sfľvQtKSgQ\P&AYDݛve'YSKMHݛ{{mkfCm 5}h t Tr Z^ 8"" ^@P@P@= DVj hY[UCzA?tp{-](llA\7ޔrFRݡ*YXtMҧ}RJ;|(S.A r+ .s:F/LW/#{ ( (O9qėC^P| \焘c0PIP䕒~.Й~|!Ar $ I1XOP_"Rd8GPLXB]ޯ$.朩aV>CgĽ3%o=r2{J)U%j{P]BFvꏠd&JdCb ;  o_/AKR$>= r:F/ ( (Z0.S-y ݡ&y JXep3ܽE97C31㗡XʹJnf@CJO,4Kh)48 FDvB3H4~_XC '|@ VIENDB`libqalculate-0.9.7/docs/reference/html/classMatrixArgument-members.html0000644000175100017510000002574411320655045023276 00000000000000 libqalculate-0.9.7: Member List

MatrixArgument Member List

This is the complete list of members for MatrixArgument, including all inherited members.

alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_square (defined in MatrixArgument)MatrixArgument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
copy() const MatrixArgument [virtual]
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
MatrixArgument(string name_="", bool does_test=true, bool does_error=true) (defined in MatrixArgument)MatrixArgument
MatrixArgument(const MatrixArgument *arg) (defined in MatrixArgument)MatrixArgument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const MatrixArgument [virtual]
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)Argument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setSquareDemanded(bool square) (defined in MatrixArgument)MatrixArgument [virtual]
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
squareDemanded() const (defined in MatrixArgument)MatrixArgument [virtual]
subprintlong() const MatrixArgument [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const MatrixArgument [protected, virtual]
suggestsQuotes() const (defined in Argument)Argument [virtual]
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const MatrixArgument [virtual]
zeroForbidden() const Argument
~Argument()Argument [virtual]
~MatrixArgument() (defined in MatrixArgument)MatrixArgument [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classCompositeUnit.html0000644000175100017510000004655411320655045021503 00000000000000 libqalculate-0.9.7: CompositeUnit Class Reference

CompositeUnit Class Reference

A unit consisting of a number of other units. More...

#include <Unit.h>

Inheritance diagram for CompositeUnit:

Unit ExpressionItem

List of all members.

Public Member Functions

 CompositeUnit (string cat_, string name_, string title_="", string base_expression_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 CompositeUnit (const CompositeUnit *unit)
virtual ExpressionItemcopy () const
virtual void set (const ExpressionItem *item)
virtual void add (Unit *u, int exp=1, Prefix *prefix=NULL)
virtual Unitget (size_t index, int *exp=NULL, Prefix **prefix=NULL) const
virtual void setExponent (size_t index, int exp)
virtual void setPrefix (size_t index, Prefix *prefix)
virtual size_t countUnits () const
virtual size_t find (Unit *u) const
virtual void del (size_t index)
virtual string print (bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual int subtype () const
virtual bool containsRelativeTo (Unit *u) const
virtual MathStructure generateMathStructure (bool make_division=false) const
virtual void setBaseExpression (string base_expression_)
virtual void clear ()

Protected Attributes

string sshort
vector< AliasUnit_Composite * > units


Detailed Description

A unit consisting of a number of other units.

Composite units are defined by a unit expression with multiple units. Composite units often have an alias unit associated with them, as they do not have a reference name on their own. For example, a joule is defined as an alias defined in relation to a composite unit defined as "Newton * meter".

The names of composite units is only used to reference the unit in definitions of other units. They can not be used in expressions.

Composite units is definited as a composition of units. The units, with prefixes and exponents, can either be added one by one with add() or parsed from an expression (ex. "cm^3/g) with setBaseExpression().


Member Function Documentation

virtual void CompositeUnit::add ( Unit u,
int  exp = 1,
Prefix prefix = NULL 
) [virtual]

Adds a sub/base unit with specified exponent and an optional prefix.

Parameters:
u Unit.
exp Exponent.
prefix Prefix.

virtual Unit* CompositeUnit::get ( size_t  index,
int *  exp = NULL,
Prefix **  prefix = NULL 
) const [virtual]

Retrieves information about a sub/base unit

Parameters:
index Index starting at 1.
[out] exp Exponent.
[out] prefix Prefix.
Returns:
Sub/base unit (AliasUnit_Composite::firstBaseUnit()).

virtual size_t CompositeUnit::countUnits (  )  const [virtual]

Returns the number of sub/base units

virtual string CompositeUnit::print ( bool  plural_,
bool  short_,
bool  use_unicode = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const [virtual]

Prints out the sub/base units with prefixes and exponents. This is the representation of the unit in expressions.

Reimplemented from Unit.

virtual int CompositeUnit::subtype (  )  const [virtual]

Returns the subtype of the unit, corresponding to which subsubclass the object belongs to.

Returns:
UnitSubtype.

Reimplemented from Unit.

virtual bool CompositeUnit::containsRelativeTo ( Unit u  )  const [virtual]

If this unit contains a sub/base unit with a relation to the specified unit.

virtual MathStructure CompositeUnit::generateMathStructure ( bool  make_division = false  )  const [virtual]

Creates a MathStructure with the sub/base units of the unit.

virtual void CompositeUnit::clear (  )  [virtual]

Removes all sub/base units.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classNumberPrefix.html0000644000175100017510000002734311320655045021302 00000000000000 libqalculate-0.9.7: NumberPrefix Class Reference

NumberPrefix Class Reference

A prefix with a free numerical value. More...

#include <Prefix.h>

Inheritance diagram for NumberPrefix:

Prefix

List of all members.

Public Member Functions

 NumberPrefix (const Number &nr, string long_name, string short_name="", string unicode_name="")
void setValue (const Number &nr)
Number value (const Number &nexp) const
Number value (int iexp) const
Number value () const
int type () const

Protected Attributes

Number o_number


Detailed Description

A prefix with a free numerical value.

A prefix without any predefined base, which can use any number.


Constructor & Destructor Documentation

NumberPrefix::NumberPrefix ( const Number nr,
string  long_name,
string  short_name = "",
string  unicode_name = "" 
)

Create a number prefix.

Parameters:
nr Value of the prefix.
long_name Long name.
short_name Short name.
unicode_name Unicode name.


Member Function Documentation

void NumberPrefix::setValue ( const Number nr  ) 

Sets the value of the prefix.

Parameters:
nr New value for the prefix.

Number NumberPrefix::value ( const Number nexp  )  const [virtual]

Returns the value of the prefix.

Parameters:
nexp The power of the prefixed unit.
Returns:
The value of the prefix.

Implements Prefix.

Number NumberPrefix::value ( int  iexp  )  const [virtual]

Returns the value of the prefix.

Parameters:
iexp The power of the prefixed unit.
Returns:
The value of the prefix.

Implements Prefix.

Number NumberPrefix::value (  )  const [virtual]

Returns the value of the prefix.

Returns:
The value of the prefix.

Implements Prefix.

int NumberPrefix::type (  )  const [virtual]

Returns type, subclass, of the prefix. This can be PREFIX_DECIMAL for prefixes of the class DecimalPrefix, PREFIX_BINARY for BinaryPrefix, or PREFIX_NUMBER for NumberPrefix.

Returns:
The type of the prefix.

Implements Prefix.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classArgumentSet-members.html0000644000175100017510000002634411320655045022562 00000000000000 libqalculate-0.9.7: Member List

ArgumentSet Member List

This is the complete list of members for ArgumentSet, including all inherited members.

addArgument(Argument *arg) (defined in ArgumentSet)ArgumentSet
alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
ArgumentSet(string name_="", bool does_test=true, bool does_error=true) (defined in ArgumentSet)ArgumentSet
ArgumentSet(const ArgumentSet *arg) (defined in ArgumentSet)ArgumentSet
b_error (defined in Argument)Argument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
copy() const ArgumentSet [virtual]
countArguments() const (defined in ArgumentSet)ArgumentSet
delArgument(size_t index) (defined in ArgumentSet)ArgumentSet
getArgument(size_t index) const (defined in ArgumentSet)ArgumentSet
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const ArgumentSet [virtual]
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)Argument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
subargs (defined in ArgumentSet)ArgumentSet [protected]
subprintlong() const ArgumentSet [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const ArgumentSet [protected, virtual]
suggestsQuotes() const (defined in Argument)Argument [virtual]
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const ArgumentSet [virtual]
zeroForbidden() const Argument
~Argument()Argument [virtual]
~ArgumentSet() (defined in ArgumentSet)ArgumentSet [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x78.html0000644000175100017510000001033511320655045020435 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- x -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classKnownVariable.html0000644000175100017510000007136711320655045021443 00000000000000 libqalculate-0.9.7: KnownVariable Class Reference

KnownVariable Class Reference

A variable with a known value. More...

#include <Variable.h>

Inheritance diagram for KnownVariable:

Variable ExpressionItem DynamicVariable

List of all members.

Public Member Functions

 KnownVariable (string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 KnownVariable (string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 KnownVariable ()
 KnownVariable (const KnownVariable *variable)
virtual ExpressionItemcopy () const
virtual void set (const ExpressionItem *item)
bool isKnown () const
virtual bool isExpression () const
virtual string expression () const
int subtype () const
virtual void set (const MathStructure &o)
virtual void set (string expression_)
virtual const MathStructureget ()
virtual bool representsPositive (bool=false)
virtual bool representsNegative (bool=false)
virtual bool representsNonNegative (bool=false)
virtual bool representsNonPositive (bool=false)
virtual bool representsInteger (bool=false)
virtual bool representsNumber (bool=false)
virtual bool representsRational (bool=false)
virtual bool representsReal (bool=false)
virtual bool representsComplex (bool=false)
virtual bool representsNonZero (bool=false)
virtual bool representsEven (bool=false)
virtual bool representsOdd (bool=false)
virtual bool representsUndefined (bool=false, bool=false, bool=false)
virtual bool representsBoolean ()
virtual bool representsNonMatrix ()

Protected Attributes

MathStructuremstruct
bool b_expression
int calculated_precision
string sexpression


Detailed Description

A variable with a known value.

Known variables have an associated value. The value can be a simple number or a full mathematical expression. The known variable class is used both for variable values and constants.

The value can be provided as an expression in the form of a text string or as a mathematical value in the form of an object of the MathStructure class. The text string is parsed when needed, which saves time when loading many variable definitions which might not be used, at least not immediately.


Constructor & Destructor Documentation

KnownVariable::KnownVariable ( string  cat_,
string  name_,
const MathStructure o,
string  title_ = "",
bool  is_local = true,
bool  is_builtin = false,
bool  is_active = true 
)

Create a known variable with a value.

Parameters:
cat_ Category that the variable belongs to.
name_ Initial name of the variable.
o Value.
title_ Descriptive name.
is_local If the variable is local/user-defined or global.
is_builtin If the variable is builtin and not modifiable.
is_active If the variable is active and can be used in expressions.

KnownVariable::KnownVariable ( string  cat_,
string  name_,
string  expression_,
string  title_ = "",
bool  is_local = true,
bool  is_builtin = false,
bool  is_active = true 
)

Create a known variable with an text string expression.

Parameters:
cat_ Category that the variable belongs to.
name_ Initial name of the variable.
expression_ Expression.
title_ Descriptive name.
is_local If the variable is local/user-defined or global.
is_builtin If the variable is builtin and not modifiable.
is_active If the variable is active and can be used in expressions.

KnownVariable::KnownVariable (  ) 

Create an empty known variable. Primarily for internal use.

KnownVariable::KnownVariable ( const KnownVariable variable  ) 

Create a copy of a known variable.

Parameters:
variable Known variable to copy.


Member Function Documentation

bool KnownVariable::isKnown (  )  const [inline, virtual]

Returns if the variable has a known value (as oppossed to assumptions).

Returns:
true if the variable is of class KnownVariable, false if UnknownVariable.

Implements Variable.

virtual bool KnownVariable::isExpression (  )  const [virtual]

Returns if the variable has an text string expression instead of a value.

Returns:
True if the variable has an expression instead of a value.

virtual string KnownVariable::expression (  )  const [virtual]

Returns the variable's string expression or an empty string if it has not got an expression.

Returns:
The variable's expression.

int KnownVariable::subtype (  )  const [inline, virtual]

Returns the subtype of the variable, corresponding to which subsubclass the object belongs to.

Returns:
VariableSubtype.

Reimplemented from Variable.

References SUBTYPE_KNOWN_VARIABLE.

virtual void KnownVariable::set ( const MathStructure o  )  [virtual]

Sets the value of the variable. If expression is set, it is cleared.

Parameters:
o Value.

Reimplemented in DynamicVariable.

virtual void KnownVariable::set ( string  expression_  )  [virtual]

Sets the text string expression of the variable. The value is cleared.

Parameters:
expression_ Expression.

Reimplemented in DynamicVariable.

virtual const MathStructure& KnownVariable::get (  )  [virtual]

Returns the value of the variable. If no value is set or parsed and an expression is set, the expression is parsed and resulting value returned.

Returns:
The value of the variable..

Reimplemented in DynamicVariable.

virtual bool KnownVariable::representsPositive ( bool  = false  )  [virtual]

Returns if the variable represents a positive value.

Reimplemented from Variable.

Reimplemented in DynamicVariable.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x77.html0000644000175100017510000000731211320655045020435 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- w -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classPrefix-members.html0000644000175100017510000001212511320655045021551 00000000000000 libqalculate-0.9.7: Member List

Prefix Member List

This is the complete list of members for Prefix, including all inherited members.

l_name (defined in Prefix)Prefix [protected]
longName(bool return_short_if_no_long=true, bool use_unicode=false) const Prefix
name(bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const Prefix
Prefix(string long_name, string short_name="", string unicode_name="")Prefix
s_name (defined in Prefix)Prefix [protected]
setLongName(string long_name)Prefix
setShortName(string short_name)Prefix
setUnicodeName(string unicode_name)Prefix
shortName(bool return_long_if_no_short=true, bool use_unicode=false) const Prefix
type() const =0Prefix [pure virtual]
u_name (defined in Prefix)Prefix [protected]
unicodeName(bool return_short_if_no_uni=true) const Prefix
value(const Number &nexp) const =0Prefix [pure virtual]
value(int iexp) const =0Prefix [pure virtual]
value() const =0Prefix [pure virtual]
~Prefix() (defined in Prefix)Prefix [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classAliasUnit-members.html0000644000175100017510000007556411320655045022225 00000000000000 libqalculate-0.9.7: Member List

AliasUnit Member List

This is the complete list of members for AliasUnit, including all inherited members.

abbreviation(bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unit [virtual]
addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
AliasUnit(string cat_, string name_, string plural_, string singular_, string title_, Unit *alias, string relation="1", int exp=1, string inverse="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in AliasUnit)AliasUnit
AliasUnit(const AliasUnit *unit) (defined in AliasUnit)AliasUnit
AliasUnit() (defined in AliasUnit)AliasUnit
b_active (defined in ExpressionItem)ExpressionItem [protected]
b_approx (defined in ExpressionItem)ExpressionItem [protected]
b_builtin (defined in ExpressionItem)ExpressionItem [protected]
b_changed (defined in ExpressionItem)ExpressionItem [protected]
b_destroyed (defined in ExpressionItem)ExpressionItem [protected]
b_hidden (defined in ExpressionItem)ExpressionItem [protected]
b_local (defined in ExpressionItem)ExpressionItem [protected]
b_registered (defined in ExpressionItem)ExpressionItem [protected]
b_si (defined in Unit)Unit [protected]
baseExponent(int exp=1) const (defined in AliasUnit)AliasUnit [virtual]
baseUnit() const (defined in AliasUnit)AliasUnit [virtual]
category() const ExpressionItem [virtual]
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItem [virtual]
clearNames()ExpressionItem [virtual]
clearNonReferenceNames()ExpressionItem [virtual]
convert(Unit *u, MathStructure &mvalue, MathStructure &exp) const Unit
convert(Unit *u, MathStructure &mvalue) const Unit
convert(Unit *u, bool *converted=NULL) const (defined in Unit)Unit
convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnit [virtual]
convertFromBaseUnit(MathStructure &mvalue) const (defined in AliasUnit)AliasUnit [virtual]
convertFromBaseUnit() const (defined in AliasUnit)AliasUnit [virtual]
convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnit [virtual]
convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnit [virtual]
convertToBaseUnit(MathStructure &mvalue) const (defined in AliasUnit)AliasUnit [virtual]
convertToBaseUnit() const (defined in AliasUnit)AliasUnit [virtual]
convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnit [virtual]
copy() const (defined in AliasUnit)AliasUnit [virtual]
countNames() const (defined in ExpressionItem)ExpressionItem [virtual]
description() const ExpressionItem [virtual]
destroy() (defined in ExpressionItem)ExpressionItem [virtual]
expression() const (defined in AliasUnit)AliasUnit [virtual]
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
firstBaseExponent() const (defined in AliasUnit)AliasUnit [virtual]
firstBaseUnit() const (defined in AliasUnit)AliasUnit [virtual]
getName(size_t index) const ExpressionItem [virtual]
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItem [virtual]
hasChanged() const ExpressionItem [virtual]
hasComplexExpression() const (defined in AliasUnit)AliasUnit [virtual]
hasComplexRelationTo(Unit *u) const (defined in AliasUnit)AliasUnit [virtual]
hasName(const string &sname, bool case_sensitive=true) const ExpressionItem [virtual]
hasNameCaseSensitive(const string &sname) const ExpressionItem [virtual]
i_exp (defined in AliasUnit)AliasUnit [protected]
i_precision (defined in ExpressionItem)ExpressionItem [protected]
i_ref (defined in ExpressionItem)ExpressionItem [protected]
inverseExpression() const (defined in AliasUnit)AliasUnit [virtual]
isActive() const ExpressionItem [virtual]
isApproximate() const ExpressionItem [virtual]
isBuiltin() const (defined in ExpressionItem)ExpressionItem [virtual]
isChildOf(Unit *u) const AliasUnit [virtual]
isCurrency() const Unit
isHidden() const (defined in ExpressionItem)ExpressionItem [virtual]
isLocal() const (defined in ExpressionItem)ExpressionItem [virtual]
isParentOf(Unit *u) const AliasUnit [virtual]
isRegistered() const (defined in ExpressionItem)ExpressionItem
isSIUnit() const Unit
isUsedByOtherUnits() const (defined in Unit)Unit [virtual]
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItem [virtual]
names (defined in ExpressionItem)ExpressionItem [protected]
o_unit (defined in AliasUnit)AliasUnit [protected]
plural(bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unit [virtual]
precision() const ExpressionItem [virtual]
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
print(bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const Unit [virtual]
ref() (defined in ExpressionItem)ExpressionItem [virtual]
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
refcount() const ExpressionItem [virtual]
referenceName() const (defined in ExpressionItem)ExpressionItem [virtual]
removeName(size_t index) (defined in ExpressionItem)ExpressionItem [virtual]
scat (defined in ExpressionItem)ExpressionItem [protected]
sdescr (defined in ExpressionItem)ExpressionItem [protected]
set(const ExpressionItem *item) (defined in AliasUnit)AliasUnit [virtual]
setActive(bool is_active) (defined in ExpressionItem)ExpressionItem [virtual]
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItem [virtual]
setAsSIUnit()Unit
setBaseUnit(Unit *alias) (defined in AliasUnit)AliasUnit [virtual]
setCategory(string cat_)ExpressionItem [virtual]
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItem [virtual]
setDescription(string descr_)ExpressionItem [virtual]
setExponent(int exp) (defined in AliasUnit)AliasUnit [virtual]
setExpression(string relation)AliasUnit [virtual]
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItem [virtual]
setInverseExpression(string inverse)AliasUnit [virtual]
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItem [virtual]
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItem [virtual]
setName(string sname, size_t index, bool force=true)ExpressionItem [virtual]
setPrecision(int prec) (defined in ExpressionItem)ExpressionItem [virtual]
setRegistered(bool is_registered)ExpressionItem
setSystem(string s_system)Unit
setTitle(string title_)ExpressionItem [virtual]
singular(bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unit [virtual]
sinverse (defined in AliasUnit)AliasUnit [protected]
ssystem (defined in Unit)Unit [protected]
stitle (defined in ExpressionItem)ExpressionItem [protected]
subtype() const AliasUnit [virtual]
svalue (defined in AliasUnit)AliasUnit [protected]
system() const Unit
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
type() const Unit [virtual]
Unit(string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Unit)Unit
Unit() (defined in Unit)Unit
Unit(const Unit *unit) (defined in Unit)Unit
unref() (defined in ExpressionItem)ExpressionItem [virtual]
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
v_refs (defined in ExpressionItem)ExpressionItem [protected]
~AliasUnit() (defined in AliasUnit)AliasUnit [virtual]
~ExpressionItem() (defined in ExpressionItem)ExpressionItem [virtual]
~Unit() (defined in Unit)Unit [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classSymbolicArgument.png0000644000175100017510000000065611320655045021776 00000000000000PNG  IHDRuPK' PLTE`{tRNS@fDIDATXKr aӵ :ɅP@x8C3EN ' ]۷ģ6ٸ4z BZc21̿bW]l~E|fIy Fy,߬X5JX3e }k`ϼcvZǰzŽd';Nv .wogFY)K_J4zp%/’, >YY5E^Q3;BkjDY,[rs5vum#vY֌ؗX5J7,=WSovz `OcL-#IENDB`libqalculate-0.9.7/docs/reference/html/functions_vars.html0000644000175100017510000004252311320655045020706 00000000000000 libqalculate-0.9.7: Class Members - Variables
 

- a -

- b -

- c -

- d -

- e -

- f -

- g -

- h -

- i -

- k -

- l -

- m -

- n -

- p -

- r -

- s -

- t -

- u -

- v -

- w -

- x -

- y -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/includes_8h.html0000644000175100017510000023730511320655045020054 00000000000000 libqalculate-0.9.7: libqalculate/includes.h File Reference

libqalculate/includes.h File Reference

#include <vector>
#include <string>
#include <stack>
#include <list>
#include <errno.h>
#include <stddef.h>
#include <math.h>
#include <float.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

Classes

struct  SortOptions
 Options for ordering the parts of a mathematical expression/result before display. More...
struct  PrintOptions
 Options for formatting and display of mathematical structures/results. More...
struct  InternalPrintStruct
struct  ParseOptions
 Options for parsing expressions. More...
struct  EvaluationOptions
 Options for calculation. More...

Defines

#define COMPARISON_MIGHT_BE_LESS_OR_GREATER(i)   (i == COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_NOT_EQUAL)
#define COMPARISON_NOT_FULLY_KNOWN(i)   (i == COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_NOT_EQUAL || i == COMPARISON_RESULT_EQUAL_OR_LESS || i == COMPARISON_RESULT_EQUAL_OR_GREATER)
#define COMPARISON_IS_EQUAL_OR_GREATER(i)   (i == COMPARISON_RESULT_EQUAL || i == COMPARISON_RESULT_GREATER || i == COMPARISON_RESULT_EQUAL_OR_GREATER)
#define COMPARISON_IS_EQUAL_OR_LESS(i)   (i == COMPARISON_RESULT_EQUAL || i == COMPARISON_RESULT_LESS || i == COMPARISON_RESULT_EQUAL_OR_LESS)
#define COMPARISON_IS_NOT_EQUAL(i)   (i == COMPARISON_RESULT_NOT_EQUAL || i == COMPARISON_RESULT_LESS || i == COMPARISON_RESULT_GREATER)
#define COMPARISON_MIGHT_BE_EQUAL(i)   (i == COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_EQUAL_OR_LESS || i == COMPARISON_RESULT_EQUAL_OR_GREATER)
#define COMPARISON_MIGHT_BE_NOT_EQUAL(i)   (i == COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_EQUAL_OR_LESS || i == COMPARISON_RESULT_EQUAL_OR_GREATER)
#define NR_OF_PRIMES   174
#define SQP_LT_1000   11
#define SQP_LT_2000   17
#define SQP_LT_10000   28
#define SQP_LT_25000   40
#define SQP_LT_100000   68
#define BASE_ROMAN_NUMERALS   -1
#define BASE_TIME   -2
#define BASE_BINARY   2
#define BASE_OCTAL   8
#define BASE_DECIMAL   10
#define BASE_HEXADECIMAL   16
#define BASE_SEXAGESIMAL   60
#define EXP_BASE_3   -3
#define EXP_PRECISION   -1
#define EXP_NONE   0
#define EXP_PURE   1
#define EXP_SCIENTIFIC   3
#define CALCULATOR   calculator
#define DEFAULT_PRECISION   8
#define PRECISION   CALCULATOR->getPrecision()
#define SIGN_POWER_0   "°"
#define SIGN_POWER_1   "¹"
#define SIGN_POWER_2   "²"
#define SIGN_POWER_3   "³"
#define SIGN_EURO   "€"
#define SIGN_POUND   "£"
#define SIGN_CENT   "¢"
#define SIGN_YEN   "¥"
#define SIGN_MICRO   "µ"
#define SIGN_PI   "π"
#define SIGN_MULTIPLICATION   "×"
#define SIGN_MULTIDOT   "⋅"
#define SIGN_MULTIBULLET   "∙"
#define SIGN_SMALLCIRCLE   "•"
#define SIGN_DIVISION_SLASH   "∕"
#define SIGN_DIVISION   "÷"
#define SIGN_MINUS   "−"
#define SIGN_PLUS   "+"
#define SIGN_SQRT   "√"
#define SIGN_ALMOST_EQUAL   "≈"
#define SIGN_APPROXIMATELY_EQUAL   "≅"
#define SIGN_ZETA   "ζ"
#define SIGN_GAMMA   "γ"
#define SIGN_PHI   "φ"
#define SIGN_LESS_OR_EQUAL   "≤"
#define SIGN_GREATER_OR_EQUAL   "≥"
#define SIGN_NOT_EQUAL   "≠"
#define SIGN_CAPITAL_SIGMA   "Σ"
#define SIGN_CAPITAL_PI   "Π"
#define SIGN_CAPITAL_OMEGA   "Ω"
#define SIGN_CAPITAL_GAMMA   "Γ"
#define SIGN_CAPITAL_BETA   "Β"
#define SIGN_INFINITY   "∞"
#define SIGN_PLUSMINUS   "±"
#define ID_WRAP_LEFT_CH   '{'
#define ID_WRAP_RIGHT_CH   '}'
#define DOT_CH   '.'
#define ZERO_CH   '0'
#define ONE_CH   '1'
#define TWO_CH   '2'
#define THREE_CH   '3'
#define FOUR_CH   '4'
#define FIVE_CH   '5'
#define SIX_CH   '6'
#define SEVEN_CH   '7'
#define EIGHT_CH   '8'
#define NINE_CH   '9'
#define PLUS_CH   '+'
#define MINUS_CH   '-'
#define MULTIPLICATION_CH   '*'
#define MULTIPLICATION_2_CH   ' '
#define DIVISION_CH   '/'
#define EXP_CH   'E'
#define EXP2_CH   'e'
#define POWER_CH   '^'
#define SPACE_CH   ' '
#define LEFT_PARENTHESIS_CH   '('
#define RIGHT_PARENTHESIS_CH   ')'
#define LEFT_VECTOR_WRAP_CH   '['
#define RIGHT_VECTOR_WRAP_CH   ']'
#define FUNCTION_VAR_PRE_CH   '\\'
#define COMMA_CH   ','
#define NAME_NUMBER_PRE_CH   '_'
#define UNIT_DIVISION_CH   '/'
#define AND_CH   '&'
#define OR_CH   '|'
#define LESS_CH   '<'
#define GREATER_CH   '>'
#define BITWISE_NOT_CH   '~'
#define LOGICAL_NOT_CH   '!'
#define NOT_CH   '!'
#define EQUALS_CH   '='
#define ID_WRAP_LEFT   "{"
#define ID_WRAP_RIGHT   "}"
#define ID_WRAPS   "{}"
#define DOT   "."
#define SEXADOT   ":"
#define COMMA   ","
#define COMMAS   ",;"
#define NUMBERS   "0123456789"
#define NUMBER_ELEMENTS   "0123456789.:"
#define SIGNS   "+-*/^"
#define OPERATORS   "~+-*/^&|!<>="
#define PARENTHESISS   "()"
#define LEFT_PARENTHESIS   "("
#define RIGHT_PARENTHESIS   ")"
#define VECTOR_WRAPS   "[]"
#define LEFT_VECTOR_WRAP   "["
#define RIGHT_VECTOR_WRAP   "]"
#define SPACES   " \t\n"
#define SPACE   " "
#define RESERVED   "\'@?\\{}\""
#define PLUS   "+"
#define MINUS   "-"
#define MULTIPLICATION   "*"
#define MULTIPLICATION_2   " "
#define DIVISION   "/"
#define EXP   "E"
#define EXPS   "Ee"
#define POWER   "^"
#define LOGICAL_AND   "&&"
#define LOGICAL_OR   "||"
#define LOGICAL_NOT   "!"
#define BITWISE_AND   "&"
#define BITWISE_OR   "|"
#define BITWISE_NOT   "~"
#define SHIFT_RIGHT   ">>"
#define SHIFT_LEFT   "<<"
#define LESS   "<"
#define GREATER   ">"
#define NOT   "!"
#define EQUALS   "="
#define SINF   "INF"
#define SNAN   "NAN"
#define UNDERSCORE   "_"
#define NOT_IN_NAMES   RESERVED OPERATORS SPACES SEXADOT DOT VECTOR_WRAPS PARENTHESISS COMMAS

Enumerations

enum  ExpressionItemType { TYPE_VARIABLE, TYPE_FUNCTION, TYPE_UNIT }
 Type of ExpressionItem. More...
enum  ComparisonResult {
  COMPARISON_RESULT_EQUAL, COMPARISON_RESULT_GREATER, COMPARISON_RESULT_LESS, COMPARISON_RESULT_EQUAL_OR_GREATER,
  COMPARISON_RESULT_EQUAL_OR_LESS, COMPARISON_RESULT_NOT_EQUAL, COMPARISON_RESULT_UNKNOWN
}
 The result of a comparison of two values.
enum  PlotLegendPlacement {
  PLOT_LEGEND_NONE, PLOT_LEGEND_TOP_LEFT, PLOT_LEGEND_TOP_RIGHT, PLOT_LEGEND_BOTTOM_LEFT,
  PLOT_LEGEND_BOTTOM_RIGHT, PLOT_LEGEND_BELOW, PLOT_LEGEND_OUTSIDE
}
 Placement of legend.
enum  PlotStyle {
  PLOT_STYLE_LINES, PLOT_STYLE_POINTS, PLOT_STYLE_POINTS_LINES, PLOT_STYLE_BOXES,
  PLOT_STYLE_HISTOGRAM, PLOT_STYLE_STEPS, PLOT_STYLE_CANDLESTICKS, PLOT_STYLE_DOTS
}
 Plot type/style.
enum  PlotSmoothing {
  PLOT_SMOOTHING_NONE, PLOT_SMOOTHING_UNIQUE, PLOT_SMOOTHING_CSPLINES, PLOT_SMOOTHING_BEZIER,
  PLOT_SMOOTHING_SBEZIER
}
 Smoothing a plotted lines.
enum  PlotFileType {
  PLOT_FILETYPE_AUTO, PLOT_FILETYPE_PNG, PLOT_FILETYPE_PS, PLOT_FILETYPE_EPS,
  PLOT_FILETYPE_LATEX, PLOT_FILETYPE_SVG, PLOT_FILETYPE_FIG
}
 File type for saving plot to image.
enum  MathOperation {
  OPERATION_MULTIPLY, OPERATION_DIVIDE, OPERATION_ADD, OPERATION_SUBTRACT,
  OPERATION_RAISE, OPERATION_EXP10, OPERATION_LOGICAL_AND, OPERATION_LOGICAL_OR,
  OPERATION_LOGICAL_XOR, OPERATION_BITWISE_AND, OPERATION_BITWISE_OR, OPERATION_BITWISE_XOR,
  OPERATION_LESS, OPERATION_GREATER, OPERATION_EQUALS_LESS, OPERATION_EQUALS_GREATER,
  OPERATION_EQUALS, OPERATION_NOT_EQUALS
}
 Mathematical operations.
enum  ComparisonType {
  COMPARISON_LESS, COMPARISON_GREATER, COMPARISON_EQUALS_LESS, COMPARISON_EQUALS_GREATER,
  COMPARISON_EQUALS, COMPARISON_NOT_EQUALS
}
 Comparison signs for comparison structures.
enum  SortFlags { SORT_DEFAULT = 1 << 0, SORT_SCIENTIFIC = 1 << 1 }
enum  NumberFractionFormat { FRACTION_DECIMAL, FRACTION_DECIMAL_EXACT, FRACTION_FRACTIONAL, FRACTION_COMBINED }
enum  MultiplicationSign { MULTIPLICATION_SIGN_ASTERISK, MULTIPLICATION_SIGN_DOT, MULTIPLICATION_SIGN_X }
enum  DivisionSign { DIVISION_SIGN_SLASH, DIVISION_SIGN_DIVISION_SLASH, DIVISION_SIGN_DIVISION }
enum  BaseDisplay { BASE_DISPLAY_NONE, BASE_DISPLAY_NORMAL, BASE_DISPLAY_ALTERNATIVE }
enum  ApproximationMode { APPROXIMATION_EXACT, APPROXIMATION_TRY_EXACT, APPROXIMATION_APPROXIMATE }
enum  StructuringMode { STRUCTURING_NONE, STRUCTURING_SIMPLIFY, STRUCTURING_FACTORIZE }
enum  AutoPostConversion { POST_CONVERSION_NONE, POST_CONVERSION_BEST, POST_CONVERSION_BASE }
enum  ReadPrecisionMode { DONT_READ_PRECISION, ALWAYS_READ_PRECISION, READ_PRECISION_WHEN_DECIMALS }
enum  AngleUnit { ANGLE_UNIT_NONE, ANGLE_UNIT_RADIANS, ANGLE_UNIT_DEGREES, ANGLE_UNIT_GRADIANS }

Variables

static string empty_string
static const int PRIMES []
static const int SQUARE_PRIMES []
static struct SortOptions default_sort_options
static struct PrintOptions default_print_options
static struct InternalPrintStruct top_ips
static struct ParseOptions default_parse_options
static struct EvaluationOptions default_evaluation_options
MathStructure m_undefined
MathStructure m_empty_vector
MathStructure m_empty_matrix
MathStructure m_zero
MathStructure m_one
MathStructure m_minus_one
Number nr_zero
Number nr_one
Number nr_minus_one
EvaluationOptions no_evaluation
ExpressionName empty_expression_name
Calculatorcalculator

Detailed Description


Enumeration Type Documentation

Enumerator:
APPROXIMATION_EXACT  Allow only exact results.
APPROXIMATION_TRY_EXACT  Try to make the result as exact as possible.
APPROXIMATION_APPROXIMATE  Calculate the result approximately directly.

Enumerator:
POST_CONVERSION_NONE  Do not do any conversion of units in addition to syncing.
POST_CONVERSION_BEST  Convert to the best suited SI units (the least amount of units).
POST_CONVERSION_BASE  Convert to base units.

Type of ExpressionItem.

Enumerator:
TYPE_VARIABLE  class Variable
TYPE_FUNCTION  class MathFunction
TYPE_UNIT  class Unit

Enumerator:
FRACTION_DECIMAL  Display numbers in decimal, not fractional, format (ex. 0.333333).
FRACTION_DECIMAL_EXACT  Display as fraction if necessary to get an exact display of the result (ex. 1/3, but 0.25).
FRACTION_FRACTIONAL  Display as fraction (ex. 4/3).
FRACTION_COMBINED  Display as an integer and a fraction (ex. 3 + 1/2).

Enumerator:
STRUCTURING_NONE  Do not do any factorization or additional simplifications.
STRUCTURING_SIMPLIFY  Simplify the result as much as possible.
STRUCTURING_FACTORIZE  Factorize the result.


Variable Documentation

const int PRIMES[] [static]

Initial value:

 {
2, 3, 5, 7, 11, 13, 17, 19, 21, 23, 29, 31, 37, 41, 31, 37, 
41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 
107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 
173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 
239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 
311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 
383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 
457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523,
541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 
613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 
683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 
769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 
857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 
941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013
}

const int SQUARE_PRIMES[] [static]

Initial value:

 {
4, 9, 25, 49, 121, 169, 289, 361, 441, 529, 
841, 961, 1369, 1681, 961, 1369, 1681, 1849, 2209, 2809, 
3481, 3721, 4489, 5041, 5329, 6241, 6889, 7921, 9409, 10201, 
10609, 11449, 11881, 12769, 16129, 17161, 18769, 19321, 22201, 22801, 
24649, 26569, 27889, 29929, 32041, 32761, 36481, 37249, 38809, 39601, 
44521, 49729, 51529, 52441, 54289, 57121, 58081, 63001, 66049, 69169, 
72361, 73441, 76729, 78961, 80089, 85849, 94249, 96721, 97969, 100489, 
109561, 113569, 120409, 121801, 124609, 128881, 134689, 139129, 143641, 146689, 
151321, 157609, 160801, 167281, 175561, 177241, 185761, 187489, 192721, 196249, 
201601, 208849, 212521, 214369, 218089, 229441, 237169, 241081, 249001, 253009, 
259081, 271441, 273529, 292681, 299209, 310249, 316969, 323761, 326041, 332929, 
344569, 351649, 358801, 361201, 368449, 375769, 380689, 383161, 398161, 410881, 
413449, 418609, 426409, 434281, 436921, 452929, 458329, 466489, 477481, 491401, 
502681, 516961, 528529, 537289, 546121, 552049, 564001, 573049, 579121, 591361, 
597529, 619369, 635209, 654481, 657721, 674041, 677329, 683929, 687241, 703921, 
727609, 734449, 737881, 744769, 769129, 776161, 779689, 786769, 822649, 829921, 
844561, 863041, 877969, 885481, 896809, 908209, 935089, 942841, 954529, 966289, 
982081, 994009, 1018081, 1026169
}


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDynamicVariable-members.html0000644000175100017510000007260111320655045023353 00000000000000 libqalculate-0.9.7: Member List

DynamicVariable Member List

This is the complete list of members for DynamicVariable, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
b_active (defined in ExpressionItem)ExpressionItem [protected]
b_approx (defined in ExpressionItem)ExpressionItem [protected]
b_builtin (defined in ExpressionItem)ExpressionItem [protected]
b_changed (defined in ExpressionItem)ExpressionItem [protected]
b_destroyed (defined in ExpressionItem)ExpressionItem [protected]
b_expression (defined in KnownVariable)KnownVariable [protected]
b_hidden (defined in ExpressionItem)ExpressionItem [protected]
b_local (defined in ExpressionItem)ExpressionItem [protected]
b_registered (defined in ExpressionItem)ExpressionItem [protected]
calculate() const =0 (defined in DynamicVariable)DynamicVariable [protected, pure virtual]
calculated_precision (defined in KnownVariable)KnownVariable [protected]
calculatedPrecision() const DynamicVariable
category() const ExpressionItem [virtual]
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItem [virtual]
clearNames()ExpressionItem [virtual]
clearNonReferenceNames()ExpressionItem [virtual]
copy() const =0 (defined in DynamicVariable)DynamicVariable [pure virtual]
countNames() const (defined in ExpressionItem)ExpressionItem [virtual]
description() const ExpressionItem [virtual]
destroy() (defined in ExpressionItem)ExpressionItem [virtual]
DynamicVariable(string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true) (defined in DynamicVariable)DynamicVariable
DynamicVariable(const DynamicVariable *variable) (defined in DynamicVariable)DynamicVariable
DynamicVariable() (defined in DynamicVariable)DynamicVariable
expression() const KnownVariable [virtual]
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
get()DynamicVariable [virtual]
getName(size_t index) const ExpressionItem [virtual]
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItem [virtual]
hasChanged() const ExpressionItem [virtual]
hasName(const string &sname, bool case_sensitive=true) const ExpressionItem [virtual]
hasNameCaseSensitive(const string &sname) const ExpressionItem [virtual]
i_precision (defined in ExpressionItem)ExpressionItem [protected]
i_ref (defined in ExpressionItem)ExpressionItem [protected]
isActive() const ExpressionItem [virtual]
isApproximate() const ExpressionItem [virtual]
isBuiltin() const (defined in ExpressionItem)ExpressionItem [virtual]
isExpression() const KnownVariable [virtual]
isHidden() const (defined in ExpressionItem)ExpressionItem [virtual]
isKnown() const KnownVariable [inline, virtual]
isLocal() const (defined in ExpressionItem)ExpressionItem [virtual]
isRegistered() const (defined in ExpressionItem)ExpressionItem
KnownVariable(string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable(string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable()KnownVariable
KnownVariable(const KnownVariable *variable)KnownVariable
mstruct (defined in KnownVariable)KnownVariable [protected]
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItem [virtual]
names (defined in ExpressionItem)ExpressionItem [protected]
precision() const ExpressionItem [virtual]
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
ref() (defined in ExpressionItem)ExpressionItem [virtual]
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
refcount() const ExpressionItem [virtual]
referenceName() const (defined in ExpressionItem)ExpressionItem [virtual]
removeName(size_t index) (defined in ExpressionItem)ExpressionItem [virtual]
representsBoolean() (defined in DynamicVariable)DynamicVariable [inline, virtual]
representsComplex(bool=false) (defined in DynamicVariable)DynamicVariable [inline, virtual]
representsEven(bool=false) (defined in DynamicVariable)DynamicVariable [inline, virtual]
representsInteger(bool=false) (defined in DynamicVariable)DynamicVariable [inline, virtual]
representsNegative(bool=false) (defined in DynamicVariable)DynamicVariable [inline, virtual]
representsNonMatrix() (defined in DynamicVariable)DynamicVariable [inline, virtual]
representsNonNegative(bool=false) (defined in DynamicVariable)DynamicVariable [inline, virtual]
representsNonPositive(bool=false) (defined in DynamicVariable)DynamicVariable [inline, virtual]
representsNonZero(bool=false) (defined in DynamicVariable)DynamicVariable [inline, virtual]
representsNumber(bool=false) (defined in DynamicVariable)DynamicVariable [inline, virtual]
representsOdd(bool=false) (defined in DynamicVariable)DynamicVariable [inline, virtual]
representsPositive(bool=false)DynamicVariable [inline, virtual]
representsRational(bool=false) (defined in DynamicVariable)DynamicVariable [inline, virtual]
representsReal(bool=false) (defined in DynamicVariable)DynamicVariable [inline, virtual]
representsUndefined(bool=false, bool=false, bool=false) (defined in DynamicVariable)DynamicVariable [inline, virtual]
scat (defined in ExpressionItem)ExpressionItem [protected]
sdescr (defined in ExpressionItem)ExpressionItem [protected]
set(const ExpressionItem *item) (defined in DynamicVariable)DynamicVariable [virtual]
set(const MathStructure &o)DynamicVariable [virtual]
set(string expression_)DynamicVariable [virtual]
setActive(bool is_active) (defined in ExpressionItem)ExpressionItem [virtual]
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItem [virtual]
setCategory(string cat_)ExpressionItem [virtual]
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItem [virtual]
setDescription(string descr_)ExpressionItem [virtual]
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItem [virtual]
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItem [virtual]
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItem [virtual]
setName(string sname, size_t index, bool force=true)ExpressionItem [virtual]
setPrecision(int prec) (defined in ExpressionItem)ExpressionItem [virtual]
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItem [virtual]
sexpression (defined in KnownVariable)KnownVariable [protected]
stitle (defined in ExpressionItem)ExpressionItem [protected]
subtype() const KnownVariable [inline, virtual]
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
type() const Variable [inline, virtual]
unref() (defined in ExpressionItem)ExpressionItem [virtual]
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
v_refs (defined in ExpressionItem)ExpressionItem [protected]
Variable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Variable)Variable
Variable() (defined in Variable)Variable
Variable(const Variable *variable) (defined in Variable)Variable
~DynamicVariable() (defined in DynamicVariable)DynamicVariable [virtual]
~ExpressionItem() (defined in ExpressionItem)ExpressionItem [virtual]
~KnownVariable() (defined in KnownVariable)KnownVariable [virtual]
~Variable() (defined in Variable)Variable [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDataObjectArgument-members.html0000644000175100017510000002614011320655045024021 00000000000000 libqalculate-0.9.7: Member List

DataObjectArgument Member List

This is the complete list of members for DataObjectArgument, including all inherited members.

alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
copy() const DataObjectArgument [virtual]
DataObjectArgument(DataSet *data_set, string name_="", bool does_test=true, bool does_error=true) (defined in DataObjectArgument)DataObjectArgument
DataObjectArgument(const DataObjectArgument *arg) (defined in DataObjectArgument)DataObjectArgument
dataSet() const (defined in DataObjectArgument)DataObjectArgument
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
o_data (defined in DataObjectArgument)DataObjectArgument [protected]
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const DataObjectArgument [virtual]
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)Argument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setDataSet(DataSet *data_set) (defined in DataObjectArgument)DataObjectArgument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
subprintlong() const DataObjectArgument [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const DataObjectArgument [protected, virtual]
suggestsQuotes() const (defined in Argument)Argument [virtual]
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const DataObjectArgument [virtual]
zeroForbidden() const Argument
~Argument()Argument [virtual]
~DataObjectArgument() (defined in DataObjectArgument)DataObjectArgument


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classVectorArgument.html0000644000175100017510000003270311320655045021635 00000000000000 libqalculate-0.9.7: VectorArgument Class Reference

VectorArgument Class Reference

A vector argument. More...

#include <Function.h>

Inheritance diagram for VectorArgument:

Argument

List of all members.

Public Member Functions

 VectorArgument (string name_="", bool does_test=true, bool allow_matrix=false, bool does_error=true)
 VectorArgument (const VectorArgument *arg)
virtual int type () const
virtual Argumentcopy () const
virtual string print () const
bool reoccuringArguments () const
void setReoccuringArguments (bool reocc)
void addArgument (Argument *arg)
void delArgument (size_t index)
size_t countArguments () const
ArgumentgetArgument (size_t index) const

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const

Protected Attributes

vector< Argument * > subargs
bool b_argloop


Detailed Description

A vector argument.

Member Function Documentation

virtual bool VectorArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented from Argument.

virtual string VectorArgument::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented from Argument.

virtual int VectorArgument::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented from Argument.

virtual Argument* VectorArgument::copy (  )  const [virtual]

Returns a copy of the argument definition.

Returns:
A copy.

Reimplemented from Argument.

virtual string VectorArgument::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented from Argument.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classUnknownVariable.png0000644000175100017510000000101011320655045021600 00000000000000PNG  IHDRoiPLTE`{tRNS@fIDATX]!e 6ڧ 2`u~lۤAM#{M>WYd,k r`!1 jH)!u{G;k,/;d 4yʶL=-vP錖2d5`1s|pZ\{+㿀ۃ'dAtGn 4zp libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- h -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classUserFunction-members.html0000644000175100017510000011102511320655045022737 00000000000000 libqalculate-0.9.7: Member List

UserFunction Member List

This is the complete list of members for UserFunction, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addSubfunction(string subfunction, bool precalculate=true) (defined in UserFunction)UserFunction
appendDefaultValues(MathStructure &vargs) (defined in MathFunction)MathFunction
argc (defined in MathFunction)MathFunction [protected]
argdefs (defined in MathFunction)MathFunction [protected]
args() const MathFunction
args(const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)MathFunction
b_active (defined in ExpressionItem)ExpressionItem [protected]
b_approx (defined in ExpressionItem)ExpressionItem [protected]
b_builtin (defined in ExpressionItem)ExpressionItem [protected]
b_changed (defined in ExpressionItem)ExpressionItem [protected]
b_destroyed (defined in ExpressionItem)ExpressionItem [protected]
b_hidden (defined in ExpressionItem)ExpressionItem [protected]
b_local (defined in ExpressionItem)ExpressionItem [protected]
b_registered (defined in ExpressionItem)ExpressionItem [protected]
calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)UserFunction [virtual]
calculate(const string &eq, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunction [virtual]
calculate(MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunction [virtual]
category() const ExpressionItem [virtual]
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItem [virtual]
clearArgumentDefinitions()MathFunction
clearNames()ExpressionItem [virtual]
clearNonReferenceNames()ExpressionItem [virtual]
clearSubfunctions() (defined in UserFunction)UserFunction
condition() const MathFunction
copy() const (defined in UserFunction)UserFunction [virtual]
countNames() const (defined in ExpressionItem)ExpressionItem [virtual]
countSubfunctions() const (defined in UserFunction)UserFunction
createFunctionMathStructureFromSVArgs(vector< string > &svargs) (defined in MathFunction)MathFunction [protected, virtual]
createFunctionMathStructureFromVArgs(const MathStructure &vargs) (defined in MathFunction)MathFunction [protected, virtual]
default_values (defined in MathFunction)MathFunction [protected]
delSubfunction(size_t index) (defined in UserFunction)UserFunction
description() const ExpressionItem [virtual]
destroy() (defined in ExpressionItem)ExpressionItem [virtual]
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
formula() const UserFunction
getArgumentDefinition(size_t index)MathFunction
getDefaultValue(size_t arg_) const (defined in MathFunction)MathFunction
getName(size_t index) const ExpressionItem [virtual]
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItem [virtual]
getSubfunction(size_t index) const (defined in UserFunction)UserFunction
hasChanged() const ExpressionItem [virtual]
hasName(const string &sname, bool case_sensitive=true) const ExpressionItem [virtual]
hasNameCaseSensitive(const string &sname) const ExpressionItem [virtual]
i_precision (defined in ExpressionItem)ExpressionItem [protected]
i_ref (defined in ExpressionItem)ExpressionItem [protected]
internalFormula() const UserFunction
isActive() const ExpressionItem [virtual]
isApproximate() const ExpressionItem [virtual]
isBuiltin() const (defined in ExpressionItem)ExpressionItem [virtual]
isHidden() const (defined in ExpressionItem)ExpressionItem [virtual]
isLocal() const (defined in ExpressionItem)ExpressionItem [virtual]
isRegistered() const (defined in ExpressionItem)ExpressionItem
last_argdef_index (defined in MathFunction)MathFunction [protected]
lastArgumentDefinitionIndex() const MathFunction
MathFunction(string name_, int argc_, int max_argc_=0, string cat_="", string title_="", string descr_="", bool is_active=true) (defined in MathFunction)MathFunction
MathFunction(const MathFunction *function) (defined in MathFunction)MathFunction
MathFunction() (defined in MathFunction)MathFunction
max_argc (defined in MathFunction)MathFunction [protected]
maxargs() const MathFunction
minargs() const MathFunction
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItem [virtual]
names (defined in ExpressionItem)ExpressionItem [protected]
parse(const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunction [virtual]
parse(MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunction [virtual]
precision() const ExpressionItem [virtual]
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
printCondition()MathFunction
produceArgumentsVector(const MathStructure &vargs, int begin=-1, int end=-1) (defined in MathFunction)MathFunction
produceVector(const MathStructure &vargs, int begin=-1, int end=-1) (defined in MathFunction)MathFunction
ref() (defined in ExpressionItem)ExpressionItem [virtual]
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
refcount() const ExpressionItem [virtual]
referenceName() const (defined in ExpressionItem)ExpressionItem [virtual]
removeName(size_t index) (defined in ExpressionItem)ExpressionItem [virtual]
representsBoolean(const MathStructure &) const (defined in MathFunction)MathFunction [virtual]
representsComplex(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsEven(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsInteger(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNonMatrix(const MathStructure &) const (defined in MathFunction)MathFunction [virtual]
representsNonNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNonPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNonZero(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNumber(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsOdd(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsRational(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsReal(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsUndefined(const MathStructure &) const (defined in MathFunction)MathFunction [virtual]
scat (defined in ExpressionItem)ExpressionItem [protected]
scondition (defined in MathFunction)MathFunction [protected]
sdescr (defined in ExpressionItem)ExpressionItem [protected]
set(const ExpressionItem *item) (defined in UserFunction)UserFunction [virtual]
setActive(bool is_active) (defined in ExpressionItem)ExpressionItem [virtual]
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItem [virtual]
setArgumentDefinition(size_t index, Argument *argdef)MathFunction
setCategory(string cat_)ExpressionItem [virtual]
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItem [virtual]
setCondition(string expression)MathFunction
setDefaultValue(size_t arg_, string value_) (defined in MathFunction)MathFunction
setDescription(string descr_)ExpressionItem [virtual]
setFormula(string new_formula, int argc_=-1, int max_argc_=0)UserFunction
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItem [virtual]
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItem [virtual]
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItem [virtual]
setName(string sname, size_t index, bool force=true)ExpressionItem [virtual]
setPrecision(int prec) (defined in ExpressionItem)ExpressionItem [virtual]
setRegistered(bool is_registered)ExpressionItem
setSubfunction(size_t index, string subfunction)UserFunction
setSubfunctionPrecalculated(size_t index, bool precalculate) (defined in UserFunction)UserFunction
setTitle(string title_)ExpressionItem [virtual]
sformula (defined in UserFunction)UserFunction [protected]
sformula_calc (defined in UserFunction)UserFunction [protected]
stitle (defined in ExpressionItem)ExpressionItem [protected]
stringArgs(const string &str, vector< string > &svargs) (defined in MathFunction)MathFunction
subfunctionPrecalculated(size_t index) const (defined in UserFunction)UserFunction
subtype() const UserFunction [virtual]
testArgumentCount(int itmp) (defined in MathFunction)MathFunction
testArguments(MathStructure &vargs) (defined in MathFunction)MathFunction [protected]
testCondition(const MathStructure &vargs)MathFunction
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
type() const MathFunction [virtual]
unref() (defined in ExpressionItem)ExpressionItem [virtual]
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
UserFunction(string cat_, string name_, string formula_, bool is_local=true, int argc_=-1, string title_="", string descr_="", int max_argc_=0, bool is_active=true) (defined in UserFunction)UserFunction
UserFunction(const UserFunction *function) (defined in UserFunction)UserFunction
v_precalculate (defined in UserFunction)UserFunction [protected]
v_refs (defined in ExpressionItem)ExpressionItem [protected]
v_subs (defined in UserFunction)UserFunction [protected]
~ExpressionItem() (defined in ExpressionItem)ExpressionItem [virtual]
~MathFunction() (defined in MathFunction)MathFunction [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classAliasUnit.html0000644000175100017510000005055111320655045020562 00000000000000 libqalculate-0.9.7: AliasUnit Class Reference

AliasUnit Class Reference

An unit with relation to another unit. More...

#include <Unit.h>

Inheritance diagram for AliasUnit:

Unit ExpressionItem AliasUnit_Composite

List of all members.

Public Member Functions

 AliasUnit (string cat_, string name_, string plural_, string singular_, string title_, Unit *alias, string relation="1", int exp=1, string inverse="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 AliasUnit (const AliasUnit *unit)
virtual ExpressionItemcopy () const
virtual void set (const ExpressionItem *item)
virtual UnitbaseUnit () const
virtual UnitfirstBaseUnit () const
virtual void setBaseUnit (Unit *alias)
virtual string expression () const
virtual string inverseExpression () const
virtual void setExpression (string relation)
virtual void setInverseExpression (string inverse)
virtual MathStructureconvertToFirstBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
virtual MathStructureconvertFromFirstBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
virtual MathStructureconvertToBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
virtual MathStructureconvertFromBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
virtual MathStructureconvertToBaseUnit (MathStructure &mvalue) const
virtual MathStructureconvertFromBaseUnit (MathStructure &mvalue) const
virtual MathStructure convertToBaseUnit () const
virtual MathStructure convertFromBaseUnit () const
virtual int baseExponent (int exp=1) const
virtual void setExponent (int exp)
virtual int firstBaseExponent () const
virtual int subtype () const
virtual bool isChildOf (Unit *u) const
virtual bool isParentOf (Unit *u) const
virtual bool hasComplexExpression () const
virtual bool hasComplexRelationTo (Unit *u) const

Protected Attributes

string svalue
string sinverse
int i_exp
Unito_unit


Detailed Description

An unit with relation to another unit.

Alias units is defined in relation to another unit. For example, hour are defined as an alias unit that equals 60 minutes which in turn is defined in relation to seconds.

Alias units have an associated base unit, exponent and relation expression. For more complex relations an inverse relation can also be specified for conversion back from the base unit. The base unit must not necessarily be of the base unit class and it is recommended that an alias unit is defined in relation to the closest unit (ex. 1ft = 3 hands, 1 hand = 4 in, and 1 in = 0.0254 m).

The relation is usually just a number that tells how large quantity of the base unit is needed to get the alias unit (alias unit = base unit * relation). More complex units can specify the relation as a full-blown expression where '' is replaced by the quantity of the base unit and '' is the exponent. For example, Degrees Celsius has the relation "\x + 273.15" and the inverse relation "\x - 273.15" to the base unit Kelvin. For simple relations, the reversion is automatic and ought not be defined separately.

The precision property inherited from ExpressionItem defines the precision of the relation.

The exponent defines the exponential relation to the base unit, so that the alias unit equals the base unit raised to the exponent. For simple unit relations this gives: alias unit = relation * base unit^exponent.

Alias units normally have three different names defined for use in expressions - abbreviation (ex. "m"), singular ("meter") and plural ("meters").


Member Function Documentation

virtual void AliasUnit::setExpression ( string  relation  )  [virtual]

Sets the relation expression.

virtual void AliasUnit::setInverseExpression ( string  inverse  )  [virtual]

Sets the inverse relation expression.

virtual int AliasUnit::subtype (  )  const [virtual]

Returns the subtype of the unit, corresponding to which subsubclass the object belongs to.

Returns:
UnitSubtype.

Reimplemented from Unit.

virtual bool AliasUnit::isChildOf ( Unit u  )  const [virtual]

If specified unit is a base unit for this unit, directly or with other units in between. Equivalent to u->isParentOf(this).

Reimplemented from Unit.

virtual bool AliasUnit::isParentOf ( Unit u  )  const [virtual]

If this unit is a base unit for specified unit, directly or with other units in between. Equivalent to u->isChildOf(this).

Reimplemented from Unit.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/structSortOptions-members.html0000644000175100017510000000414311320655045023037 00000000000000 libqalculate-0.9.7: Member List

SortOptions Member List

This is the complete list of members for SortOptions, including all inherited members.

minus_lastSortOptions
prefix_currenciesSortOptions
SortOptions() (defined in SortOptions)SortOptions [inline]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classNumber-members.html0000644000175100017510000011423411320655045021550 00000000000000 libqalculate-0.9.7: Member List

Number Member List

This is the complete list of members for Number, including all inherited members.

abs() (defined in Number)Number
acos() (defined in Number)Number
acosh() (defined in Number)Number
add(const Number &o)Number
add(const Number &o, MathOperation op) (defined in Number)Number
asin() (defined in Number)Number
asinh() (defined in Number)Number
atan() (defined in Number)Number
atanh() (defined in Number)Number
b_approx (defined in Number)Number [protected]
b_inf (defined in Number)Number [protected]
b_minf (defined in Number)Number [protected]
b_pinf (defined in Number)Number [protected]
binomial(const Number &m, const Number &k) (defined in Number)Number
bitAnd(const Number &o) (defined in Number)Number
bitEqv(const Number &o) (defined in Number)Number
bitNot() (defined in Number)Number
bitOr(const Number &o) (defined in Number)Number
bitXor(const Number &o) (defined in Number)Number
catalan()Number
ceil(const Number &o) (defined in Number)Number
ceil() (defined in Number)Number
clear() (defined in Number)Number
compare(const Number &o) const (defined in Number)Number
compareApproximately(const Number &o, int prec=EQUALS_PRECISION_LOWEST) const (defined in Number)Number
compareImaginaryParts(const Number &o) const (defined in Number)Number
compareRealParts(const Number &o) const (defined in Number)Number
complexDenominator() const (defined in Number)Number
complexNumerator() const (defined in Number)Number
cos() (defined in Number)Number
cosh() (defined in Number)Number
denominator() const (defined in Number)Number
denominatorIsEven() const (defined in Number)Number
denominatorIsTwo() const (defined in Number)Number
divide(const Number &o)Number
doubleFactorial() (defined in Number)Number
e()Number
equals(const Number &o) const (defined in Number)Number
equalsApproximately(const Number &o, int prec) const (defined in Number)Number
equalsZero() const (defined in Number)Number
euler()Number
exp() (defined in Number)Number
exp10(const Number &o)Number
exp10()Number
exp2(const Number &o)Number
exp2()Number
factorial() (defined in Number)Number
factorize(vector< Number > &factors) (defined in Number)Number
floatValue() const (defined in Number)Number
floor(const Number &o) (defined in Number)Number
floor() (defined in Number)Number
frac() (defined in Number)Number
gcd(const Number &o) (defined in Number)Number
getBoolean() const (defined in Number)Number
hasImaginaryPart() const (defined in Number)Number
hasNegativeSign() const (defined in Number)Number
hasPositiveSign() const (defined in Number)Number
hasRealPart() const (defined in Number)Number
i_precision (defined in Number)Number [protected]
imaginaryPart() const Number
imaginaryPartIsNegative() const (defined in Number)Number
imaginaryPartIsPositive() const (defined in Number)Number
integer() const (defined in Number)Number
integerLength() const (defined in Number)Number
internalNumber() const (defined in Number)Number
intValue(bool *overflow=NULL) const Number
iquo(const Number &o) (defined in Number)Number
iquo(const Number &o, Number &r) (defined in Number)Number
irem(const Number &o) (defined in Number)Number
irem(const Number &o, Number &q) (defined in Number)Number
isApproximate() const Number
isApproximateType() const Number
isComplex() const (defined in Number)Number
isEven() const (defined in Number)Number
isFraction() const (defined in Number)Number
isGreaterThan(const Number &o) const (defined in Number)Number
isGreaterThanOrEqualTo(const Number &o) const (defined in Number)Number
isI() const (defined in Number)Number
isInfinite() const Number
isInfinity() const Number
isInteger() const (defined in Number)Number
isLessThan(const Number &o) const (defined in Number)Number
isLessThanOrEqualTo(const Number &o) const (defined in Number)Number
isMinusI() const (defined in Number)Number
isMinusInfinity() const Number
isMinusOne() const (defined in Number)Number
isNegative() const (defined in Number)Number
isNonNegative() const (defined in Number)Number
isNonPositive() const (defined in Number)Number
isOdd() const (defined in Number)Number
isOne() const (defined in Number)Number
isPlusInfinity() const Number
isPositive() const (defined in Number)Number
isqrt() (defined in Number)Number
isRational() const (defined in Number)Number
isReal() const (defined in Number)Number
isTwo() const (defined in Number)Number
isUndefined() const (defined in Number)Number
isZero() const (defined in Number)Number
lambertW() (defined in Number)Number
lcm(const Number &o) (defined in Number)Number
ln() (defined in Number)Number
log(const Number &o) (defined in Number)Number
mod(const Number &o) (defined in Number)Number
multiFactorial(const Number &o) (defined in Number)Number
multiply(const Number &o)Number
negate()Number
Number()Number
Number(string number, const ParseOptions &po=default_parse_options)Number
Number(int numerator, int denominator=1, int exp_10=0)Number
Number(const Number &o)Number
numerator() const (defined in Number)Number
numeratorIsEven() const (defined in Number)Number
numeratorIsMinusOne() const (defined in Number)Number
numeratorIsOne() const (defined in Number)Number
operator &&(const Number &o) const (defined in Number)Number
operator!() const (defined in Number)Number
operator!=(const Number &o) const (defined in Number)Number
operator*(const Number &o) const (defined in Number)Number
operator*=(const Number &o) (defined in Number)Number
operator+(const Number &o) const (defined in Number)Number
operator++(int) (defined in Number)Number
operator+=(const Number &o) (defined in Number)Number
operator-() const (defined in Number)Number
operator-(const Number &o) const (defined in Number)Number
operator--(int) (defined in Number)Number
operator-=(const Number &o) (defined in Number)Number
operator/(const Number &o) const (defined in Number)Number
operator/=(const Number &o) (defined in Number)Number
operator=(const Number &o) (defined in Number)Number
operator==(const Number &o) const (defined in Number)Number
operator^(const Number &o) const (defined in Number)Number
operator^=(const Number &o) (defined in Number)Number
operator||(const Number &o) const (defined in Number)Number
pi()Number
precision() const Number
print(const PrintOptions &po=default_print_options, const InternalPrintStruct &ips=top_ips) const (defined in Number)Number
printDenominator(int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const (defined in Number)Number
printImaginaryDenominator(int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const (defined in Number)Number
printImaginaryNumerator(int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const (defined in Number)Number
printNumerator(int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const (defined in Number)Number
raise(const Number &o, bool try_exact=true)Number
realPart() const Number
realPartIsNegative() const (defined in Number)Number
realPartIsPositive() const (defined in Number)Number
recip()Number
rem(const Number &o) (defined in Number)Number
removeFloatZeroPart() (defined in Number)Number [protected]
round(const Number &o) (defined in Number)Number
round() (defined in Number)Number
set(string number, const ParseOptions &po=default_parse_options) (defined in Number)Number
set(int numerator, int denominator=1, int exp_10=0) (defined in Number)Number
set(const Number &o) (defined in Number)Number
setApproximate(bool is_approximate=true)Number
setFalse() (defined in Number)Number
setFloat(double d_value) (defined in Number)Number
setImaginaryPart(const Number &o) (defined in Number)Number
setImaginaryPart(int numerator, int denominator=1, int exp_10=0) (defined in Number)Number
setInfinity() (defined in Number)Number
setInternal(const cln::cl_N &cln_value) (defined in Number)Number
setLogicalNot() (defined in Number)Number
setMinusInfinity() (defined in Number)Number
setNegative(bool is_negative) (defined in Number)Number
setPlusInfinity() (defined in Number)Number
setPrecision(int prec) (defined in Number)Number
setPrecisionAndApproximateFrom(const Number &o) (defined in Number)Number [protected]
setTrue(bool is_true=true) (defined in Number)Number
shift(const Number &o) (defined in Number)Number
shiftLeft(const Number &o) (defined in Number)Number
shiftRight(const Number &o) (defined in Number)Number
signum() (defined in Number)Number
sin() (defined in Number)Number
sinh() (defined in Number)Number
smod(const Number &o) (defined in Number)Number
square()Number
subtract(const Number &o)Number
tan() (defined in Number)Number
tanh() (defined in Number)Number
testApproximate() (defined in Number)Number [protected]
testInteger() (defined in Number)Number [protected]
toBoolean() (defined in Number)Number
trunc(const Number &o) (defined in Number)Number
trunc() (defined in Number)Number
value (defined in Number)Number [protected]
zeta()Number
~Number() (defined in Number)Number [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x64.html0000644000175100017510000001036411320655045021445 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- d -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDataPropertyArgument.png0000644000175100017510000000072311320655045022626 00000000000000PNG  IHDRPgPLTE`{tRNS@fiIDATX]r  :)?Bidgd |vw=dpșqRTՙSNٙb穣$Y=ssSb=G/9Ʊ~)5rI8a^}yNNxZwGMAGJ$8dzܤ7%#ՠF"G,W٬ЁfgB, \"WˉV 'X 58+rҊ? ' -+\/k˨P.p}mN8-28gNߝ/c9CIENDB`libqalculate-0.9.7/docs/reference/html/classIntegerArgument.png0000644000175100017510000000063411320655045021606 00000000000000PNG  IHDRiPFlPLTE`{tRNS@f2IDATXAr PZ_70'?B%G0gg<>'{ȏWQKu<*Y%OZ!Y`y_YیPFc|Fn))f;V[sKк-)`M[5eӠۺZnj5<ԡuSHxbZQ$6=JV(1Lz͓m Il libqalculate-0.9.7: Class Members - Functions
 

- r -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/globals.html0000644000175100017510000002336611320655045017272 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented file members with links to the documentation:

- a -

- c -

- e -

- f -

- m -

- n -

- p -

- s -

- t -

- u -

- v -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x67.html0000644000175100017510000001567011320655045021455 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- g -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x63.html0000644000175100017510000002016611320655045021445 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- c -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classMatrixArgument.png0000644000175100017510000000062611320655045021456 00000000000000PNG  IHDRePPLTE`{tRNS@f,IDATXQ es9NB}G$BTXu1*e0J?nqk xeBgB4k#B e,3"*v73Ͼj#}(ĕփϖ]7M4%nǢ ;̀?=f۷ic81Ge.s|pJ4]Nj_F/3Q2 9SӬ%Z,#SYdmfru#iHi:0@mtHIu2SJ64/0v݀0$ݾa3;U8\IENDB`libqalculate-0.9.7/docs/reference/html/structParseOptions.html0000644000175100017510000002541511320655045021537 00000000000000 libqalculate-0.9.7: ParseOptions Struct Reference

ParseOptions Struct Reference

Options for parsing expressions. More...

#include <includes.h>

List of all members.

Public Attributes

bool variables_enabled
 If variables will be parsed. Default: true.
bool functions_enabled
 If functions will be parsed. Default: true.
bool unknowns_enabled
 If left-over characters will be parsed as symbols. Default: true.
bool units_enabled
 If units will be parsed. Default: true.
bool rpn
 If Reverse Polish Notation syntax will be used. Default: false.
int base
 Base of parsed numbers. Default: 10.
bool limit_implicit_multiplication
 When implicit multiplication is limited variables, functions and units must be separated by a space, operator or parenthesis ("xy" does not equal "x * y"). Default: false.
ReadPrecisionMode read_precision
 If and when precisions will be read from number of digits in a number. Default: DONT_READ_PRECISION.
bool dot_as_separator
 If true. dots will ignored if another character is the default decimal sign, to allow dots to be used as thousand separator. Default: false.
bool brackets_as_parentheses
 Interpret square brackets equally to parentheses (not only for vectors/matrices). Default; false.
AngleUnit angle_unit
 Default angle unit for trigonometric functions. Default: ANGLE_UNIT_NONE.
MathStructureunended_function
 If non-NULL will be set to unfinished function at the end of the expression (if there is one). Default: NULL.
bool preserve_format
 Preserve the expression structure as much as possible. Default: false.
DataSetdefault_dataset
 Defaukt dataset. Used for object.property syntax without a preceeding data set. Default: NULL.


Detailed Description

Options for parsing expressions.

Member Data Documentation

When implicit multiplication is limited variables, functions and units must be separated by a space, operator or parenthesis ("xy" does not equal "x * y"). Default: false.

If the limit implicit multiplication mode is activated, the use of implicite multiplication when parsing expressions and displaying results will be limited to avoid confusion. For example, if this mode is not activated and "integrte(5x)" is accidently typed instead of "integrate(5x)", the expression is interpreted as "int(e * e * (5 * x) * gr * t)". If limit implicit multiplication is turned on to mistyped expression would instead show an error telling that "integrte" is not a valid variable, function or unit (unless unknowns is not enabled in which case the result will be "5 'integrate' * x".


The documentation for this struct was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDynamicVariable.html0000644000175100017510000003730711320655045021727 00000000000000 libqalculate-0.9.7: DynamicVariable Class Reference

DynamicVariable Class Reference

Abstract base class for variables with a value which is recalculated when the precision has changed. More...

#include <Variable.h>

Inheritance diagram for DynamicVariable:

KnownVariable Variable ExpressionItem

List of all members.

Public Member Functions

 DynamicVariable (string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true)
 DynamicVariable (const DynamicVariable *variable)
ExpressionItemcopy () const =0
void set (const ExpressionItem *item)
const MathStructureget ()
void set (const MathStructure &o)
void set (string expression_)
int calculatedPrecision () const
virtual bool representsPositive (bool=false)
virtual bool representsNegative (bool=false)
virtual bool representsNonNegative (bool=false)
virtual bool representsNonPositive (bool=false)
virtual bool representsInteger (bool=false)
virtual bool representsNumber (bool=false)
virtual bool representsRational (bool=false)
virtual bool representsReal (bool=false)
virtual bool representsComplex (bool=false)
virtual bool representsNonZero (bool=false)
virtual bool representsEven (bool=false)
virtual bool representsOdd (bool=false)
virtual bool representsUndefined (bool=false, bool=false, bool=false)
virtual bool representsBoolean ()
virtual bool representsNonMatrix ()

Protected Member Functions

virtual void calculate () const =0


Detailed Description

Abstract base class for variables with a value which is recalculated when the precision has changed.

Member Function Documentation

const MathStructure& DynamicVariable::get (  )  [virtual]

Returns the value of the variable. If no value is set or parsed and an expression is set, the expression is parsed and resulting value returned.

Returns:
The value of the variable..

Reimplemented from KnownVariable.

void DynamicVariable::set ( const MathStructure o  )  [virtual]

Sets the value of the variable. If expression is set, it is cleared.

Parameters:
o Value.

Reimplemented from KnownVariable.

void DynamicVariable::set ( string  expression_  )  [virtual]

Sets the text string expression of the variable. The value is cleared.

Parameters:
expression_ Expression.

Reimplemented from KnownVariable.

int DynamicVariable::calculatedPrecision (  )  const

Returns the precision of the calculated value.

Returns:
Precision of the calculated value or zero if the value has not yet been calculated.

virtual bool DynamicVariable::representsPositive ( bool  = false  )  [inline, virtual]

Returns if the variable represents a positive value.

Reimplemented from KnownVariable.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classMathFunction.png0000644000175100017510000000126411320655045021105 00000000000000PNG  IHDRTiPLTE`{tRNS@fJIDAThmn Af Ua`>ђf+"BSEիT޾jl 7 G4iOGqJȺ*ZϦm-n*rŤԼ/~CfJ\Z2SFk<&̟Ђ#(~aظEK11pRҹ:mCC&()rߥ n(aU E(BP":3(Ei7efi0R=@\:0 ?4Sy W/fJZ06v2 yM^3).嘊9N0_SNyS*+[LOrL(B҆=vT5H(BPr>.Y'zgJ 9 d M6P@j3IENDB`libqalculate-0.9.7/docs/reference/html/functions_0x76.html0000644000175100017510000001117211320655045020433 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- v -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classPrefix.html0000644000175100017510000005727111320655045020134 00000000000000 libqalculate-0.9.7: Prefix Class Reference

Prefix Class Reference

Abstract class for prefixes. More...

#include <Prefix.h>

Inheritance diagram for Prefix:

BinaryPrefix DecimalPrefix NumberPrefix

List of all members.

Public Member Functions

 Prefix (string long_name, string short_name="", string unicode_name="")
const string & shortName (bool return_long_if_no_short=true, bool use_unicode=false) const
const string & longName (bool return_short_if_no_long=true, bool use_unicode=false) const
const string & unicodeName (bool return_short_if_no_uni=true) const
void setShortName (string short_name)
void setLongName (string long_name)
void setUnicodeName (string unicode_name)
const string & name (bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual Number value (const Number &nexp) const =0
virtual Number value (int iexp) const =0
virtual Number value () const =0
virtual int type () const =0

Protected Attributes

string l_name
string s_name
string u_name


Detailed Description

Abstract class for prefixes.

A prefix is prepended to a unit to specificy a quantity multiplicator. A prefix has a numerical value which raised to the units power defines the quantity. In for example the expression "3 kilometers", meter is the unit, 3 is regular quantity, and kilo is a prefix with a value 1000, thus the example equals "3000 meters". If the unit instead had been squared, the value of the prefix would have been raised by two and the total quantity would have been 3.000.000.

Prefixes can have up to free different three names -- a long name, a short name and a short unicode name. The unicode name is an alternative to the short name that is preferred if unicode characters can be displayed. The names or used to reference the prefix in mathematical expressions and to display a prefix in a result.


Constructor & Destructor Documentation

Prefix::Prefix ( string  long_name,
string  short_name = "",
string  unicode_name = "" 
)

Create a prefix.

Parameters:
long_name Long name.
short_name Short name.
unicode_name Unicode name.


Member Function Documentation

const string& Prefix::shortName ( bool  return_long_if_no_short = true,
bool  use_unicode = false 
) const

Returns the short name of the prefix.

Parameters:
return_long_if_no_short If the long name shall be returned if the prefix has not got a short name (if it is empty).
use_unicode If a unicode version of the name is allowed and preferred.
Returns:
The short name of the prefix.

const string& Prefix::longName ( bool  return_short_if_no_long = true,
bool  use_unicode = false 
) const

Returns the long name of the prefix.

Parameters:
return_short_if_no_long If the short name shall be returned if the prefix has not got a long name (if it is empty).
use_unicode If a unicode version of the name is allowed and preferred.
Returns:
The long name of the prefix.

const string& Prefix::unicodeName ( bool  return_short_if_no_uni = true  )  const

Returns the unicode name of the prefix.

Parameters:
return_short_if_no_uni If the short name shall be returned if the prefix has not got a unicode name (if it is empty).
Returns:
The unicode name of the prefix.

void Prefix::setShortName ( string  short_name  ) 

Sets the short name of the prefix.

Parameters:
short_name The new short name for the prefix.

void Prefix::setLongName ( string  long_name  ) 

Sets the long name of the prefix.

Parameters:
long_name The new long name for the prefix.

void Prefix::setUnicodeName ( string  unicode_name  ) 

Sets the unicode name of the prefix. The unicode name is an alternative to the short name that is preferred if unicode characters can be displayed.

Parameters:
unicode_name The new unicode name for the prefix.

const string& Prefix::name ( bool  short_default = true,
bool  use_unicode = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const

Returns a preferred name of the prefix.

Parameters:
short_default If a short name is preferred.
use_unicode If a unicode name is preferred.
can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected.
can_display_unicode_string_arg Argument to pass to the above test function.
Returns:
A preferred name.

virtual Number Prefix::value ( const Number nexp  )  const [pure virtual]

Returns the value of the prefix.

Parameters:
nexp The power of the prefixed unit.
Returns:
The value of the prefix.

Implemented in DecimalPrefix, BinaryPrefix, and NumberPrefix.

virtual Number Prefix::value ( int  iexp  )  const [pure virtual]

Returns the value of the prefix.

Parameters:
iexp The power of the prefixed unit.
Returns:
The value of the prefix.

Implemented in DecimalPrefix, BinaryPrefix, and NumberPrefix.

virtual Number Prefix::value (  )  const [pure virtual]

Returns the value of the prefix.

Returns:
The value of the prefix.

Implemented in DecimalPrefix, BinaryPrefix, and NumberPrefix.

virtual int Prefix::type (  )  const [pure virtual]

Returns type, subclass, of the prefix. This can be PREFIX_DECIMAL for prefixes of the class DecimalPrefix, PREFIX_BINARY for BinaryPrefix, or PREFIX_NUMBER for NumberPrefix.

Returns:
The type of the prefix.

Implemented in DecimalPrefix, BinaryPrefix, and NumberPrefix.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/structPrintOptions.html0000644000175100017510000006635511320655045021571 00000000000000 libqalculate-0.9.7: PrintOptions Struct Reference

PrintOptions Struct Reference

Options for formatting and display of mathematical structures/results. More...

#include <includes.h>

List of all members.

Public Member Functions

const string & comma () const
 Returns the comma sign used (default sign or comma_sign).
const string & decimalpoint () const
 Returns the decimal sign used (default sign or decimalpoint_sign).

Public Attributes

int min_exp
int base
 Number base for displaying numbers. Default: 10.
BaseDisplay base_display
 How prefixes for numbers in non-decimal bases will be displayed.
bool lower_case_numbers
 Use lower case for non-numeric characters for bases > 10. Default: false.
bool lower_case_e
 Use lower case e for base-10 exponent (ex. 1.2e8 instead of 1.2E8). Default: false.
NumberFractionFormat number_fraction_format
 If rational numbers will be displayed with decimals, as a fraction, or something in between. Default: FRACTION_DECIMAL.
bool indicate_infinite_series
 Show that the digit series of a number continues forever with three dots, instead of rounding (ex. 2/3 displays as 0.666666... instead of 0.666667). Default: false.
bool show_ending_zeroes
 Show ending zeroes for approximate numbers to indicate precision (ex.1.2300000 instead of 1.23) . Default: false.
bool abbreviate_names
 Prefer abbreviated names of variables, units, functions etc. Default: true.
bool use_reference_names
 Prefer reference names of variables, units, functions etc. Default: false.
bool place_units_separately
 Isolate units at the end of the displayed expression (ex. x/y m/s instead of (x m)/(y s)). Default: true.
bool use_unit_prefixes
 Use prefixes for units when appropriate. Default: true.
bool use_prefixes_for_currencies
 Use prefixes for currencies if unit prefixes are om. Default: false.
bool use_all_prefixes
 Use all decimal SI prefixes. If false, prefixes which is not a multiple of thousand (centi, deci, deka, hekto) will not be used automatically. Default: false.
bool use_denominator_prefix
 If set to true, prefixes will be split between numerator and denominator in a unit expression (millimeter per kilogram instead of micrometer per gram). Default: true.
bool negative_exponents
 If true, negative exponents will be used instead of division (ex. 5/x^2 becomes 5*x^-2). Default: false.
bool short_multiplication
 Avoid using multiplication sign, when appropriate. Default: true.
bool limit_implicit_multiplication
 Use a format compatible with ParseOptions::limit_implicit_multiplication. Default: false.
bool allow_non_usable
 If it is not necessary that the displayed expression can be parsed correctly. Default: false.
bool use_unicode_signs
 If unicode signs can be displayed. Default: false.
MultiplicationSign multiplication_sign
 Sign used for display of multiplication. Default: MULTIPLICATION_SIGN_DOT.
DivisionSign division_sign
 Sign used for display of division. Default: DIVISION_SIGN_DIVISION_SLASH.
bool spacious
 If space will be used to make the output look nicer. Default: true.
bool excessive_parenthesis
 Use parentheses even when not necessary. Default: false.
bool halfexp_to_sqrt
 Transform raised to 1/2 to square root function. Default: true.
int min_decimals
 Minimum number of decimals to display for numbers. Default: 0.
int max_decimals
 Maximum number of decimals to display for numbers. A negative value disables the limit. Default: -1.
bool use_min_decimals
 Enable use of min_decimals. False is equivalent to a min_decimals value of zero. Default: true.
bool use_max_decimals
 Enable use of max_decimals. False is equivalent to a negative max_decimals value. Default: true.
bool round_halfway_to_even
 If true round halfway numbers to nearest even number, otherwise round upwards. Default: false.
bool improve_division_multipliers
 Multiply numerator and denominator to get integers (ex. (6x+y)/2z instead of (3x+0.5y)/z). Default: true.
Prefixprefix
 Force use of a specific prefix for units if not NULL. Default: NULL.
bool * is_approximate
 If not NULL will be set to true if the output is approximate. Default: NULL.
SortOptions sort_options
 Options for the order of values in the displayed expression. Default: default_sort_options.
string comma_sign
 Comma sign or empty string to use default comma sign. Default: empty string.
string decimalpoint_sign
 Decimal sign or empty string to use default decimal sign. Default: empty string.
bool(* can_display_unicode_string_function )(const char *, void *)
 Function that returns true if a text string with unicode signs can be properly displayed. Default: NULL.
void * can_display_unicode_string_arg
 Argument passed to can_display_unicode_string_function. Default: NULL.
bool hide_underscore_spaces
 Replace underscores in names with spaces, unless name has suffix. Default: false.
bool preserve_format
 Preserves the format of the structure (no sorting, no changed prefixes, no improved division multipliers, etc.). Default: false.
bool allow_factorization
 Allows factorization to occur in the output (should be set to true if the structure has been factorized). Default: false.
bool spell_out_logical_operators
 If logical operators will be spelled as AND and OR instead of && and ||. Default: false.
bool restrict_to_parent_precision
 Displays children of the structure with no higher precision than the parent. Default: true.


Detailed Description

Options for formatting and display of mathematical structures/results.
The documentation for this struct was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x7e.html0000644000175100017510000000673611320655045021537 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- ~ -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDateArgument-members.html0000644000175100017510000002426211320655045022701 00000000000000 libqalculate-0.9.7: Member List

DateArgument Member List

This is the complete list of members for DateArgument, including all inherited members.

alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
copy() const DateArgument [virtual]
DateArgument(string name_="", bool does_test=true, bool does_error=true) (defined in DateArgument)DateArgument
DateArgument(const DateArgument *arg) (defined in DateArgument)DateArgument
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const DateArgument [virtual]
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)Argument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
subprintlong() const DateArgument [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const DateArgument [protected, virtual]
suggestsQuotes() const (defined in Argument)Argument [virtual]
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const DateArgument [virtual]
zeroForbidden() const Argument
~Argument()Argument [virtual]
~DateArgument() (defined in DateArgument)DateArgument [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classUnknownVariable.html0000644000175100017510000004464211320655045022002 00000000000000 libqalculate-0.9.7: UnknownVariable Class Reference

UnknownVariable Class Reference

A variable with unknown value. More...

#include <Variable.h>

Inheritance diagram for UnknownVariable:

Variable ExpressionItem

List of all members.

Public Member Functions

 UnknownVariable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 UnknownVariable ()
 UnknownVariable (const UnknownVariable *variable)
virtual ExpressionItemcopy () const
virtual void set (const ExpressionItem *item)
bool isKnown () const
void setAssumptions (Assumptions *ass)
Assumptionsassumptions ()
int subtype () const
virtual bool representsPositive (bool=false)
virtual bool representsNegative (bool=false)
virtual bool representsNonNegative (bool=false)
virtual bool representsNonPositive (bool=false)
virtual bool representsInteger (bool=false)
virtual bool representsNumber (bool=false)
virtual bool representsRational (bool=false)
virtual bool representsReal (bool=false)
virtual bool representsComplex (bool=false)
virtual bool representsNonZero (bool=false)
virtual bool representsNonMatrix ()

Protected Attributes

Assumptionso_assumption


Detailed Description

A variable with unknown value.

Unknown variables have an associated assumption object.


Constructor & Destructor Documentation

UnknownVariable::UnknownVariable ( string  cat_,
string  name_,
string  title_ = "",
bool  is_local = true,
bool  is_builtin = false,
bool  is_active = true 
)

Create an unknown.

Parameters:
cat_ Category that the variable belongs to.
name_ Initial name of the variable.
title_ Descriptive name.
is_local If the variable is local/user-defined or global.
is_builtin If the variable is builtin and not modifiable.
is_active If the variable is active and can be used in expressions.

UnknownVariable::UnknownVariable (  ) 

Create an empty unknown variable.

UnknownVariable::UnknownVariable ( const UnknownVariable variable  ) 

Create a copy of an unknown variable.

Parameters:
variable Unknown variable to copy.


Member Function Documentation

bool UnknownVariable::isKnown (  )  const [inline, virtual]

Returns if the variable has a known value (as oppossed to assumptions).

Returns:
true if the variable is of class KnownVariable, false if UnknownVariable.

Implements Variable.

void UnknownVariable::setAssumptions ( Assumptions ass  ) 

Sets the assumptions of the unknown variable.

Parameters:
ass Assumptions.

Assumptions* UnknownVariable::assumptions (  ) 

Returns the assumptions of the unknown variable.

Returns:
Assumptions of the unknown variable.

int UnknownVariable::subtype (  )  const [inline, virtual]

Returns the subtype of the variable, corresponding to which subsubclass the object belongs to.

Returns:
VariableSubtype.

Reimplemented from Variable.

References SUBTYPE_UNKNOWN_VARIABLE.

virtual bool UnknownVariable::representsPositive ( bool  = false  )  [virtual]

Returns if the variable represents a positive value.

Reimplemented from Variable.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classVectorArgument-members.html0000644000175100017510000003015111320655045023260 00000000000000 libqalculate-0.9.7: Member List

VectorArgument Member List

This is the complete list of members for VectorArgument, including all inherited members.

addArgument(Argument *arg) (defined in VectorArgument)VectorArgument
alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_argloop (defined in VectorArgument)VectorArgument [protected]
b_error (defined in Argument)Argument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
copy() const VectorArgument [virtual]
countArguments() const (defined in VectorArgument)VectorArgument
delArgument(size_t index) (defined in VectorArgument)VectorArgument
getArgument(size_t index) const (defined in VectorArgument)VectorArgument
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const VectorArgument [virtual]
printlong() const Argument
rationalPolynomial() const Argument
reoccuringArguments() const (defined in VectorArgument)VectorArgument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)Argument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setReoccuringArguments(bool reocc) (defined in VectorArgument)VectorArgument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
subargs (defined in VectorArgument)VectorArgument [protected]
subprintlong() const VectorArgument [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const VectorArgument [protected, virtual]
suggestsQuotes() const (defined in Argument)Argument [virtual]
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const VectorArgument [virtual]
VectorArgument(string name_="", bool does_test=true, bool allow_matrix=false, bool does_error=true) (defined in VectorArgument)VectorArgument
VectorArgument(const VectorArgument *arg) (defined in VectorArgument)VectorArgument
zeroForbidden() const Argument
~Argument()Argument [virtual]
~VectorArgument() (defined in VectorArgument)VectorArgument [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/Function_8h.html0000644000175100017510000002636011320655045020030 00000000000000 libqalculate-0.9.7: libqalculate/Function.h File Reference

libqalculate/Function.h File Reference

#include <libqalculate/ExpressionItem.h>
#include <libqalculate/includes.h>

Classes

class  MathFunction
 Abstract base class for mathematical functions. More...
class  UserFunction
 A user defined mathematical function. More...
class  Argument
 A mathematical function argument definition with free value and base class for all argument definitions. More...
class  NumberArgument
 A definition for numerical arguments. More...
class  IntegerArgument
 A definition for integer arguments. More...
class  SymbolicArgument
 A symbolic argument. More...
class  TextArgument
 A text argument. More...
class  DateArgument
 A date argument. More...
class  VectorArgument
 A vector argument. More...
class  MatrixArgument
 A matrix argument. More...
class  ExpressionItemArgument
 Argument for functions, variables and units. More...
class  FunctionArgument
 A function argument. More...
class  BooleanArgument
 A boolean argument. More...
class  UnitArgument
class  AngleArgument
class  VariableArgument
class  FileArgument
class  ArgumentSet
 A set of accepted arguments. More...

Enumerations

enum  ArgumentType {
  ARGUMENT_TYPE_FREE, ARGUMENT_TYPE_SYMBOLIC, ARGUMENT_TYPE_TEXT, ARGUMENT_TYPE_DATE,
  ARGUMENT_TYPE_FILE, ARGUMENT_TYPE_INTEGER, ARGUMENT_TYPE_NUMBER, ARGUMENT_TYPE_VECTOR,
  ARGUMENT_TYPE_MATRIX, ARGUMENT_TYPE_EXPRESSION_ITEM, ARGUMENT_TYPE_FUNCTION, ARGUMENT_TYPE_UNIT,
  ARGUMENT_TYPE_BOOLEAN, ARGUMENT_TYPE_VARIABLE, ARGUMENT_TYPE_ANGLE, ARGUMENT_TYPE_SET,
  ARGUMENT_TYPE_DATA_OBJECT, ARGUMENT_TYPE_DATA_PROPERTY
}
 Argument types.
enum  ArgumentMinMaxPreDefinition {
  ARGUMENT_MIN_MAX_NONE, ARGUMENT_MIN_MAX_POSITIVE, ARGUMENT_MIN_MAX_NONZERO, ARGUMENT_MIN_MAX_NONNEGATIVE,
  ARGUMENT_MIN_MAX_NEGATIVE
}
 Predefined max and min values for number and integer arguments.
enum  FunctionSubtype { SUBTYPE_FUNCTION, SUBTYPE_USER_FUNCTION, SUBTYPE_DATA_SET }
 Type of mathematical function. More...

Detailed Description


Enumeration Type Documentation

Type of mathematical function.

Enumerator:
SUBTYPE_FUNCTION  class MathFunction
SUBTYPE_USER_FUNCTION  class UseFunction
SUBTYPE_DATA_SET  class DataSet


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classBooleanArgument-members.html0000644000175100017510000002443011320655045023400 00000000000000 libqalculate-0.9.7: Member List

BooleanArgument Member List

This is the complete list of members for BooleanArgument, including all inherited members.

alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
BooleanArgument(string name_="", bool does_test=true, bool does_error=true) (defined in BooleanArgument)BooleanArgument
BooleanArgument(const BooleanArgument *arg) (defined in BooleanArgument)BooleanArgument
copy() const BooleanArgument [virtual]
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const BooleanArgument [virtual]
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)Argument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
subprintlong() const BooleanArgument [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const BooleanArgument [protected, virtual]
suggestsQuotes() const (defined in Argument)Argument [virtual]
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const BooleanArgument [virtual]
zeroForbidden() const Argument
~Argument()Argument [virtual]
~BooleanArgument() (defined in BooleanArgument)BooleanArgument [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/Number_8h.html0000644000175100017510000000534411320655045017472 00000000000000 libqalculate-0.9.7: libqalculate/Number.h File Reference

libqalculate/Number.h File Reference

#include <libqalculate/includes.h>
#include <cln/cln.h>

Classes

class  Number
 A number. More...

Defines

#define EQUALS_PRECISION_DEFAULT   -1
#define EQUALS_PRECISION_LOWEST   -2
#define EQUALS_PRECISION_HIGHEST   -3

Detailed Description


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classAssumptions-members.html0000644000175100017510000001770211320655045022647 00000000000000 libqalculate-0.9.7: Member List

Assumptions Member List

This is the complete list of members for Assumptions, including all inherited members.

Assumptions() (defined in Assumptions)Assumptions
b_incl_max (defined in Assumptions)Assumptions [protected]
b_incl_min (defined in Assumptions)Assumptions [protected]
fmax (defined in Assumptions)Assumptions [protected]
fmin (defined in Assumptions)Assumptions [protected]
i_sign (defined in Assumptions)Assumptions [protected]
i_type (defined in Assumptions)Assumptions [protected]
includeEqualsMax() const (defined in Assumptions)Assumptions
includeEqualsMin() const (defined in Assumptions)Assumptions
isComplex() (defined in Assumptions)Assumptions
isInteger() (defined in Assumptions)Assumptions
isNegative() (defined in Assumptions)Assumptions
isNonMatrix() (defined in Assumptions)Assumptions
isNonNegative() (defined in Assumptions)Assumptions
isNonPositive() (defined in Assumptions)Assumptions
isNonZero() (defined in Assumptions)Assumptions
isNumber() (defined in Assumptions)Assumptions
isPositive() (defined in Assumptions)Assumptions
isRational() (defined in Assumptions)Assumptions
isReal() (defined in Assumptions)Assumptions
max() const (defined in Assumptions)Assumptions
min() const (defined in Assumptions)Assumptions
setIncludeEqualsMax(bool include_equals) (defined in Assumptions)Assumptions
setIncludeEqualsMin(bool include_equals) (defined in Assumptions)Assumptions
setMax(const Number *nmax) (defined in Assumptions)Assumptions
setMin(const Number *nmin) (defined in Assumptions)Assumptions
setSign(AssumptionSign as) (defined in Assumptions)Assumptions
setType(AssumptionType ant) (defined in Assumptions)Assumptions
sign() (defined in Assumptions)Assumptions
type() (defined in Assumptions)Assumptions
~Assumptions() (defined in Assumptions)Assumptions


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classCompositeUnit-members.html0000644000175100017510000007443411320655045023131 00000000000000 libqalculate-0.9.7: Member List

CompositeUnit Member List

This is the complete list of members for CompositeUnit, including all inherited members.

abbreviation(bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unit [virtual]
add(Unit *u, int exp=1, Prefix *prefix=NULL)CompositeUnit [virtual]
addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
b_active (defined in ExpressionItem)ExpressionItem [protected]
b_approx (defined in ExpressionItem)ExpressionItem [protected]
b_builtin (defined in ExpressionItem)ExpressionItem [protected]
b_changed (defined in ExpressionItem)ExpressionItem [protected]
b_destroyed (defined in ExpressionItem)ExpressionItem [protected]
b_hidden (defined in ExpressionItem)ExpressionItem [protected]
b_local (defined in ExpressionItem)ExpressionItem [protected]
b_registered (defined in ExpressionItem)ExpressionItem [protected]
b_si (defined in Unit)Unit [protected]
baseExponent(int exp=1) const (defined in Unit)Unit [virtual]
baseUnit() const (defined in Unit)Unit [virtual]
category() const ExpressionItem [virtual]
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItem [virtual]
clear()CompositeUnit [virtual]
clearNames()ExpressionItem [virtual]
clearNonReferenceNames()ExpressionItem [virtual]
CompositeUnit(string cat_, string name_, string title_="", string base_expression_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in CompositeUnit)CompositeUnit
CompositeUnit(const CompositeUnit *unit) (defined in CompositeUnit)CompositeUnit
containsRelativeTo(Unit *u) const CompositeUnit [virtual]
convert(Unit *u, MathStructure &mvalue, MathStructure &exp) const Unit
convert(Unit *u, MathStructure &mvalue) const Unit
convert(Unit *u, bool *converted=NULL) const (defined in Unit)Unit
convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in Unit)Unit [virtual]
convertFromBaseUnit(MathStructure &mvalue) const (defined in Unit)Unit [virtual]
convertFromBaseUnit() const (defined in Unit)Unit [virtual]
convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in Unit)Unit [virtual]
convertToBaseUnit(MathStructure &mvalue) const (defined in Unit)Unit [virtual]
convertToBaseUnit() const (defined in Unit)Unit [virtual]
copy() const (defined in CompositeUnit)CompositeUnit [virtual]
countNames() const (defined in ExpressionItem)ExpressionItem [virtual]
countUnits() const CompositeUnit [virtual]
del(size_t index) (defined in CompositeUnit)CompositeUnit [virtual]
description() const ExpressionItem [virtual]
destroy() (defined in ExpressionItem)ExpressionItem [virtual]
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
find(Unit *u) const (defined in CompositeUnit)CompositeUnit [virtual]
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
generateMathStructure(bool make_division=false) const CompositeUnit [virtual]
get(size_t index, int *exp=NULL, Prefix **prefix=NULL) const CompositeUnit [virtual]
getName(size_t index) const ExpressionItem [virtual]
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItem [virtual]
hasChanged() const ExpressionItem [virtual]
hasComplexRelationTo(Unit *u) const (defined in Unit)Unit [virtual]
hasName(const string &sname, bool case_sensitive=true) const ExpressionItem [virtual]
hasNameCaseSensitive(const string &sname) const ExpressionItem [virtual]
i_precision (defined in ExpressionItem)ExpressionItem [protected]
i_ref (defined in ExpressionItem)ExpressionItem [protected]
isActive() const ExpressionItem [virtual]
isApproximate() const ExpressionItem [virtual]
isBuiltin() const (defined in ExpressionItem)ExpressionItem [virtual]
isChildOf(Unit *u) const Unit [virtual]
isCurrency() const Unit
isHidden() const (defined in ExpressionItem)ExpressionItem [virtual]
isLocal() const (defined in ExpressionItem)ExpressionItem [virtual]
isParentOf(Unit *u) const Unit [virtual]
isRegistered() const (defined in ExpressionItem)ExpressionItem
isSIUnit() const Unit
isUsedByOtherUnits() const (defined in Unit)Unit [virtual]
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItem [virtual]
names (defined in ExpressionItem)ExpressionItem [protected]
plural(bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unit [virtual]
precision() const ExpressionItem [virtual]
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
print(bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const CompositeUnit [virtual]
ref() (defined in ExpressionItem)ExpressionItem [virtual]
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
refcount() const ExpressionItem [virtual]
referenceName() const (defined in ExpressionItem)ExpressionItem [virtual]
removeName(size_t index) (defined in ExpressionItem)ExpressionItem [virtual]
scat (defined in ExpressionItem)ExpressionItem [protected]
sdescr (defined in ExpressionItem)ExpressionItem [protected]
set(const ExpressionItem *item) (defined in CompositeUnit)CompositeUnit [virtual]
setActive(bool is_active) (defined in ExpressionItem)ExpressionItem [virtual]
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItem [virtual]
setAsSIUnit()Unit
setBaseExpression(string base_expression_) (defined in CompositeUnit)CompositeUnit [virtual]
setCategory(string cat_)ExpressionItem [virtual]
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItem [virtual]
setDescription(string descr_)ExpressionItem [virtual]
setExponent(size_t index, int exp) (defined in CompositeUnit)CompositeUnit [virtual]
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItem [virtual]
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItem [virtual]
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItem [virtual]
setName(string sname, size_t index, bool force=true)ExpressionItem [virtual]
setPrecision(int prec) (defined in ExpressionItem)ExpressionItem [virtual]
setPrefix(size_t index, Prefix *prefix) (defined in CompositeUnit)CompositeUnit [virtual]
setRegistered(bool is_registered)ExpressionItem
setSystem(string s_system)Unit
setTitle(string title_)ExpressionItem [virtual]
singular(bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unit [virtual]
sshort (defined in CompositeUnit)CompositeUnit [protected]
ssystem (defined in Unit)Unit [protected]
stitle (defined in ExpressionItem)ExpressionItem [protected]
subtype() const CompositeUnit [virtual]
system() const Unit
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
type() const Unit [virtual]
Unit(string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Unit)Unit
Unit() (defined in Unit)Unit
Unit(const Unit *unit) (defined in Unit)Unit
units (defined in CompositeUnit)CompositeUnit [protected]
unref() (defined in ExpressionItem)ExpressionItem [virtual]
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
v_refs (defined in ExpressionItem)ExpressionItem [protected]
~CompositeUnit() (defined in CompositeUnit)CompositeUnit [virtual]
~ExpressionItem() (defined in ExpressionItem)ExpressionItem [virtual]
~Unit() (defined in Unit)Unit [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/tabs.css0000644000175100017510000000334211320655044016413 00000000000000/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ DIV.tabs { float : left; width : 100%; background : url("tab_b.gif") repeat-x bottom; margin-bottom : 4px; } DIV.tabs UL { margin : 0px; padding-left : 10px; list-style : none; } DIV.tabs LI, DIV.tabs FORM { display : inline; margin : 0px; padding : 0px; } DIV.tabs FORM { float : right; } DIV.tabs A { float : left; background : url("tab_r.gif") no-repeat right top; border-bottom : 1px solid #84B0C7; font-size : x-small; font-weight : bold; text-decoration : none; } DIV.tabs A:hover { background-position: 100% -150px; } DIV.tabs A:link, DIV.tabs A:visited, DIV.tabs A:active, DIV.tabs A:hover { color: #1A419D; } DIV.tabs SPAN { float : left; display : block; background : url("tab_l.gif") no-repeat left top; padding : 5px 9px; white-space : nowrap; } DIV.tabs INPUT { float : right; display : inline; font-size : 1em; } DIV.tabs TD { font-size : x-small; font-weight : bold; text-decoration : none; } /* Commented Backslash Hack hides rule from IE5-Mac \*/ DIV.tabs SPAN {float : none;} /* End IE5-Mac hack */ DIV.tabs A:hover SPAN { background-position: 0% -150px; } DIV.tabs LI.current A { background-position: 100% -150px; border-width : 0px; } DIV.tabs LI.current SPAN { background-position: 0% -150px; padding-bottom : 6px; } DIV.navpath { background : none; border : none; border-bottom : 1px solid #84B0C7; } libqalculate-0.9.7/docs/reference/html/classDateArgument.html0000644000175100017510000002501611320655045021247 00000000000000 libqalculate-0.9.7: DateArgument Class Reference

DateArgument Class Reference

A date argument. More...

#include <Function.h>

Inheritance diagram for DateArgument:

Argument

List of all members.

Public Member Functions

 DateArgument (string name_="", bool does_test=true, bool does_error=true)
 DateArgument (const DateArgument *arg)
virtual int type () const
virtual Argumentcopy () const
virtual string print () const

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const


Detailed Description

A date argument.

A text argument representing a date.


Member Function Documentation

virtual bool DateArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented from Argument.

virtual string DateArgument::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented from Argument.

virtual int DateArgument::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented from Argument.

virtual Argument* DateArgument::copy (  )  const [virtual]

Returns a copy of the argument definition.

Returns:
A copy.

Reimplemented from Argument.

virtual string DateArgument::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented from Argument.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classMathFunction.html0000644000175100017510000012104711320655045021267 00000000000000 libqalculate-0.9.7: MathFunction Class Reference

MathFunction Class Reference

Abstract base class for mathematical functions. More...

#include <Function.h>

Inheritance diagram for MathFunction:

ExpressionItem DataSet UserFunction

List of all members.

Public Member Functions

 MathFunction (string name_, int argc_, int max_argc_=0, string cat_="", string title_="", string descr_="", bool is_active=true)
 MathFunction (const MathFunction *function)
virtual ExpressionItemcopy () const =0
virtual void set (const ExpressionItem *item)
virtual int type () const
virtual int subtype () const
bool testArgumentCount (int itmp)
virtual MathStructure calculate (const string &eq, const EvaluationOptions &eo=default_evaluation_options)
virtual MathStructure parse (const string &eq, const ParseOptions &po=default_parse_options)
virtual int parse (MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options)
virtual MathStructure calculate (MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options)
virtual int calculate (MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)
string condition () const
string printCondition ()
void setCondition (string expression)
bool testCondition (const MathStructure &vargs)
int args () const
int minargs () const
int maxargs () const
int args (const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)
size_t lastArgumentDefinitionIndex () const
ArgumentgetArgumentDefinition (size_t index)
void clearArgumentDefinitions ()
void setArgumentDefinition (size_t index, Argument *argdef)
int stringArgs (const string &str, vector< string > &svargs)
void setDefaultValue (size_t arg_, string value_)
const string & getDefaultValue (size_t arg_) const
void appendDefaultValues (MathStructure &vargs)
MathStructure produceVector (const MathStructure &vargs, int begin=-1, int end=-1)
MathStructure produceArgumentsVector (const MathStructure &vargs, int begin=-1, int end=-1)
virtual bool representsPositive (const MathStructure &, bool=false) const
virtual bool representsNegative (const MathStructure &, bool=false) const
virtual bool representsNonNegative (const MathStructure &, bool=false) const
virtual bool representsNonPositive (const MathStructure &, bool=false) const
virtual bool representsInteger (const MathStructure &, bool=false) const
virtual bool representsNumber (const MathStructure &, bool=false) const
virtual bool representsRational (const MathStructure &, bool=false) const
virtual bool representsReal (const MathStructure &, bool=false) const
virtual bool representsComplex (const MathStructure &, bool=false) const
virtual bool representsNonZero (const MathStructure &, bool=false) const
virtual bool representsEven (const MathStructure &, bool=false) const
virtual bool representsOdd (const MathStructure &, bool=false) const
virtual bool representsUndefined (const MathStructure &) const
virtual bool representsBoolean (const MathStructure &) const
virtual bool representsNonMatrix (const MathStructure &) const

Protected Member Functions

bool testArguments (MathStructure &vargs)
virtual MathStructure createFunctionMathStructureFromVArgs (const MathStructure &vargs)
virtual MathStructure createFunctionMathStructureFromSVArgs (vector< string > &svargs)

Protected Attributes

int argc
int max_argc
vector< string > default_values
Sgi::hash_map< size_t, Argument * > argdefs
size_t last_argdef_index
string scondition


Detailed Description

Abstract base class for mathematical functions.

A mathemical function, subclassed from MathFunction, should at least reimplement calculate(MathStructure&, const MathStructure&, const EvaluationOptions&) and copy(), and preferably also the represents* functions. Argument definitions should be added in the constructor.


Member Function Documentation

virtual int MathFunction::type (  )  const [virtual]

Returns the type of the expression item, corresponding to which subclass the object belongs to.

Returns:
ExpressionItemType.

Implements ExpressionItem.

virtual int MathFunction::subtype (  )  const [virtual]

Returns the subtype of the mathematical function, corresponding to which subsubclass the object belongs to.

Returns:
FunctionSubtype.

Implements ExpressionItem.

Reimplemented in DataSet, and UserFunction.

virtual int MathFunction::calculate ( MathStructure mstruct,
const MathStructure vargs,
const EvaluationOptions eo 
) [virtual]

The main function for subclasses to reimplement. Calculates a value from arguments in vargs and puts it in mstruct.

This function expects the number of arguments to be equal to the maximum number of arguments, and checked by the argument definitions.

If the return value is negative, then argument -(return value) has been evaluated in mstruct. If -(return value) is greater than max arguments, then mstruct is a vector of evaluated argument values.

Parameters:
[out] mstruct Structure that is set with the result of the calculation.
vargs Arguments passed to the mathematical function.
eo Evaluation options.
Returns:
1 if the calculation was successful.

Reimplemented in DataSet, and UserFunction.

string MathFunction::condition (  )  const

Returns the functions condition expression.

Returns:
The function's condition expression

string MathFunction::printCondition (  ) 

Print the function's condition expression with argument names.

Returns:
The printed condition

void MathFunction::setCondition ( string  expression  ) 

Sets the functions condition expression.

Parameters:
expression The function's new condition expression

bool MathFunction::testCondition ( const MathStructure vargs  ) 

Test if arguments fulfil the function's condition expression.

Parameters:
vargs Vector with arguments.
Returns:
true if the arguments fulfil the function's condition expression

int MathFunction::args (  )  const

Returns the maximum number of arguments that the function accepts or -1 if the number of arguments is unlimited.

int MathFunction::minargs (  )  const

Returns the minimum number of arguments for the function.

int MathFunction::maxargs (  )  const

Returns the maximum number of arguments that the function accepts or -1 if the number of arguments is unlimited.

int MathFunction::args ( const string &  str,
MathStructure vargs,
const ParseOptions po = default_parse_options 
)

Parses arguments from a text string and places them in a vector. The text string should be a comma separated list of arguments.

Parameters:
str The argument string to parse.
vargs Vector to store parsed arguments in.
po Parse options.
Returns:
The number of parsed arguments.

size_t MathFunction::lastArgumentDefinitionIndex (  )  const

Returns the index of the last argument definition.

Returns:
The index of the last argument definition

Argument* MathFunction::getArgumentDefinition ( size_t  index  ) 

Returns the argument definition for an argument index.

Parameters:
index Argument index.
Returns:
The argument definition for the index or NULL if no the argument was not defined for the index

void MathFunction::clearArgumentDefinitions (  ) 

Removes all argument definitions for the function.

void MathFunction::setArgumentDefinition ( size_t  index,
Argument argdef 
)

Set the argument definition for an argument index.

Parameters:
index Argument index.
argdef A newly allocated argument definition


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x66.html0000644000175100017510000000731411320655045021450 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- f -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x62.html0000644000175100017510000000712011320655045021437 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- b -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/structExpressionName.html0000644000175100017510000002324211320655045022045 00000000000000 libqalculate-0.9.7: ExpressionName Struct Reference

ExpressionName Struct Reference

A name for an expression item (function, variable or unit). More...

#include <ExpressionItem.h>

List of all members.

Public Member Functions

 ExpressionName ()
 ExpressionName (string sname)
void operator= (const ExpressionName &ename)
bool operator== (const ExpressionName &ename) const
bool operator!= (const ExpressionName &ename) const

Public Attributes

bool abbreviation
 If the name is an abbreviation.
bool suffix
 If the name has a suffix. If set to true, the part of the name after an underscore should be treated as a suffix.
bool unicode
 If the name contains unicode characters.
bool plural
 If the name is in plural form.
bool reference
 If the name shall be used as a fixed reference. If this is set to true, the name will kept as it is in addition to translations of it.
bool avoid_input
 If the name is unsuitable for user input.
bool case_sensitive
 If the name is case sensitive. The default behavior is that abbreviations are case sensitive and other names are not.
string name
 The name.


Detailed Description

A name for an expression item (function, variable or unit).

An expression name has a text string representing a name and boolean values describing the names properties.


Constructor & Destructor Documentation

ExpressionName::ExpressionName (  ) 

Create an empty expression name. All properties are set to false.

ExpressionName::ExpressionName ( string  sname  ) 

Create an expression name. All properties are set to false, unless the name only has one character in which case abbreviation and case_sesnsitive is set to true.

Parameters:
sname The name.


The documentation for this struct was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classNumberPrefix-members.html0000644000175100017510000001415311320655045022725 00000000000000 libqalculate-0.9.7: Member List

NumberPrefix Member List

This is the complete list of members for NumberPrefix, including all inherited members.

l_name (defined in Prefix)Prefix [protected]
longName(bool return_short_if_no_long=true, bool use_unicode=false) const Prefix
name(bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const Prefix
NumberPrefix(const Number &nr, string long_name, string short_name="", string unicode_name="")NumberPrefix
o_number (defined in NumberPrefix)NumberPrefix [protected]
Prefix(string long_name, string short_name="", string unicode_name="")Prefix
s_name (defined in Prefix)Prefix [protected]
setLongName(string long_name)Prefix
setShortName(string short_name)Prefix
setUnicodeName(string unicode_name)Prefix
setValue(const Number &nr)NumberPrefix
shortName(bool return_long_if_no_short=true, bool use_unicode=false) const Prefix
type() const NumberPrefix [virtual]
u_name (defined in Prefix)Prefix [protected]
unicodeName(bool return_short_if_no_uni=true) const Prefix
value(const Number &nexp) const NumberPrefix [virtual]
value(int iexp) const NumberPrefix [virtual]
value() const NumberPrefix [virtual]
~NumberPrefix() (defined in NumberPrefix)NumberPrefix
~Prefix() (defined in Prefix)Prefix [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDecimalPrefix.png0000644000175100017510000000054211320655045021220 00000000000000PNG  IHDRZPkWPLTE`{tRNS@fIDATHA 9? jzh gGK=Og.czu9ρ/i7bͺi>dunN{ֵkNDFGub;2=e;뮻n@ ;/kZPaf6v\,ae{8kɘ$#JʴBm8'Q.5jYU"sE#bSmWU%T^N=IMn]M_sIENDB`libqalculate-0.9.7/docs/reference/html/MathStructure_8h.html0000644000175100017510000000631711320655045021055 00000000000000 libqalculate-0.9.7: libqalculate/MathStructure.h File Reference

libqalculate/MathStructure.h File Reference

#include <libqalculate/includes.h>
#include <libqalculate/Number.h>

Classes

class  MathStructure
 A structure representing a mathematical value/expression/result. More...

Enumerations

enum  StructureType {
  STRUCT_MULTIPLICATION, STRUCT_INVERSE, STRUCT_DIVISION, STRUCT_ADDITION,
  STRUCT_NEGATE, STRUCT_POWER, STRUCT_NUMBER, STRUCT_UNIT,
  STRUCT_SYMBOLIC, STRUCT_FUNCTION, STRUCT_VARIABLE, STRUCT_VECTOR,
  STRUCT_BITWISE_AND, STRUCT_BITWISE_OR, STRUCT_BITWISE_XOR, STRUCT_BITWISE_NOT,
  STRUCT_LOGICAL_AND, STRUCT_LOGICAL_OR, STRUCT_LOGICAL_XOR, STRUCT_LOGICAL_NOT,
  STRUCT_COMPARISON, STRUCT_UNDEFINED
}
 Types for MathStructure.
enum  { MULTIPLICATION_SIGN_NONE, MULTIPLICATION_SIGN_SPACE, MULTIPLICATION_SIGN_OPERATOR, MULTIPLICATION_SIGN_OPERATOR_SHORT }

Detailed Description


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classCalculatorMessage.html0000644000175100017510000001142111320655045022260 00000000000000 libqalculate-0.9.7: CalculatorMessage Class Reference

CalculatorMessage Class Reference

A message with information to the user. Primarily used for errors and warnings. More...

#include <Calculator.h>

List of all members.

Public Member Functions

 CalculatorMessage (string message_, MessageType type_=MESSAGE_WARNING)
 CalculatorMessage (const CalculatorMessage &e)
string message () const
const char * c_message () const
MessageType type () const

Protected Attributes

string smessage
MessageType mtype


Detailed Description

A message with information to the user. Primarily used for errors and warnings.
The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classIntegerArgument-members.html0000644000175100017510000002733111320655045023421 00000000000000 libqalculate-0.9.7: Member List

IntegerArgument Member List

This is the complete list of members for IntegerArgument, including all inherited members.

alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
copy() const IntegerArgument [virtual]
getCustomCondition() const Argument
imax (defined in IntegerArgument)IntegerArgument [protected]
imin (defined in IntegerArgument)IntegerArgument [protected]
IntegerArgument(string name_="", ArgumentMinMaxPreDefinition minmax=ARGUMENT_MIN_MAX_NONE, bool does_test=true, bool does_error=true) (defined in IntegerArgument)IntegerArgument
IntegerArgument(const IntegerArgument *arg) (defined in IntegerArgument)IntegerArgument
matrixAllowed() const (defined in Argument)Argument
max() const (defined in IntegerArgument)IntegerArgument
min() const (defined in IntegerArgument)IntegerArgument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const IntegerArgument [virtual]
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)IntegerArgument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setMax(const Number *nmax) (defined in IntegerArgument)IntegerArgument
setMin(const Number *nmin) (defined in IntegerArgument)IntegerArgument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
subprintlong() const IntegerArgument [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const IntegerArgument [protected, virtual]
suggestsQuotes() const (defined in Argument)Argument [virtual]
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const IntegerArgument [virtual]
zeroForbidden() const Argument
~Argument()Argument [virtual]
~IntegerArgument() (defined in IntegerArgument)IntegerArgument [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/structSortOptions.html0000644000175100017510000000605211320655045021410 00000000000000 libqalculate-0.9.7: SortOptions Struct Reference

SortOptions Struct Reference

Options for ordering the parts of a mathematical expression/result before display. More...

#include <includes.h>

List of all members.

Public Attributes

bool prefix_currencies
 Put currency units before quantity. Default: true.
bool minus_last
 If true, avoid placing negative terms first. Default: true.


Detailed Description

Options for ordering the parts of a mathematical expression/result before display.
The documentation for this struct was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/hierarchy.html0000644000175100017510000001060411320655045017614 00000000000000 libqalculate-0.9.7: Hierarchical Index
Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/structPlotParameters-members.html0000644000175100017510000001471311320655045023502 00000000000000 libqalculate-0.9.7: Member List
Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/Prefix_8h.html0000644000175100017510000000624511320655045017500 00000000000000 libqalculate-0.9.7: libqalculate/Prefix.h File Reference

libqalculate/Prefix.h File Reference

#include <libqalculate/includes.h>
#include <libqalculate/Number.h>

Classes

class  Prefix
 Abstract class for prefixes. More...
class  DecimalPrefix
 A decimal (metric) prefix. More...
class  BinaryPrefix
 A binary prefix. More...
class  NumberPrefix
 A prefix with a free numerical value. More...

Enumerations

enum  PrefixType { PREFIX_DECIMAL, PREFIX_BINARY, PREFIX_NUMBER }
 Types for prefix classes.

Detailed Description


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classArgumentSet.html0000644000175100017510000003063211320655045021125 00000000000000 libqalculate-0.9.7: ArgumentSet Class Reference

ArgumentSet Class Reference

A set of accepted arguments. More...

#include <Function.h>

Inheritance diagram for ArgumentSet:

Argument

List of all members.

Public Member Functions

 ArgumentSet (string name_="", bool does_test=true, bool does_error=true)
 ArgumentSet (const ArgumentSet *arg)
virtual int type () const
virtual Argumentcopy () const
virtual string print () const
void addArgument (Argument *arg)
void delArgument (size_t index)
size_t countArguments () const
ArgumentgetArgument (size_t index) const

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const

Protected Attributes

vector< Argument * > subargs


Detailed Description

A set of accepted arguments.

This is used when several different type of argments shall be accepted by a function.


Member Function Documentation

virtual bool ArgumentSet::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented from Argument.

virtual string ArgumentSet::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented from Argument.

virtual int ArgumentSet::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented from Argument.

virtual Argument* ArgumentSet::copy (  )  const [virtual]

Returns a copy of the argument definition.

Returns:
A copy.

Reimplemented from Argument.

virtual string ArgumentSet::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented from Argument.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions.html0000644000175100017510000001530011320655045017644 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- a -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classMathFunction-members.html0000644000175100017510000010075311320655045022720 00000000000000 libqalculate-0.9.7: Member List

MathFunction Member List

This is the complete list of members for MathFunction, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
appendDefaultValues(MathStructure &vargs) (defined in MathFunction)MathFunction
argc (defined in MathFunction)MathFunction [protected]
argdefs (defined in MathFunction)MathFunction [protected]
args() const MathFunction
args(const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)MathFunction
b_active (defined in ExpressionItem)ExpressionItem [protected]
b_approx (defined in ExpressionItem)ExpressionItem [protected]
b_builtin (defined in ExpressionItem)ExpressionItem [protected]
b_changed (defined in ExpressionItem)ExpressionItem [protected]
b_destroyed (defined in ExpressionItem)ExpressionItem [protected]
b_hidden (defined in ExpressionItem)ExpressionItem [protected]
b_local (defined in ExpressionItem)ExpressionItem [protected]
b_registered (defined in ExpressionItem)ExpressionItem [protected]
calculate(const string &eq, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunction [virtual]
calculate(MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunction [virtual]
calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)MathFunction [virtual]
category() const ExpressionItem [virtual]
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItem [virtual]
clearArgumentDefinitions()MathFunction
clearNames()ExpressionItem [virtual]
clearNonReferenceNames()ExpressionItem [virtual]
condition() const MathFunction
copy() const =0 (defined in MathFunction)MathFunction [pure virtual]
countNames() const (defined in ExpressionItem)ExpressionItem [virtual]
createFunctionMathStructureFromSVArgs(vector< string > &svargs) (defined in MathFunction)MathFunction [protected, virtual]
createFunctionMathStructureFromVArgs(const MathStructure &vargs) (defined in MathFunction)MathFunction [protected, virtual]
default_values (defined in MathFunction)MathFunction [protected]
description() const ExpressionItem [virtual]
destroy() (defined in ExpressionItem)ExpressionItem [virtual]
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
getArgumentDefinition(size_t index)MathFunction
getDefaultValue(size_t arg_) const (defined in MathFunction)MathFunction
getName(size_t index) const ExpressionItem [virtual]
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItem [virtual]
hasChanged() const ExpressionItem [virtual]
hasName(const string &sname, bool case_sensitive=true) const ExpressionItem [virtual]
hasNameCaseSensitive(const string &sname) const ExpressionItem [virtual]
i_precision (defined in ExpressionItem)ExpressionItem [protected]
i_ref (defined in ExpressionItem)ExpressionItem [protected]
isActive() const ExpressionItem [virtual]
isApproximate() const ExpressionItem [virtual]
isBuiltin() const (defined in ExpressionItem)ExpressionItem [virtual]
isHidden() const (defined in ExpressionItem)ExpressionItem [virtual]
isLocal() const (defined in ExpressionItem)ExpressionItem [virtual]
isRegistered() const (defined in ExpressionItem)ExpressionItem
last_argdef_index (defined in MathFunction)MathFunction [protected]
lastArgumentDefinitionIndex() const MathFunction
MathFunction(string name_, int argc_, int max_argc_=0, string cat_="", string title_="", string descr_="", bool is_active=true) (defined in MathFunction)MathFunction
MathFunction(const MathFunction *function) (defined in MathFunction)MathFunction
MathFunction() (defined in MathFunction)MathFunction
max_argc (defined in MathFunction)MathFunction [protected]
maxargs() const MathFunction
minargs() const MathFunction
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItem [virtual]
names (defined in ExpressionItem)ExpressionItem [protected]
parse(const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunction [virtual]
parse(MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunction [virtual]
precision() const ExpressionItem [virtual]
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
printCondition()MathFunction
produceArgumentsVector(const MathStructure &vargs, int begin=-1, int end=-1) (defined in MathFunction)MathFunction
produceVector(const MathStructure &vargs, int begin=-1, int end=-1) (defined in MathFunction)MathFunction
ref() (defined in ExpressionItem)ExpressionItem [virtual]
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
refcount() const ExpressionItem [virtual]
referenceName() const (defined in ExpressionItem)ExpressionItem [virtual]
removeName(size_t index) (defined in ExpressionItem)ExpressionItem [virtual]
representsBoolean(const MathStructure &) const (defined in MathFunction)MathFunction [virtual]
representsComplex(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsEven(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsInteger(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNonMatrix(const MathStructure &) const (defined in MathFunction)MathFunction [virtual]
representsNonNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNonPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNonZero(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNumber(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsOdd(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsRational(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsReal(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsUndefined(const MathStructure &) const (defined in MathFunction)MathFunction [virtual]
scat (defined in ExpressionItem)ExpressionItem [protected]
scondition (defined in MathFunction)MathFunction [protected]
sdescr (defined in ExpressionItem)ExpressionItem [protected]
set(const ExpressionItem *item) (defined in MathFunction)MathFunction [virtual]
setActive(bool is_active) (defined in ExpressionItem)ExpressionItem [virtual]
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItem [virtual]
setArgumentDefinition(size_t index, Argument *argdef)MathFunction
setCategory(string cat_)ExpressionItem [virtual]
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItem [virtual]
setCondition(string expression)MathFunction
setDefaultValue(size_t arg_, string value_) (defined in MathFunction)MathFunction
setDescription(string descr_)ExpressionItem [virtual]
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItem [virtual]
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItem [virtual]
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItem [virtual]
setName(string sname, size_t index, bool force=true)ExpressionItem [virtual]
setPrecision(int prec) (defined in ExpressionItem)ExpressionItem [virtual]
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItem [virtual]
stitle (defined in ExpressionItem)ExpressionItem [protected]
stringArgs(const string &str, vector< string > &svargs) (defined in MathFunction)MathFunction
subtype() const MathFunction [virtual]
testArgumentCount(int itmp) (defined in MathFunction)MathFunction
testArguments(MathStructure &vargs) (defined in MathFunction)MathFunction [protected]
testCondition(const MathStructure &vargs)MathFunction
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
type() const MathFunction [virtual]
unref() (defined in ExpressionItem)ExpressionItem [virtual]
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
v_refs (defined in ExpressionItem)ExpressionItem [protected]
~ExpressionItem() (defined in ExpressionItem)ExpressionItem [virtual]
~MathFunction() (defined in MathFunction)MathFunction [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classKnownVariable-members.html0000644000175100017510000006706611320655045023074 00000000000000 libqalculate-0.9.7: Member List

KnownVariable Member List

This is the complete list of members for KnownVariable, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
b_active (defined in ExpressionItem)ExpressionItem [protected]
b_approx (defined in ExpressionItem)ExpressionItem [protected]
b_builtin (defined in ExpressionItem)ExpressionItem [protected]
b_changed (defined in ExpressionItem)ExpressionItem [protected]
b_destroyed (defined in ExpressionItem)ExpressionItem [protected]
b_expression (defined in KnownVariable)KnownVariable [protected]
b_hidden (defined in ExpressionItem)ExpressionItem [protected]
b_local (defined in ExpressionItem)ExpressionItem [protected]
b_registered (defined in ExpressionItem)ExpressionItem [protected]
calculated_precision (defined in KnownVariable)KnownVariable [protected]
category() const ExpressionItem [virtual]
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItem [virtual]
clearNames()ExpressionItem [virtual]
clearNonReferenceNames()ExpressionItem [virtual]
copy() const (defined in KnownVariable)KnownVariable [virtual]
countNames() const (defined in ExpressionItem)ExpressionItem [virtual]
description() const ExpressionItem [virtual]
destroy() (defined in ExpressionItem)ExpressionItem [virtual]
expression() const KnownVariable [virtual]
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
get()KnownVariable [virtual]
getName(size_t index) const ExpressionItem [virtual]
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItem [virtual]
hasChanged() const ExpressionItem [virtual]
hasName(const string &sname, bool case_sensitive=true) const ExpressionItem [virtual]
hasNameCaseSensitive(const string &sname) const ExpressionItem [virtual]
i_precision (defined in ExpressionItem)ExpressionItem [protected]
i_ref (defined in ExpressionItem)ExpressionItem [protected]
isActive() const ExpressionItem [virtual]
isApproximate() const ExpressionItem [virtual]
isBuiltin() const (defined in ExpressionItem)ExpressionItem [virtual]
isExpression() const KnownVariable [virtual]
isHidden() const (defined in ExpressionItem)ExpressionItem [virtual]
isKnown() const KnownVariable [inline, virtual]
isLocal() const (defined in ExpressionItem)ExpressionItem [virtual]
isRegistered() const (defined in ExpressionItem)ExpressionItem
KnownVariable(string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable(string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable()KnownVariable
KnownVariable(const KnownVariable *variable)KnownVariable
mstruct (defined in KnownVariable)KnownVariable [protected]
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItem [virtual]
names (defined in ExpressionItem)ExpressionItem [protected]
precision() const ExpressionItem [virtual]
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
ref() (defined in ExpressionItem)ExpressionItem [virtual]
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
refcount() const ExpressionItem [virtual]
referenceName() const (defined in ExpressionItem)ExpressionItem [virtual]
removeName(size_t index) (defined in ExpressionItem)ExpressionItem [virtual]
representsBoolean() (defined in KnownVariable)KnownVariable [virtual]
representsComplex(bool=false) (defined in KnownVariable)KnownVariable [virtual]
representsEven(bool=false) (defined in KnownVariable)KnownVariable [virtual]
representsInteger(bool=false) (defined in KnownVariable)KnownVariable [virtual]
representsNegative(bool=false) (defined in KnownVariable)KnownVariable [virtual]
representsNonMatrix() (defined in KnownVariable)KnownVariable [virtual]
representsNonNegative(bool=false) (defined in KnownVariable)KnownVariable [virtual]
representsNonPositive(bool=false) (defined in KnownVariable)KnownVariable [virtual]
representsNonZero(bool=false) (defined in KnownVariable)KnownVariable [virtual]
representsNumber(bool=false) (defined in KnownVariable)KnownVariable [virtual]
representsOdd(bool=false) (defined in KnownVariable)KnownVariable [virtual]
representsPositive(bool=false)KnownVariable [virtual]
representsRational(bool=false) (defined in KnownVariable)KnownVariable [virtual]
representsReal(bool=false) (defined in KnownVariable)KnownVariable [virtual]
representsUndefined(bool=false, bool=false, bool=false) (defined in KnownVariable)KnownVariable [virtual]
scat (defined in ExpressionItem)ExpressionItem [protected]
sdescr (defined in ExpressionItem)ExpressionItem [protected]
set(const ExpressionItem *item) (defined in KnownVariable)KnownVariable [virtual]
set(const MathStructure &o)KnownVariable [virtual]
set(string expression_)KnownVariable [virtual]
setActive(bool is_active) (defined in ExpressionItem)ExpressionItem [virtual]
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItem [virtual]
setCategory(string cat_)ExpressionItem [virtual]
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItem [virtual]
setDescription(string descr_)ExpressionItem [virtual]
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItem [virtual]
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItem [virtual]
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItem [virtual]
setName(string sname, size_t index, bool force=true)ExpressionItem [virtual]
setPrecision(int prec) (defined in ExpressionItem)ExpressionItem [virtual]
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItem [virtual]
sexpression (defined in KnownVariable)KnownVariable [protected]
stitle (defined in ExpressionItem)ExpressionItem [protected]
subtype() const KnownVariable [inline, virtual]
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
type() const Variable [inline, virtual]
unref() (defined in ExpressionItem)ExpressionItem [virtual]
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
v_refs (defined in ExpressionItem)ExpressionItem [protected]
Variable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Variable)Variable
Variable() (defined in Variable)Variable
Variable(const Variable *variable) (defined in Variable)Variable
~ExpressionItem() (defined in ExpressionItem)ExpressionItem [virtual]
~KnownVariable() (defined in KnownVariable)KnownVariable [virtual]
~Variable() (defined in Variable)Variable [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x6e.html0000644000175100017510000001112011320655045020502 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- n -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classArgument.html0000644000175100017510000013050711320655045020453 00000000000000 libqalculate-0.9.7: Argument Class Reference

Argument Class Reference

A mathematical function argument definition with free value and base class for all argument definitions. More...

#include <Function.h>

Inheritance diagram for Argument:

ArgumentSet BooleanArgument DataObjectArgument DataPropertyArgument DateArgument ExpressionItemArgument FunctionArgument IntegerArgument MatrixArgument NumberArgument SymbolicArgument TextArgument VectorArgument

List of all members.

Public Member Functions

 Argument (string name_="", bool does_test=true, bool does_error=true)
 Argument (const Argument *arg)
virtual ~Argument ()
virtual void set (const Argument *arg)
virtual Argumentcopy () const
virtual string print () const
string printlong () const
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
string name () const
void setName (string name_)
void setCustomCondition (string condition)
string getCustomCondition () const
bool tests () const
void setTests (bool does_error)
bool alerts () const
void setAlerts (bool does_error)
bool zeroForbidden () const
void setZeroForbidden (bool forbid_zero)
bool matrixAllowed () const
void setMatrixAllowed (bool allow_matrix)
bool rationalPolynomial () const
void setRationalPolynomial (bool rational_polynomial)
virtual bool suggestsQuotes () const
virtual int type () const

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const

Protected Attributes

string sname
string scondition
bool b_zero
bool b_test
bool b_matrix
bool b_text
bool b_error
bool b_rational


Detailed Description

A mathematical function argument definition with free value and base class for all argument definitions.

Free arguments accepts any value.


Constructor & Destructor Documentation

Argument::Argument ( string  name_ = "",
bool  does_test = true,
bool  does_error = true 
)

Creates a new argument definition.

Parameters:
name Name/title of the argument definition.
does_test If argument values will be tested.
does_error If an error will issued if the value tests false.

Argument::Argument ( const Argument arg  ) 

Creates a copy of an argument definition.

Parameters:
arg Argument to copy.

virtual Argument::~Argument (  )  [virtual]

Destructor


Member Function Documentation

virtual bool Argument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented in DataPropertyArgument, DataObjectArgument, NumberArgument, IntegerArgument, SymbolicArgument, TextArgument, DateArgument, VectorArgument, MatrixArgument, ExpressionItemArgument, FunctionArgument, BooleanArgument, and ArgumentSet.

virtual string Argument::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented in DataPropertyArgument, DataObjectArgument, NumberArgument, IntegerArgument, SymbolicArgument, TextArgument, DateArgument, VectorArgument, MatrixArgument, ExpressionItemArgument, FunctionArgument, BooleanArgument, and ArgumentSet.

virtual void Argument::set ( const Argument arg  )  [virtual]

Sets the argument to a copy of an argument definition.

Parameters:
arg Argument to copy.

Reimplemented in NumberArgument, and IntegerArgument.

virtual Argument* Argument::copy (  )  const [virtual]

virtual string Argument::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented in DataPropertyArgument, DataObjectArgument, NumberArgument, IntegerArgument, SymbolicArgument, TextArgument, DateArgument, VectorArgument, MatrixArgument, ExpressionItemArgument, FunctionArgument, BooleanArgument, and ArgumentSet.

string Argument::printlong (  )  const

Resturns a long description of the argument definition. Ex. "A real number > 2".

Returns:
Long description.

bool Argument::test ( MathStructure value,
int  index,
MathFunction f,
const EvaluationOptions eo = default_evaluation_options 
) const

Tests if a value fulfils the requirements of the argument definition. The value might change if it has not been fully evaluated.

Parameters:
value Value to test.
f Mathematical function that the value is an argument for.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

virtual MathStructure Argument::parse ( const string &  str,
const ParseOptions po = default_parse_options 
) const [virtual]

Parses an expression for an argument value. The default behavior is to use Calculator::parse() directly.

Parameters:
str Expression.
po Parse options.
Returns:
A new mathematical structure with the parsed expression.

virtual void Argument::parse ( MathStructure mstruct,
const string &  str,
const ParseOptions po = default_parse_options 
) const [virtual]

Parses an expression for an argument value. The default behavior is to use Calculator::parse() directly.

Parameters:
mstruct Mathematical structure to set with the parsed expression.
str Expression.
po Parse options.

string Argument::name (  )  const

Returns the name/title of the argument definition.

Returns:
Name/title.

void Argument::setName ( string  name_  ) 

Sets the name/title of the argument definition.

Parameters:
name_ New name/title.

void Argument::setCustomCondition ( string  condition  ) 

Sets a custom condition for argument values. '' is replaced by the argument value in the expression.

Parameters:
condition Condition expression.

string Argument::getCustomCondition (  )  const

Returns the custom condition expression set for argument values.

Returns:
Custom condition for argument values.

bool Argument::tests (  )  const

If the value for the argument will be tested. If not, the argument only works as an suggestion and any value is allowed.

Returns:
true if the argument value will be tested.

bool Argument::alerts (  )  const

If an error message will be presented to the user if the value for the argument is not allowed.

Returns:
true if error messages will be shown.

bool Argument::zeroForbidden (  )  const

If an argument value of zero is forbidden.

Returns:
true if zero argument value is forbidden.

void Argument::setZeroForbidden ( bool  forbid_zero  ) 

Sets if a value of zero is forbidden for the argument value.

Parameters:
forbid_zero If zero shall be forbidden.

bool Argument::rationalPolynomial (  )  const

If only rational polynomials are allowed as argument value.

See also:
MathStructure::isRationalPolynomial()
Returns:
true if only rational polynomials is allowed.

virtual int Argument::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented in DataPropertyArgument, DataObjectArgument, NumberArgument, IntegerArgument, SymbolicArgument, TextArgument, DateArgument, VectorArgument, MatrixArgument, ExpressionItemArgument, FunctionArgument, BooleanArgument, and ArgumentSet.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classAliasUnit.png0000644000175100017510000000114611320655045020376 00000000000000PNG  IHDR~0ʾPLTE`{tRNS@fIDATh]r `x,A;-!QD3:Vʪ>L.+cx=<Ⱥ*Z rnptptqOT6<6g]く+z|2j-Gr9`9_S/^xY=ҭ}ۈ>~g-}}u/Gz/^0W Oo5Fs'7{ͦjk=(mo-Tq)`baJנ9/_~~~Oxŋ?┯:Ⱥ}R~ci>3ѵ\Pٍűb',1r-|fٗ>3ď'LɓKDxs.S 7ϞU~~RY?[]OuB<#a~a[QIENDB`libqalculate-0.9.7/docs/reference/html/classDataPropertyArgument.html0000644000175100017510000002771611320655045023021 00000000000000 libqalculate-0.9.7: DataPropertyArgument Class Reference

DataPropertyArgument Class Reference

Data property function argument. More...

#include <DataSet.h>

Inheritance diagram for DataPropertyArgument:

Argument

List of all members.

Public Member Functions

 DataPropertyArgument (DataSet *data_set, string name_="", bool does_test=true, bool does_error=true)
 DataPropertyArgument (const DataPropertyArgument *arg)
int type () const
Argumentcopy () const
string print () const
DataSetdataSet () const
void setDataSet (DataSet *data_set)

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const

Protected Attributes

DataSeto_data


Detailed Description

Data property function argument.

Member Function Documentation

virtual bool DataPropertyArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented from Argument.

virtual string DataPropertyArgument::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented from Argument.

int DataPropertyArgument::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented from Argument.

Argument* DataPropertyArgument::copy (  )  const [virtual]

Returns a copy of the argument definition.

Returns:
A copy.

Reimplemented from Argument.

string DataPropertyArgument::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented from Argument.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x6f.html0000644000175100017510000000724611320655045020521 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- o -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x63.html0000644000175100017510000002222111320655045020424 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- c -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x76.html0000644000175100017510000001004411320655045021443 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- v -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classCalculator.html0000644000175100017510000112345111320655045020763 00000000000000 libqalculate-0.9.7: Calculator Class Reference

Calculator Class Reference

The almighty calculator class. More...

#include <Calculator.h>

List of all members.

Public Member Functions

Constructor


 Calculator ()
virtual ~Calculator ()
Functions for calculating expressions.


bool calculate (MathStructure *mstruct, string str, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)
MathStructure calculate (string str, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)
string printMathStructureTimeOut (const MathStructure &mstruct, int msecs=100000, const PrintOptions &op=default_print_options)
int testCondition (string expression)
Functions for handling of threaded calculations


void abort ()
void abort_this ()
bool busy ()
void saveState ()
void restoreState ()
void clearBuffers ()
void terminateThreads ()
Functions for manipulation of the RPN stack.


bool calculateRPNRegister (size_t index, int msecs, const EvaluationOptions &eo=default_evaluation_options)
bool calculateRPN (MathOperation op, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
bool calculateRPN (MathFunction *f, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
bool calculateRPNBitwiseNot (int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
bool calculateRPNLogicalNot (int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
MathStructurecalculateRPN (MathOperation op, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
MathStructurecalculateRPN (MathFunction *f, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
MathStructurecalculateRPNBitwiseNot (const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
MathStructurecalculateRPNLogicalNot (const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
bool RPNStackEnter (MathStructure *mstruct, int msecs, const EvaluationOptions &eo=default_evaluation_options)
bool RPNStackEnter (string str, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)
void RPNStackEnter (MathStructure *mstruct, bool eval=false, const EvaluationOptions &eo=default_evaluation_options)
void RPNStackEnter (string str, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)
bool setRPNRegister (size_t index, MathStructure *mstruct, int msecs, const EvaluationOptions &eo=default_evaluation_options)
bool setRPNRegister (size_t index, string str, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)
void setRPNRegister (size_t index, MathStructure *mstruct, bool eval=false, const EvaluationOptions &eo=default_evaluation_options)
void setRPNRegister (size_t index, string str, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)
void deleteRPNRegister (size_t index)
MathStructuregetRPNRegister (size_t index=1) const
size_t RPNStackSize () const
void clearRPNStack ()
void moveRPNRegister (size_t old_index, size_t new_index)
void moveRPNRegisterUp (size_t index)
void moveRPNRegisterDown (size_t index)
Functions for expression parsing.


string localizeExpression (string str) const
string unlocalizeExpression (string str, const ParseOptions &po=default_parse_options) const
bool separateToExpression (string &str, string &to_str, const EvaluationOptions &eo) const
void parseSigns (string &str) const
MathStructure parse (string str, const ParseOptions &po=default_parse_options)
void parse (MathStructure *mstruct, string str, const ParseOptions &po=default_parse_options)
bool parseNumber (MathStructure *mstruct, string str, const ParseOptions &po=default_parse_options)
bool parseOperators (MathStructure *mstruct, string str, const ParseOptions &po=default_parse_options)
bool parseAdd (string &str, MathStructure *mstruct, const ParseOptions &po, MathOperation s)
bool parseAdd (string &str, MathStructure *mstruct, const ParseOptions &po)
Functions converting epxressions between units.


MathStructure convert (const MathStructure &mstruct, string composite_, const EvaluationOptions &eo=default_evaluation_options)
MathStructure convert (const MathStructure &mstruct, Unit *to_unit, const EvaluationOptions &eo=default_evaluation_options, bool always_convert=true)
MathStructure convert (double value, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo=default_evaluation_options)
MathStructure convert (string str, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo=default_evaluation_options)
MathStructure convertToBaseUnits (const MathStructure &mstruct, const EvaluationOptions &eo=default_evaluation_options)
UnitgetBestUnit (Unit *u, bool allow_only_div=false)
MathStructure convertToBestUnit (const MathStructure &mstruct, const EvaluationOptions &eo=default_evaluation_options)
MathStructure convertToCompositeUnit (const MathStructure &mstruct, CompositeUnit *cu, const EvaluationOptions &eo=default_evaluation_options, bool always_convert=true)
Functions for default assumptions for unknown variables and symbols


void setDefaultAssumptions (Assumptions *ass)
AssumptionsdefaultAssumptions ()
Functions for retrieval of angle units


UnitgetGraUnit ()
UnitgetRadUnit ()
UnitgetDegUnit ()
Functions for finding a suitable prefix.


DecimalPrefixgetExactDecimalPrefix (int exp10, int exp=1) const
BinaryPrefixgetExactBinaryPrefix (int exp2, int exp=1) const
PrefixgetExactPrefix (const Number &o, int exp=1) const
DecimalPrefixgetNearestDecimalPrefix (int exp10, int exp=1) const
DecimalPrefixgetBestDecimalPrefix (int exp10, int exp=1, bool all_prefixes=true) const
DecimalPrefixgetBestDecimalPrefix (const Number &exp10, const Number &exp, bool all_prefixes=true) const
BinaryPrefixgetNearestBinaryPrefix (int exp2, int exp=1) const
BinaryPrefixgetBestBinaryPrefix (int exp2, int exp=1) const
BinaryPrefixgetBestBinaryPrefix (const Number &exp2, const Number &exp) const
PrefixaddPrefix (Prefix *p)
void prefixNameChanged (Prefix *p, bool new_item=false)
Functions for managing functions, variables, units, prefixes and data sets.


void expressionItemActivated (ExpressionItem *item)
void expressionItemDeactivated (ExpressionItem *item)
void expressionItemDeleted (ExpressionItem *item)
void nameChanged (ExpressionItem *item, bool new_item=false)
void deleteName (string name_, ExpressionItem *object=NULL)
void deleteUnitName (string name_, Unit *object=NULL)
UnitaddUnit (Unit *u, bool force=true, bool check_names=true)
void delPrefixUFV (Prefix *object)
void delUFV (ExpressionItem *object)
bool hasVariable (Variable *v)
bool hasUnit (Unit *u)
bool hasFunction (MathFunction *f)
bool stillHasVariable (Variable *v)
bool stillHasUnit (Unit *u)
bool stillHasFunction (MathFunction *f)
void saveFunctionCalled ()
bool checkSaveFunctionCalled ()
ExpressionItemgetActiveExpressionItem (string name, ExpressionItem *item=NULL)
ExpressionItemgetInactiveExpressionItem (string name, ExpressionItem *item=NULL)
ExpressionItemgetActiveExpressionItem (ExpressionItem *item)
ExpressionItemgetExpressionItem (string name, ExpressionItem *item=NULL)
UnitgetUnit (string name_)
UnitgetActiveUnit (string name_)
UnitgetCompositeUnit (string internal_name_)
PrefixgetPrefix (size_t index) const
PrefixgetPrefix (string name_) const
VariableaddVariable (Variable *v, bool force=true, bool check_names=true)
void variableNameChanged (Variable *v, bool new_item=false)
void functionNameChanged (MathFunction *f, bool new_item=false)
void unitNameChanged (Unit *u, bool new_item=false)
VariablegetVariable (string name_)
VariablegetActiveVariable (string name_)
ExpressionItemaddExpressionItem (ExpressionItem *item, bool force=true)
MathFunctionaddFunction (MathFunction *f, bool force=true, bool check_names=true)
DataSetaddDataSet (DataSet *dc, bool force=true, bool check_names=true)
DataSetgetDataSet (size_t index)
DataSetgetDataSet (string name)
MathFunctiongetFunction (string name_)
MathFunctiongetActiveFunction (string name_)
VariablegetVariable (size_t index) const
UnitgetUnit (size_t index) const
MathFunctiongetFunction (size_t index) const
bool unitIsUsedByOtherUnits (const Unit *u) const
Functions for handling of builtin expression items


void resetVariables ()
void resetFunctions ()
void resetUnits ()
void reset ()
void addBuiltinVariables ()
void addBuiltinFunctions ()
void addBuiltinUnits ()
Functions for testing validity of functions, variable and unit names.


bool variableNameIsValid (const string &name_)
bool variableNameIsValid (const char *name_)
bool variableNameIsValid (const char *name_, int version_numbers[3], bool is_user_defs)
bool variableNameIsValid (const string &name_, int version_numbers[3], bool is_user_defs)
string convertToValidVariableName (string name_)
bool functionNameIsValid (const string &name_)
bool functionNameIsValid (const char *name_)
bool functionNameIsValid (const char *name_, int version_numbers[3], bool is_user_defs)
bool functionNameIsValid (const string &name_, int version_numbers[3], bool is_user_defs)
string convertToValidFunctionName (string name_)
bool unitNameIsValid (const string &name_)
bool unitNameIsValid (const char *name_)
bool unitNameIsValid (const char *name_, int version_numbers[3], bool is_user_defs)
bool unitNameIsValid (const string &name_, int version_numbers[3], bool is_user_defs)
bool utf8_pos_is_valid_in_name (char *pos)
string convertToValidUnitName (string name_)
bool nameTaken (string name, ExpressionItem *object=NULL)
bool variableNameTaken (string name, Variable *object=NULL)
bool unitNameTaken (string name, Unit *object=NULL)
bool functionNameTaken (string name, MathFunction *object=NULL)
string getName (string name="", ExpressionItem *object=NULL, bool force=false, bool always_append=false)
Functions for message handling.


void error (bool critical, const char *TEMPLATE,...)
void message (MessageType mtype, const char *TEMPLATE,...)
CalculatorMessagemessage ()
CalculatorMessagenextMessage ()
bool showArgumentErrors () const
void beginTemporaryStopMessages ()
int endTemporaryStopMessages (int *message_count=NULL, int *warning_count=NULL)
Functions for loading and saving definitions (variables, functions, units, etc.).


bool loadGlobalDefinitions ()
bool loadGlobalDefinitions (string filename)
bool loadGlobalPrefixes ()
bool loadGlobalCurrencies ()
bool loadGlobalUnits ()
bool loadGlobalVariables ()
bool loadGlobalFunctions ()
bool loadGlobalDataSets ()
bool loadLocalDefinitions ()
int loadDefinitions (const char *file_name, bool is_user_defs=true)
bool saveDefinitions ()
int saveDataObjects ()
int savePrefixes (const char *file_name, bool save_global=false)
int saveVariables (const char *file_name, bool save_global=false)
int saveUnits (const char *file_name, bool save_global=false)
int saveFunctions (const char *file_name, bool save_global=false)
int saveDataSets (const char *file_name, bool save_global=false)
Functions for CSV file import/export.


bool importCSV (MathStructure &mstruct, const char *file_name, int first_row=1, string delimiter=",", vector< string > *headers=NULL)
bool importCSV (const char *file_name, int first_row=1, bool headers=true, string delimiter=",", bool to_matrix=false, string name="", string title="", string category="")
bool exportCSV (const MathStructure &mstruct, const char *file_name, string delimiter=",")
Functions for exchange rates.


bool canFetch ()
bool hasGnomeVFS ()
bool loadExchangeRates ()
string getExchangeRatesFileName ()
string getExchangeRatesUrl ()
bool fetchExchangeRates (int timeout, string wget_args)
bool fetchExchangeRates (int timeout=15)
bool checkExchangeRatesDate ()
Functions for plotting


bool canPlot ()
MathStructure expressionToPlotVector (string expression, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector=NULL, string x_var="\\x", const ParseOptions &po=default_parse_options)
MathStructure expressionToPlotVector (string expression, float min, float max, int steps, MathStructure *x_vector=NULL, string x_var="\\x", const ParseOptions &po=default_parse_options)
MathStructure expressionToPlotVector (string expression, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector=NULL, string x_var="\\x", const ParseOptions &po=default_parse_options)
MathStructure expressionToPlotVector (string expression, float min, float max, float step, MathStructure *x_vector=NULL, string x_var="\\x", const ParseOptions &po=default_parse_options)
MathStructure expressionToPlotVector (string expression, const MathStructure &x_vector, string x_var="\\x", const ParseOptions &po=default_parse_options)
bool plotVectors (PlotParameters *param, const vector< MathStructure > &y_vectors, const vector< MathStructure > &x_vectors, vector< PlotDataParameters * > &pdps, bool persistent=false)
bool invokeGnuplot (string commands, string commandline_extra="", bool persistent=false)
bool closeGnuplot ()
bool gnuplotOpen ()
Functions for global precision


void setPrecision (int precision=DEFAULT_PRECISION)
int getPrecision () const
Functions for localization


const string & getDecimalPoint () const
const string & getComma () const
void setLocale ()
void useDecimalComma ()
void useDecimalPoint ()
void unsetLocale ()
string localToString () const
Functions adding alternative symbols for operators and such


void addStringAlternative (string replacement, string standard)
bool delStringAlternative (string replacement, string standard)
void addDefaultStringAlternative (string replacement, string standard)
bool delDefaultStringAlternative (string replacement, string standard)
Functions for storing values with associated identifiers


size_t addId (MathStructure *mstruct, bool persistent=false)
size_t parseAddId (MathFunction *f, const string &str, const ParseOptions &po, bool persistent=false)
size_t parseAddIdAppend (MathFunction *f, const MathStructure &append_mstruct, const string &str, const ParseOptions &po, bool persistent=false)
size_t parseAddVectorId (const string &str, const ParseOptions &po, bool persistent=false)
MathStructuregetId (size_t id)
void delId (size_t id)

Public Attributes

KnownVariablev_pi
KnownVariablev_e
KnownVariablev_i
KnownVariablev_inf
KnownVariablev_pinf
KnownVariablev_minf
KnownVariablev_undef
UnknownVariablev_x
UnknownVariablev_y
UnknownVariablev_z
MathFunctionf_vector
MathFunctionf_sort
MathFunctionf_rank
MathFunctionf_limits
MathFunctionf_component
MathFunctionf_dimension
MathFunctionf_merge_vectors
MathFunctionf_matrix
MathFunctionf_matrix_to_vector
MathFunctionf_area
MathFunctionf_rows
MathFunctionf_columns
MathFunctionf_row
MathFunctionf_column
MathFunctionf_elements
MathFunctionf_element
MathFunctionf_transpose
MathFunctionf_identity
MathFunctionf_determinant
MathFunctionf_permanent
MathFunctionf_adjoint
MathFunctionf_cofactor
MathFunctionf_inverse
MathFunctionf_factorial
MathFunctionf_factorial2
MathFunctionf_multifactorial
MathFunctionf_binomial
MathFunctionf_xor
MathFunctionf_bitxor
MathFunctionf_even
MathFunctionf_odd
MathFunctionf_shift
MathFunctionf_abs
MathFunctionf_gcd
MathFunctionf_lcm
MathFunctionf_signum
MathFunctionf_round
MathFunctionf_floor
MathFunctionf_ceil
MathFunctionf_trunc
MathFunctionf_int
MathFunctionf_frac
MathFunctionf_rem
MathFunctionf_mod
MathFunctionf_polynomial_unit
MathFunctionf_polynomial_primpart
MathFunctionf_polynomial_content
MathFunctionf_coeff
MathFunctionf_lcoeff
MathFunctionf_tcoeff
MathFunctionf_degree
MathFunctionf_ldegree
MathFunctionf_re
MathFunctionf_im
MathFunctionf_arg
MathFunctionf_numerator
MathFunctionf_denominator
MathFunctionf_sqrt
MathFunctionf_sq
MathFunctionf_exp
MathFunctionf_ln
MathFunctionf_logn
MathFunctionf_lambert_w
MathFunctionf_sin
MathFunctionf_cos
MathFunctionf_tan
MathFunctionf_asin
MathFunctionf_acos
MathFunctionf_atan
MathFunctionf_sinh
MathFunctionf_cosh
MathFunctionf_tanh
MathFunctionf_asinh
MathFunctionf_acosh
MathFunctionf_atanh
MathFunctionf_radians_to_default_angle_unit
MathFunctionf_zeta
MathFunctionf_gamma
MathFunctionf_beta
MathFunctionf_total
MathFunctionf_percentile
MathFunctionf_min
MathFunctionf_max
MathFunctionf_mode
MathFunctionf_rand
MathFunctionf_isodate
MathFunctionf_localdate
MathFunctionf_timestamp
MathFunctionf_stamptodate
MathFunctionf_days
MathFunctionf_yearfrac
MathFunctionf_week
MathFunctionf_weekday
MathFunctionf_month
MathFunctionf_day
MathFunctionf_year
MathFunctionf_yearday
MathFunctionf_time
MathFunctionf_add_days
MathFunctionf_add_months
MathFunctionf_add_years
MathFunctionf_bin
MathFunctionf_oct
MathFunctionf_hex
MathFunctionf_base
MathFunctionf_roman
MathFunctionf_ascii
MathFunctionf_char
MathFunctionf_length
MathFunctionf_concatenate
MathFunctionf_replace
MathFunctionf_stripunits
MathFunctionf_genvector
MathFunctionf_for
MathFunctionf_sum
MathFunctionf_product
MathFunctionf_process
MathFunctionf_process_matrix
MathFunctionf_csum
MathFunctionf_if
MathFunctionf_is_number
MathFunctionf_is_real
MathFunctionf_is_rational
MathFunctionf_is_integer
MathFunctionf_represents_number
MathFunctionf_represents_real
MathFunctionf_represents_rational
MathFunctionf_represents_integer
MathFunctionf_function
MathFunctionf_select
MathFunctionf_diff
MathFunctionf_integrate
MathFunctionf_solve
MathFunctionf_multisolve
MathFunctionf_error
MathFunctionf_warning
MathFunctionf_message
MathFunctionf_save
MathFunctionf_load
MathFunctionf_export
MathFunctionf_title
MathFunctionf_register
MathFunctionf_stack
MathFunctionf_uncertainty
Unitu_rad
Unitu_gra
Unitu_deg
Unitu_euro
DecimalPrefixdecimal_null_prefix
BinaryPrefixbinary_null_prefix
bool place_currency_code_before
bool place_currency_sign_before
bool place_currency_code_before_negative
bool place_currency_sign_before_negative
bool default_dot_as_separator
bool b_busy
bool calculate_thread_stopped
bool print_thread_stopped
string expression_to_calculate
string tmp_print_result
PrintOptions tmp_printoptions
EvaluationOptions tmp_evaluationoptions
MathStructuretmp_parsedstruct
MathStructuretmp_tostruct
MathStructuretmp_rpn_mstruct
bool tmp_maketodivision
int tmp_proc_command
size_t tmp_rpnindex
PrintOptions save_printoptions
vector< Variable * > variables
vector< MathFunction * > functions
vector< Unit * > units
vector< Prefix * > prefixes
vector< DecimalPrefix * > decimal_prefixes
vector< BinaryPrefix * > binary_prefixes

Protected Member Functions

bool calculateRPN (MathStructure *mstruct, int command, size_t index, int msecs, const EvaluationOptions &eo)
bool calculateRPN (string str, int command, size_t index, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division)

Protected Attributes

vector< CalculatorMessagemessages
int ianglemode
int i_precision
char vbuffer [200]
vector< void * > ufvl
vector< char > ufvl_t
vector< size_t > ufvl_i
vector< void * > ufv [4][UFV_LENGTHS]
vector< size_t > ufv_i [4][UFV_LENGTHS]
vector< DataSet * > data_sets
Sgi::hash_map< size_t,
MathStructure * > 
id_structs
Sgi::hash_map< size_t, bool > ids_p
vector< size_t > freed_ids
size_t ids_i
vector< string > signs
vector< string > real_signs
vector< string > default_signs
vector< string > default_real_signs
char * saved_locale
int disable_errors_ref
vector< int > stopped_errors_count
vector< int > stopped_warnings_count
vector< int > stopped_messages_count
pthread_t calculate_thread
pthread_attr_t calculate_thread_attr
pthread_t print_thread
pthread_attr_t print_thread_attr
bool b_functions_was
bool b_variables_was
bool b_units_was
bool b_unknown_was
bool b_calcvars_was
bool b_rpn_was
string NAME_NUMBER_PRE_S
string NAME_NUMBER_PRE_STR
string DOT_STR
string DOT_S
string COMMA_S
string COMMA_STR
string ILLEGAL_IN_NAMES
string ILLEGAL_IN_UNITNAMES
string ILLEGAL_IN_NAMES_MINUS_SPACE_STR
bool b_argument_errors
bool exchange_rates_warning_issued
int has_gnomevfs
bool b_gnuplot_open
string gnuplot_cmdline
FILE * gnuplot_pipe
FILE * calculate_pipe_r
FILE * calculate_pipe_w
FILE * print_pipe_r
FILE * print_pipe_w
bool local_to
Assumptionsdefault_assumptions
vector< Variable * > deleted_variables
vector< MathFunction * > deleted_functions
vector< Unit * > deleted_units
bool b_save_called
string per_str
string times_str
string plus_str
string minus_str
string and_str
string AND_str
string or_str
string OR_str
string XOR_str
size_t per_str_len
size_t times_str_len
size_t plus_str_len
size_t minus_str_len
size_t and_str_len
size_t AND_str_len
size_t or_str_len
size_t OR_str_len
size_t XOR_str_len
vector< MathStructure * > rpn_stack


Detailed Description

The almighty calculator class.

The calculator class is responsible for loading functions, variables and units, and keeping track of them, as well as parsing expressions and much more. A calculator object must be created before any other Qalculate! class is used. There should never be more than one calculator object, accessed with CALCULATOR.

A simple application using libqalculate need only create a calculator object, perhaps load definitions (functions, variables, units, etc.) and use the calculate function as follows:

 new Calculator();
 CALCULATOR->loadGlobalDefinitions();
 CALCULATOR->loadLocalDefinitions();
 MathStructure result = CALCULATOR->calculate("1 + 1");

Member Function Documentation

bool Calculator::calculate ( MathStructure mstruct,
string  str,
int  msecs,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL,
MathStructure to_struct = NULL,
bool  make_to_division = true 
)

Calculates an expression. The expression should be unlocalized first with unlocalizeExpression(). This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters:
[out] mstruct Math structure to fill with the result.
str Expression.
msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eo Options for the evaluation and parsing of the expression.
[out] parsed_struct NULL or a math structure to fill with the result of the parsing of the expression.
[out] to_struct NULL or a math structure to fill with unit expression parsed after "to".
make_to_division If true, the expression after "to" will be interpreted as a unit epxression to convert the result to.
Returns:
true if the calculation was successfully started (and finished if msecs > 0).

MathStructure Calculator::calculate ( string  str,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL,
MathStructure to_struct = NULL,
bool  make_to_division = true 
)

Calculates an expression. The expression should be unlocalized first with unlocalizeExpression().

Parameters:
str Expression.
eo Options for the evaluation and parsing of the expression.
[out] parsed_struct NULL or a math structure to fill with the result of the parsing of the expression.
[out] to_struct NULL or a math structure to fill with unit expression parsed after "to".
make_to_division If true, the expression after "to" will be interpreted as a unit epxression to convert the result to.
Returns:
The result of the calculation.

void Calculator::abort (  ) 

Aborts the current calculation.

void Calculator::abort_this (  ) 

Aborts the current calculation. Used from within the calculation thread.

bool Calculator::busy (  ) 

Returns true if the calculate or print thread is busy.

void Calculator::saveState (  ) 

Saves the state of the calculator. Used internally to be able to restore the state after aborted calculation.

void Calculator::restoreState (  ) 

Restores the saved state of the calculator. Used internally to restore the state after aborted calculation.

void Calculator::clearBuffers (  ) 

Clears all stored values. Used internally after aborted calculation.

void Calculator::terminateThreads (  ) 

Terminate calculation and print threads if started. Do not use to terminate calculation.

bool Calculator::calculateRPNRegister ( size_t  index,
int  msecs,
const EvaluationOptions eo = default_evaluation_options 
)

Evaluates a value on the RPN stack. This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters:
index Index, starting at 1, on the RPN stack.
msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eo Options for the evaluation and parsing of the expression.
Returns:
true if the calculation was successfully started (and finished if msecs > 0).

bool Calculator::calculateRPN ( MathOperation  op,
int  msecs,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies a mathematical operation to the first and second value on the RPN stack. The the second value is changed with input from the first value. For example, with OPERATION_SUBTRACT the first value is subtracted from the second. The first value on the stack is removed. If not enough registers is available, then zeros are added. This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters:
op Operation.
msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eo Options for the evaluation and parsing of the expression.
[out] parsed_struct NULL or a math structure to fill with the unevaluated result.
Returns:
true if the calculation was successfully started (and finished if msecs > 0).

bool Calculator::calculateRPN ( MathFunction f,
int  msecs,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies a mathematical operation to the first value on the RPN stack. The value is set as the first argument of the function. If no register is available, then zero is added. This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters:
f Mathematical function.
msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eo Options for the evaluation and parsing of the expression.
[out] parsed_struct NULL or a math structure to fill with the unevaluated result.
Returns:
true if the calculation was successfully started (and finished if msecs > 0).

bool Calculator::calculateRPNBitwiseNot ( int  msecs,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies bitwise not to the first value on the RPN stack. If no register is available, then zero is added. This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters:
msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eo Options for the evaluation and parsing of the expression.
[out] parsed_struct NULL or a math structure to fill with the unevaluated result.
Returns:
true if the calculation was successfully started (and finished if msecs > 0).

bool Calculator::calculateRPNLogicalNot ( int  msecs,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies logical not to the first value on the RPN stack. If no register is available, then zero is added. This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters:
msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eo Options for the evaluation and parsing of the expression.
[out] parsed_struct NULL or a math structure to fill with the unevaluated result.
Returns:
true if the calculation was successfully started (and finished if msecs > 0).

MathStructure* Calculator::calculateRPN ( MathOperation  op,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies a mathematical operation to the first and second value on the RPN stack. The the second value is changed with input from the first value. For example, with OPERATION_SUBTRACT the first value is subtracted from the second. The first value on the stack is removed. If not enough registers is available, then zeros are added.

Parameters:
op Operation.
eo Options for the evaluation and parsing of the expression.
[out] parsed_struct NULL or a math structure to fill with the unevaluated result.
Returns:
The first value on the stack.

MathStructure* Calculator::calculateRPN ( MathFunction f,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies a mathematical operation to the first value on the RPN stack. The value is set as the first argument of the function. If no register is available, then zero is added.

Parameters:
f Mathematical function.
eo Options for the evaluation and parsing of the expression.
[out] parsed_struct NULL or a math structure to fill with the unevaluated result.
Returns:
The first value on the stack.

MathStructure* Calculator::calculateRPNBitwiseNot ( const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies bitwise not to the first value on the RPN stack. If no register is available, then zero is added.

Parameters:
eo Options for the evaluation and parsing of the expression.
[out] parsed_struct NULL or a math structure to fill with the unevaluated result.
Returns:
The first value on the stack.

MathStructure* Calculator::calculateRPNLogicalNot ( const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies logical not to the first value on the RPN stack. If no register is available, then zero is added.

Parameters:
eo Options for the evaluation and parsing of the expression.
[out] parsed_struct NULL or a math structure to fill with the unevaluated result.
Returns:
The first value on the stack.

bool Calculator::RPNStackEnter ( MathStructure mstruct,
int  msecs,
const EvaluationOptions eo = default_evaluation_options 
)

Evaluates a value and adds the result first on the RPN stack. This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters:
mstruct Value.
msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eo Options for the evaluation of the expression.
Returns:
true if the calculation was successfully started (and finished if msecs > 0).

bool Calculator::RPNStackEnter ( string  str,
int  msecs,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL,
MathStructure to_struct = NULL,
bool  make_to_division = true 
)

Calculates an expression and adds the result first on the RPN stack. The expression should be unlocalized first with unlocalizeExpression(). This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters:
str Expression.
msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eo Options for the evaluation and parsing of the expression.
[out] parsed_struct NULL or a math structure to fill with the result of the parsing of the expression.
[out] to_struct NULL or a math structure to fill with unit expression parsed after "to".
make_to_division If true, the expression after "to" will be interpreted as a unit epxression to convert the result to.
Returns:
true if the calculation was successfully started (and finished if msecs > 0).

void Calculator::RPNStackEnter ( MathStructure mstruct,
bool  eval = false,
const EvaluationOptions eo = default_evaluation_options 
)

Adds a value first on the RPN stack.

Parameters:
mstruct Value.
eval If true, the the mathematical structure will be evaluated first.

void Calculator::RPNStackEnter ( string  str,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL,
MathStructure to_struct = NULL,
bool  make_to_division = true 
)

Calculates an expression adds the result first on the RPN stack. The expression should be unlocalized first with unlocalizeExpression().

Parameters:
str Expression.
eo Options for the evaluation and parsing of the expression.
[out] parsed_struct NULL or a math structure to fill with the result of the parsing of the expression.
[out] to_struct NULL or a math structure to fill with unit expression parsed after "to".
make_to_division If true, the expression after "to" will be interpreted as a unit epxression to convert the result to.

string Calculator::localizeExpression ( string  str  )  const

Returns a localized expressions. Affects decimal signs and argument separators.

Parameters:
str The expression to localize.
Returns:
A localized expression.

string Calculator::unlocalizeExpression ( string  str,
const ParseOptions po = default_parse_options 
) const

Returns an unlocalized expressions. Affects decimal signs and argument separators.

Parameters:
str The expression to unlocalize.
Returns:
An unlocalized expression.

bool Calculator::separateToExpression ( string &  str,
string &  to_str,
const EvaluationOptions eo 
) const

Split an expression string after and before " to ".

Parameters:
[out] str The expression. Will be set to the string before " to ".
[out] to_str Will be set to the string after " to ".
eo Options for the evaluation and parsing of the expression (nothing will be done if units are not enabled).
Returns:
true if " to " was found and the expression split.

MathStructure Calculator::parse ( string  str,
const ParseOptions po = default_parse_options 
)

Parse an expression and place in a MathStructure object.

Parameters:
str Expression
po Parse options.
Returns:
MathStructure with result of parse.

MathStructure Calculator::convert ( const MathStructure mstruct,
string  composite_,
const EvaluationOptions eo = default_evaluation_options 
)

Converts to a unit expression. The converted value is evaluated.

Parameters:
mstruct The value to convert.
composite_ Unit expression.
eo Evaluation options.
Returns:
Converted value.

MathStructure Calculator::convert ( const MathStructure mstruct,
Unit to_unit,
const EvaluationOptions eo = default_evaluation_options,
bool  always_convert = true 
)

Converts to a unit. The converted value is evaluated.

Parameters:
mstruct The value to convert.
composite_ Unit to convert to.
eo Evaluation options.
always_convert ...
Returns:
Converted value.

void Calculator::setDefaultAssumptions ( Assumptions ass  ) 

Set assumptions for objects without own assumptions (unknown variables and symbols).

Assumptions* Calculator::defaultAssumptions (  ) 

Returns the default assumptions for objects without own assumptions (unknown variables and symbols).

Unit* Calculator::getGraUnit (  ) 

Returns the gradians unit.

Unit* Calculator::getRadUnit (  ) 

Returns the radians unit.

Unit* Calculator::getDegUnit (  ) 

Returns the degrees unit.

DecimalPrefix* Calculator::getExactDecimalPrefix ( int  exp10,
int  exp = 1 
) const

Returns a decimal prefix with exactly the provided value, that fulfils the condition prefix->exponent(exp) == exp10.

Parameters:
exp10 Base-10 exponent of the requested prefix.
exp The exponent of the unit.
Returns:
A prefix or NULL if not found.

BinaryPrefix* Calculator::getExactBinaryPrefix ( int  exp2,
int  exp = 1 
) const

Returns a binary prefix with exactly the provided value, that fulfils the condition prefix->exponent(exp) == exp2.

Parameters:
exp2 Base-2 exponent of the requested prefix.
exp The exponent of the unit.
Returns:
A prefix or NULL if not found.

Prefix* Calculator::getExactPrefix ( const Number o,
int  exp = 1 
) const

Returns a prefix with exactly the provided value, that fulfils the condition prefix->value(exp) == o.

Parameters:
o Value of the requested prefix.
exp The exponent of the unit.
Returns:
A prefix or NULL if not found.

DecimalPrefix* Calculator::getNearestDecimalPrefix ( int  exp10,
int  exp = 1 
) const

Returns the nearest decimal prefix for a value.

Parameters:
exp10 Base-10 exponent of the value.
exp The exponent of the unit.
Returns:
A prefix or NULL if no decimal prefix is available.

DecimalPrefix* Calculator::getBestDecimalPrefix ( int  exp10,
int  exp = 1,
bool  all_prefixes = true 
) const

Returns the best suited decimal prefix for a value.

Parameters:
exp10 Base-10 exponent of the value.
exp The exponent of the unit.
all_prefixes If false, prefixes which is not a multiple of thousand (centi, deci, deka, hekto) will be skipped.
Returns:
A prefix or NULL if the unit should be left without prefix.

DecimalPrefix* Calculator::getBestDecimalPrefix ( const Number exp10,
const Number exp,
bool  all_prefixes = true 
) const

Returns the best suited decimal prefix for a value.

Parameters:
exp10 Base-10 exponent of the value.
exp The exponent of the unit.
all_prefixes If false, prefixes which is not a multiple of thousand (centi, deci, deka, hekto) will be skipped.
Returns:
A prefix or NULL if the unit should be left without prefix.

BinaryPrefix* Calculator::getNearestBinaryPrefix ( int  exp2,
int  exp = 1 
) const

Returns the nearest binary prefix for a value.

Parameters:
exp10 Base-2 exponent of the value.
exp The exponent of the unit.
Returns:
A prefix or NULL if no binary prefix is available.

BinaryPrefix* Calculator::getBestBinaryPrefix ( int  exp2,
int  exp = 1 
) const

Returns the best suited binary prefix for a value.

Parameters:
exp10 Base-2 exponent of the value.
exp The exponent of the unit.
Returns:
A prefix or NULL if the unit should be left without prefix.

BinaryPrefix* Calculator::getBestBinaryPrefix ( const Number exp2,
const Number exp 
) const

Returns the best suited binary prefix for a value.

Parameters:
exp10 Base-2 exponent of the value.
exp The exponent of the unit.
Returns:
A prefix or NULL if the unit should be left without prefix.

Prefix* Calculator::addPrefix ( Prefix p  ) 

Add a new prefix to the calculator.

void Calculator::prefixNameChanged ( Prefix p,
bool  new_item = false 
)

Used internally.

bool Calculator::hasVariable ( Variable v  ) 

Checks if a variable exists/is registered in the calculator.

bool Calculator::hasUnit ( Unit u  ) 

Checks if a unit exists/is registered in the calculator.

bool Calculator::hasFunction ( MathFunction f  ) 

Checks if a function exists/is registered in the calculator.

bool Calculator::stillHasVariable ( Variable v  ) 

Checks if a pointer points to a variable that still exists in the calculator. As opposed to hasFunction(), this function only checks if the mathematical function has been deleted.

bool Calculator::stillHasUnit ( Unit u  ) 

Checks if a pointer points to a unit that still exists in the calculator. As opposed to hasUnit(), this function only checks if the unit has been deleted.

bool Calculator::stillHasFunction ( MathFunction f  ) 

Checks if a pointer points to a mathematical function that still exists in the calculator. As opposed to hasFunction(), this function only checks if the mathematical function has been deleted.

Prefix* Calculator::getPrefix ( size_t  index  )  const

Returns prefix for an index (starting at zero). All prefixes can be traversed by starting at index zero and increasing the index until NULL is returned.

Parameters:
index Index of prefix.
Returns:
Prefix for index or NULL if not found.

Prefix* Calculator::getPrefix ( string  name_  )  const

Returns prefix with provided name.

Parameters:
name_ Name of prefix to retrieve.
Returns:
Prefix with provided name or NULL if not found.

Variable* Calculator::getVariable ( size_t  index  )  const

Returns variable for an index (starting at zero). All variables can be traversed by starting at index zero and increasing the index until NULL is returned.

Parameters:
index Index of variable.
Returns:
Variable for index or NULL if not found.

Unit* Calculator::getUnit ( size_t  index  )  const

Returns unit for an index (starting at zero). All units can be traversed by starting at index zero and increasing the index until NULL is returned.

Parameters:
index Index of unit.
Returns:
Unit for index or NULL if not found.

MathFunction* Calculator::getFunction ( size_t  index  )  const

Returns function for an index (starting at zero). All functions can be traversed by starting at index zero and increasing the index until NULL is returned.

Parameters:
index Index of function.
Returns:
Function for index or NULL if not found.

void Calculator::resetVariables (  ) 

Unloads all non-builtin variables.

void Calculator::resetFunctions (  ) 

Unloads all non-builtin functions.

void Calculator::resetUnits (  ) 

Unloads all non-builtin units.

void Calculator::reset (  ) 

Unloads all non-builtin variables, functions and units.

void Calculator::addBuiltinVariables (  ) 

Adds builtin variables. Called automatically when the calculator is created.

void Calculator::addBuiltinFunctions (  ) 

Adds builtin functions. Called automatically when the calculator is created.

void Calculator::addBuiltinUnits (  ) 

Adds builtin units. Called automatically when the calculator is created.

bool Calculator::variableNameIsValid ( const string &  name_  ) 

Tests if a name is valid for a variable.

Parameters:
name_ Variable name.
Returns:
true if the name is valid for a variable.

bool Calculator::variableNameIsValid ( const char *  name_  ) 

Tests if a name is valid for a variable.

Parameters:
name_ Variable name.
Returns:
true if the name is valid for a variable.

bool Calculator::nameTaken ( string  name,
ExpressionItem object = NULL 
)

Checks if a name is used by another object which is not allowed to have the same name.

Parameters:
name Name.
object Object to exclude from check.
Returns:
true if the name is used.

void Calculator::message ( MessageType  mtype,
const char *  TEMPLATE,
  ... 
)

Put a message in the message queue.

CalculatorMessage* Calculator::message (  ) 

Returns the first message in queue.

CalculatorMessage* Calculator::nextMessage (  ) 

Removes the first message in queue and returns the next.

bool Calculator::loadGlobalDefinitions (  ) 

Load all standard global (system wide) definitions from the global data directory ($PREFIX/share/qalculate).

Returns:
true if the definitions were successfully loaded.

bool Calculator::loadGlobalDefinitions ( string  filename  ) 

Load global (system wide) definitions from a file in the global data directory ($PREFIX/share/qalculate).

Parameters:
filename Name of the file in the global data directory.
Returns:
true if the definitions were successfully loaded.

bool Calculator::loadGlobalPrefixes (  ) 

Load prefixes.

Returns:
true if the definitions were successfully loaded.

bool Calculator::loadGlobalCurrencies (  ) 

Load currencies.

Returns:
true if the definitions were successfully loaded.

bool Calculator::loadGlobalUnits (  ) 

Load units.

Returns:
true if the definitions were successfully loaded.

bool Calculator::loadGlobalVariables (  ) 

Load variables.

Returns:
true if the definitions were successfully loaded.

bool Calculator::loadGlobalFunctions (  ) 

Load functions.

Returns:
true if the definitions were successfully loaded.

bool Calculator::loadGlobalDataSets (  ) 

Load data sets.

Returns:
true if the definitions were successfully loaded.

bool Calculator::loadLocalDefinitions (  ) 

Load local, user specific, definitions from the local definitions directory (~/.qalculate/definitions). All files in the directory and in the datasets subdirectory are loaded.

Returns:
true if the definitions were successfully loaded.

int Calculator::loadDefinitions ( const char *  file_name,
bool  is_user_defs = true 
)

Load definitions from a file.

Parameters:
file_name The path to the file to load.
is_user_defs true if the definitions are local, false if they are global.
Returns:
true if the definitions were successfully loaded.

bool Calculator::saveDefinitions (  ) 

Save local definitions to ~/.qalculate/definitions/

Returns:
true if definitions was successfully saved.

bool Calculator::canFetch (  ) 

Checks if gnomevfs-copy or wget is available for downloading exchange rates from the Internet.

Returns:
true if gnomevfs-copy or wget was found.

bool Calculator::hasGnomeVFS (  ) 

Checks if gnomevfs-copy available.

Returns:
true if gnomevfs-copy was found.

bool Calculator::loadExchangeRates (  ) 

Load saved (local) currency units and exchange rates.

Returns:
true if operation successful.

string Calculator::getExchangeRatesFileName (  ) 

Name of the exchange rates file on local disc.

Returns:
name of local exchange rates file.

string Calculator::getExchangeRatesUrl (  ) 

Url of the exchange rates file on the Internet.

Returns:
Url of exchange rates file.

bool Calculator::fetchExchangeRates ( int  timeout,
string  wget_args 
)

Download current exchange rates from the Internet to local disc.

Parameters:
timeout Timeout for donwload try (only used by wget)
wget_args Extra arguments to pass to wget.
Returns:
true if operation was successful.

bool Calculator::fetchExchangeRates ( int  timeout = 15  ) 

Download current exchange rates from the Internet to local disc with default wget arguments.

Parameters:
timeout Timeout for donwload try (only used by wget)
Returns:
true if operation was successful.

bool Calculator::checkExchangeRatesDate (  ) 

Returns true if the exchange rates on local disc is older than one week.

bool Calculator::canPlot (  ) 

Checks if gnuplot is available.

Returns:
true if gnuplot was found.

void Calculator::setPrecision ( int  precision = DEFAULT_PRECISION  ) 

Set default precision for approximate calculations.

Parameters:
precision Precision.

int Calculator::getPrecision (  )  const

Returns default precision for approximate calculations.

const string& Calculator::getDecimalPoint (  )  const

Returns the preferred decimal point character.

const string& Calculator::getComma (  )  const

Returns the preferred comma character for separating arguments.

void Calculator::setLocale (  ) 

Sets argument separator and decimal sign from the current locale. Mainly for internal use.

void Calculator::unsetLocale (  ) 

Resets argument separator and decimal sign. Mainly for internal use.

string Calculator::localToString (  )  const

Returns the translated text string used in expressions for converting to a specific unit expression (ex "5 meters to feet.

size_t Calculator::addId ( MathStructure mstruct,
bool  persistent = false 
)

Stores a value with an associated id. Mainly for internal use.

Parameters:
mstruct The value to store.
persistent If false the values will be removed from storage when retrieved with getId().
Returns:
Storage id.

size_t Calculator::parseAddId ( MathFunction f,
const string &  str,
const ParseOptions po,
bool  persistent = false 
)

Stores a function value with arguments parsed from a text string using Function::parse(), with an associated id. Mainly for internal use.

Parameters:
f Mathematical function.
str Arguments.
po Parse options.
persistent If false the values will be removed from storage when retrieved with getId().
Returns:
Storage id.

MathStructure* Calculator::getId ( size_t  id  ) 

Returns a stored value. Mainly for internal use.

Parameters:
id Storage id.
Returns:
A stored value.

void Calculator::delId ( size_t  id  ) 

Removes and unreferences (value->unref() will be called) a value from storage. Mainly for internal use.

Parameters:
id Storage id.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDataPropertyArgument-members.html0000644000175100017510000002627411320655045024447 00000000000000 libqalculate-0.9.7: Member List

DataPropertyArgument Member List

This is the complete list of members for DataPropertyArgument, including all inherited members.

alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
copy() const DataPropertyArgument [virtual]
DataPropertyArgument(DataSet *data_set, string name_="", bool does_test=true, bool does_error=true) (defined in DataPropertyArgument)DataPropertyArgument
DataPropertyArgument(const DataPropertyArgument *arg) (defined in DataPropertyArgument)DataPropertyArgument
dataSet() const (defined in DataPropertyArgument)DataPropertyArgument
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
o_data (defined in DataPropertyArgument)DataPropertyArgument [protected]
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const DataPropertyArgument [virtual]
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)Argument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setDataSet(DataSet *data_set) (defined in DataPropertyArgument)DataPropertyArgument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
subprintlong() const DataPropertyArgument [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const DataPropertyArgument [protected, virtual]
suggestsQuotes() const (defined in Argument)Argument [virtual]
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const DataPropertyArgument [virtual]
zeroForbidden() const Argument
~Argument()Argument [virtual]
~DataPropertyArgument() (defined in DataPropertyArgument)DataPropertyArgument


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x73.html0000644000175100017510000003165711320655045021455 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- s -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x6b.html0000644000175100017510000000764511320655045020520 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- k -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x6e.html0000644000175100017510000001007411320655045021524 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- n -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/structParseOptions-members.html0000644000175100017510000001115611320655045023164 00000000000000 libqalculate-0.9.7: Member List
Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classNumberPrefix.png0000644000175100017510000000054611320655045021116 00000000000000PNG  IHDRYP*TPLTE`{tRNS@fIDATHA P: :텺GhJj]Cр8n=E :F_6}@u;4"HW l~G)k$4w.3i؎Nj/pK)6}tu]avlX5LA@NAs͛T%M!Uf%RLXi%!wi+TQR\\5-8ٱug4;e%ZQ*ɚuKәdMpKm{]Ҧ/lٱrIENDB`libqalculate-0.9.7/docs/reference/html/classPrefix.png0000644000175100017510000000120611320655045017737 00000000000000PNG  IHDR"PO ePLTE`{tRNS@fIDATh[R0 E~Gځ`/`T3&'Noa}v"D}D[V5q#z|&(Ph=;[R/%j"pƈƟbw(qw(qzk}_bv(@?"D\nG2A((/֞&fBd yJ"fHp˟\9-':\+N&w\D C{]95IGG_nuB=< >Byծq H-gDfHD2$ʉDl C&qkG$sN$qk];'-k Av-%N;[IN% v)N'z|=9Qoo2=7)/(';>,~ȡIENDB`libqalculate-0.9.7/docs/reference/html/functions_0x6d.html0000644000175100017510000001103511320655045020506 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- m -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classKnownVariable.png0000644000175100017510000000126111320655045021245 00000000000000PNG  IHDRmTUPLTE`{tRNS@fGIDAThkn ~cn`N0m4?üBP֬[ |;m璼"! ]Qv B#HbJ)nlp.Ȝmvd ܟ|H2Y7't}<1.ߧaDn3sokv)wu<N8ᄛ)ePΦh7>-~l!ԏpa\/t{OH͢k̥E@ن;_p ⵴8c"ܳp~8+~N8{e(4W[|0nӯQMGnR6Ҡ|xZG.q2]Na¨B;5|f TTą9brpRq/?̇xգ-xច[mi(~ؓEL8NGpk_a)8ˇSpt'-ᎋ1z@~XS} DEj9NP}Lj9IC)bqR9P):$Pqm<Ŭ ]'Ӏ) + ]<;}R ܩRn7St (IENDB`libqalculate-0.9.7/docs/reference/html/structPlotDataParameters-members.html0000644000175100017510000000547311320655045024277 00000000000000 libqalculate-0.9.7: Member List

PlotDataParameters Member List

This is the complete list of members for PlotDataParameters, including all inherited members.

PlotDataParameters() (defined in PlotDataParameters)PlotDataParameters
smoothingPlotDataParameters
stylePlotDataParameters
titlePlotDataParameters
xaxis2PlotDataParameters
yaxis2PlotDataParameters


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classExpressionItemArgument.png0000644000175100017510000000072711320655045023172 00000000000000PNG  IHDRP xPLTE`{tRNS@fmIDATX] 7`BIѶbg U@+|+5*au\ceZ{'ut,Me}԰CSsmI9KWkqޘct V+/-њ򜰎aZ=iX؟[%<_Һ>kXְa+@ݒa[ȼ'RSwRQliV 9MbckKct֨$bICzNiCF--$b,&ᒗCs`êJqzeK8b@1;H߸ jlSܲ^9f*m(y}zmZ,Gxy~U܋Ag3wou|q 5 \IENDB`libqalculate-0.9.7/docs/reference/html/classDynamicVariable.png0000644000175100017510000000124211320655045021534 00000000000000PNG  IHDRmTUPLTE`{tRNS@f8IDAThQr @$7'*:t_ $>OwϔpQI+~HDT.M4RJr%-EbNγV8QJjWJvm3٧sٟ kKZڟgqm -x*G-C-N]\nSjC+r<ӕN([2&HPHƜ̵%sFn},gSN۟qYpX`qwggp?y6n cp9S^y\vΩSd a;Q I7'p4v\@k`S g "_C\;Pu[%YaQ_s9y؟GqYpX`qwgN©܂D[92j -Cť5YU?TjOhr/wy'cq."6A/Nlg.s u?WU0Ox# fVވܱO]ʝw&TTZ0IENDB`libqalculate-0.9.7/docs/reference/html/classDecimalPrefix-members.html0000644000175100017510000001510111320655045023025 00000000000000 libqalculate-0.9.7: Member List

DecimalPrefix Member List

This is the complete list of members for DecimalPrefix, including all inherited members.

DecimalPrefix(int exp10, string long_name, string short_name="", string unicode_name="")DecimalPrefix
exp (defined in DecimalPrefix)DecimalPrefix [protected]
exponent(int iexp=1) const DecimalPrefix
exponent(const Number &nexp) const DecimalPrefix
l_name (defined in Prefix)Prefix [protected]
longName(bool return_short_if_no_long=true, bool use_unicode=false) const Prefix
name(bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const Prefix
Prefix(string long_name, string short_name="", string unicode_name="")Prefix
s_name (defined in Prefix)Prefix [protected]
setExponent(int iexp)DecimalPrefix
setLongName(string long_name)Prefix
setShortName(string short_name)Prefix
setUnicodeName(string unicode_name)Prefix
shortName(bool return_long_if_no_short=true, bool use_unicode=false) const Prefix
type() const DecimalPrefix [virtual]
u_name (defined in Prefix)Prefix [protected]
unicodeName(bool return_short_if_no_uni=true) const Prefix
value(const Number &nexp) const DecimalPrefix [virtual]
value(int iexp) const DecimalPrefix [virtual]
value() const DecimalPrefix [virtual]
~DecimalPrefix() (defined in DecimalPrefix)DecimalPrefix
~Prefix() (defined in Prefix)Prefix [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classCalculator-members.html0000644000175100017510000032306411320655045022414 00000000000000 libqalculate-0.9.7: Member List

Calculator Member List

This is the complete list of members for Calculator, including all inherited members.

abort()Calculator
abort_this()Calculator
addBuiltinFunctions()Calculator
addBuiltinUnits()Calculator
addBuiltinVariables()Calculator
addDataSet(DataSet *dc, bool force=true, bool check_names=true) (defined in Calculator)Calculator
addDefaultStringAlternative(string replacement, string standard) (defined in Calculator)Calculator
addExpressionItem(ExpressionItem *item, bool force=true) (defined in Calculator)Calculator
addFunction(MathFunction *f, bool force=true, bool check_names=true) (defined in Calculator)Calculator
addId(MathStructure *mstruct, bool persistent=false)Calculator
addPrefix(Prefix *p)Calculator
addStringAlternative(string replacement, string standard) (defined in Calculator)Calculator
addUnit(Unit *u, bool force=true, bool check_names=true) (defined in Calculator)Calculator
addVariable(Variable *v, bool force=true, bool check_names=true) (defined in Calculator)Calculator
AND_str (defined in Calculator)Calculator [protected]
and_str (defined in Calculator)Calculator [protected]
and_str_len (defined in Calculator)Calculator [protected]
AND_str_len (defined in Calculator)Calculator [protected]
b_argument_errors (defined in Calculator)Calculator [protected]
b_busy (defined in Calculator)Calculator
b_calcvars_was (defined in Calculator)Calculator [protected]
b_functions_was (defined in Calculator)Calculator [protected]
b_gnuplot_open (defined in Calculator)Calculator [protected]
b_rpn_was (defined in Calculator)Calculator [protected]
b_save_called (defined in Calculator)Calculator [protected]
b_units_was (defined in Calculator)Calculator [protected]
b_unknown_was (defined in Calculator)Calculator [protected]
b_variables_was (defined in Calculator)Calculator [protected]
beginTemporaryStopMessages() (defined in Calculator)Calculator
binary_null_prefix (defined in Calculator)Calculator
binary_prefixes (defined in Calculator)Calculator
busy()Calculator
calculate(MathStructure *mstruct, string str, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)Calculator
calculate(string str, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)Calculator
calculate_pipe_r (defined in Calculator)Calculator [protected]
calculate_pipe_w (defined in Calculator)Calculator [protected]
calculate_thread (defined in Calculator)Calculator [protected]
calculate_thread_attr (defined in Calculator)Calculator [protected]
calculate_thread_stopped (defined in Calculator)Calculator
calculateRPN(MathStructure *mstruct, int command, size_t index, int msecs, const EvaluationOptions &eo) (defined in Calculator)Calculator [protected]
calculateRPN(string str, int command, size_t index, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) (defined in Calculator)Calculator [protected]
calculateRPN(MathOperation op, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPN(MathFunction *f, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPN(MathOperation op, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPN(MathFunction *f, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPNBitwiseNot(int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPNBitwiseNot(const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPNLogicalNot(int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPNLogicalNot(const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPNRegister(size_t index, int msecs, const EvaluationOptions &eo=default_evaluation_options)Calculator
Calculator() (defined in Calculator)Calculator
canFetch()Calculator
canPlot()Calculator
checkExchangeRatesDate()Calculator
checkSaveFunctionCalled() (defined in Calculator)Calculator
clearBuffers()Calculator
clearRPNStack() (defined in Calculator)Calculator
closeGnuplot() (defined in Calculator)Calculator
COMMA_S (defined in Calculator)Calculator [protected]
COMMA_STR (defined in Calculator)Calculator [protected]
convert(const MathStructure &mstruct, string composite_, const EvaluationOptions &eo=default_evaluation_options)Calculator
convert(const MathStructure &mstruct, Unit *to_unit, const EvaluationOptions &eo=default_evaluation_options, bool always_convert=true)Calculator
convert(double value, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
convert(string str, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
convertToBaseUnits(const MathStructure &mstruct, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
convertToBestUnit(const MathStructure &mstruct, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
convertToCompositeUnit(const MathStructure &mstruct, CompositeUnit *cu, const EvaluationOptions &eo=default_evaluation_options, bool always_convert=true) (defined in Calculator)Calculator
convertToValidFunctionName(string name_) (defined in Calculator)Calculator
convertToValidUnitName(string name_) (defined in Calculator)Calculator
convertToValidVariableName(string name_) (defined in Calculator)Calculator
data_sets (defined in Calculator)Calculator [protected]
decimal_null_prefix (defined in Calculator)Calculator
decimal_prefixes (defined in Calculator)Calculator
default_assumptions (defined in Calculator)Calculator [protected]
default_dot_as_separator (defined in Calculator)Calculator
default_real_signs (defined in Calculator)Calculator [protected]
default_signs (defined in Calculator)Calculator [protected]
defaultAssumptions()Calculator
delDefaultStringAlternative(string replacement, string standard) (defined in Calculator)Calculator
deleted_functions (defined in Calculator)Calculator [protected]
deleted_units (defined in Calculator)Calculator [protected]
deleted_variables (defined in Calculator)Calculator [protected]
deleteName(string name_, ExpressionItem *object=NULL) (defined in Calculator)Calculator
deleteRPNRegister(size_t index) (defined in Calculator)Calculator
deleteUnitName(string name_, Unit *object=NULL) (defined in Calculator)Calculator
delId(size_t id)Calculator
delPrefixUFV(Prefix *object) (defined in Calculator)Calculator
delStringAlternative(string replacement, string standard) (defined in Calculator)Calculator
delUFV(ExpressionItem *object) (defined in Calculator)Calculator
disable_errors_ref (defined in Calculator)Calculator [protected]
DOT_S (defined in Calculator)Calculator [protected]
DOT_STR (defined in Calculator)Calculator [protected]
endTemporaryStopMessages(int *message_count=NULL, int *warning_count=NULL) (defined in Calculator)Calculator
error(bool critical, const char *TEMPLATE,...) (defined in Calculator)Calculator
exchange_rates_warning_issued (defined in Calculator)Calculator [protected]
exportCSV(const MathStructure &mstruct, const char *file_name, string delimiter=",") (defined in Calculator)Calculator
expression_to_calculate (defined in Calculator)Calculator
expressionItemActivated(ExpressionItem *item) (defined in Calculator)Calculator
expressionItemDeactivated(ExpressionItem *item) (defined in Calculator)Calculator
expressionItemDeleted(ExpressionItem *item) (defined in Calculator)Calculator
expressionToPlotVector(string expression, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector=NULL, string x_var="\\x", const ParseOptions &po=default_parse_options) (defined in Calculator)Calculator
expressionToPlotVector(string expression, float min, float max, int steps, MathStructure *x_vector=NULL, string x_var="\\x", const ParseOptions &po=default_parse_options) (defined in Calculator)Calculator
expressionToPlotVector(string expression, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector=NULL, string x_var="\\x", const ParseOptions &po=default_parse_options) (defined in Calculator)Calculator
expressionToPlotVector(string expression, float min, float max, float step, MathStructure *x_vector=NULL, string x_var="\\x", const ParseOptions &po=default_parse_options) (defined in Calculator)Calculator
expressionToPlotVector(string expression, const MathStructure &x_vector, string x_var="\\x", const ParseOptions &po=default_parse_options) (defined in Calculator)Calculator
f_abs (defined in Calculator)Calculator
f_acos (defined in Calculator)Calculator
f_acosh (defined in Calculator)Calculator
f_add_days (defined in Calculator)Calculator
f_add_months (defined in Calculator)Calculator
f_add_years (defined in Calculator)Calculator
f_adjoint (defined in Calculator)Calculator
f_area (defined in Calculator)Calculator
f_arg (defined in Calculator)Calculator
f_ascii (defined in Calculator)Calculator
f_asin (defined in Calculator)Calculator
f_asinh (defined in Calculator)Calculator
f_atan (defined in Calculator)Calculator
f_atanh (defined in Calculator)Calculator
f_base (defined in Calculator)Calculator
f_beta (defined in Calculator)Calculator
f_bin (defined in Calculator)Calculator
f_binomial (defined in Calculator)Calculator
f_bitxor (defined in Calculator)Calculator
f_ceil (defined in Calculator)Calculator
f_char (defined in Calculator)Calculator
f_coeff (defined in Calculator)Calculator
f_cofactor (defined in Calculator)Calculator
f_column (defined in Calculator)Calculator
f_columns (defined in Calculator)Calculator
f_component (defined in Calculator)Calculator
f_concatenate (defined in Calculator)Calculator
f_cos (defined in Calculator)Calculator
f_cosh (defined in Calculator)Calculator
f_csum (defined in Calculator)Calculator
f_day (defined in Calculator)Calculator
f_days (defined in Calculator)Calculator
f_degree (defined in Calculator)Calculator
f_denominator (defined in Calculator)Calculator
f_determinant (defined in Calculator)Calculator
f_diff (defined in Calculator)Calculator
f_dimension (defined in Calculator)Calculator
f_element (defined in Calculator)Calculator
f_elements (defined in Calculator)Calculator
f_error (defined in Calculator)Calculator
f_even (defined in Calculator)Calculator
f_exp (defined in Calculator)Calculator
f_export (defined in Calculator)Calculator
f_factorial (defined in Calculator)Calculator
f_factorial2 (defined in Calculator)Calculator
f_floor (defined in Calculator)Calculator
f_for (defined in Calculator)Calculator
f_frac (defined in Calculator)Calculator
f_function (defined in Calculator)Calculator
f_gamma (defined in Calculator)Calculator
f_gcd (defined in Calculator)Calculator
f_genvector (defined in Calculator)Calculator
f_hex (defined in Calculator)Calculator
f_identity (defined in Calculator)Calculator
f_if (defined in Calculator)Calculator
f_im (defined in Calculator)Calculator
f_int (defined in Calculator)Calculator
f_integrate (defined in Calculator)Calculator
f_inverse (defined in Calculator)Calculator
f_is_integer (defined in Calculator)Calculator
f_is_number (defined in Calculator)Calculator
f_is_rational (defined in Calculator)Calculator
f_is_real (defined in Calculator)Calculator
f_isodate (defined in Calculator)Calculator
f_lambert_w (defined in Calculator)Calculator
f_lcm (defined in Calculator)Calculator
f_lcoeff (defined in Calculator)Calculator
f_ldegree (defined in Calculator)Calculator
f_length (defined in Calculator)Calculator
f_limits (defined in Calculator)Calculator
f_ln (defined in Calculator)Calculator
f_load (defined in Calculator)Calculator
f_localdate (defined in Calculator)Calculator
f_logn (defined in Calculator)Calculator
f_matrix (defined in Calculator)Calculator
f_matrix_to_vector (defined in Calculator)Calculator
f_max (defined in Calculator)Calculator
f_merge_vectors (defined in Calculator)Calculator
f_message (defined in Calculator)Calculator
f_min (defined in Calculator)Calculator
f_mod (defined in Calculator)Calculator
f_mode (defined in Calculator)Calculator
f_month (defined in Calculator)Calculator
f_multifactorial (defined in Calculator)Calculator
f_multisolve (defined in Calculator)Calculator
f_numerator (defined in Calculator)Calculator
f_oct (defined in Calculator)Calculator
f_odd (defined in Calculator)Calculator
f_percentile (defined in Calculator)Calculator
f_permanent (defined in Calculator)Calculator
f_polynomial_content (defined in Calculator)Calculator
f_polynomial_primpart (defined in Calculator)Calculator
f_polynomial_unit (defined in Calculator)Calculator
f_process (defined in Calculator)Calculator
f_process_matrix (defined in Calculator)Calculator
f_product (defined in Calculator)Calculator
f_radians_to_default_angle_unit (defined in Calculator)Calculator
f_rand (defined in Calculator)Calculator
f_rank (defined in Calculator)Calculator
f_re (defined in Calculator)Calculator
f_register (defined in Calculator)Calculator
f_rem (defined in Calculator)Calculator
f_replace (defined in Calculator)Calculator
f_represents_integer (defined in Calculator)Calculator
f_represents_number (defined in Calculator)Calculator
f_represents_rational (defined in Calculator)Calculator
f_represents_real (defined in Calculator)Calculator
f_roman (defined in Calculator)Calculator
f_round (defined in Calculator)Calculator
f_row (defined in Calculator)Calculator
f_rows (defined in Calculator)Calculator
f_save (defined in Calculator)Calculator
f_select (defined in Calculator)Calculator
f_shift (defined in Calculator)Calculator
f_signum (defined in Calculator)Calculator
f_sin (defined in Calculator)Calculator
f_sinh (defined in Calculator)Calculator
f_solve (defined in Calculator)Calculator
f_sort (defined in Calculator)Calculator
f_sq (defined in Calculator)Calculator
f_sqrt (defined in Calculator)Calculator
f_stack (defined in Calculator)Calculator
f_stamptodate (defined in Calculator)Calculator
f_stripunits (defined in Calculator)Calculator
f_sum (defined in Calculator)Calculator
f_tan (defined in Calculator)Calculator
f_tanh (defined in Calculator)Calculator
f_tcoeff (defined in Calculator)Calculator
f_time (defined in Calculator)Calculator
f_timestamp (defined in Calculator)Calculator
f_title (defined in Calculator)Calculator
f_total (defined in Calculator)Calculator
f_transpose (defined in Calculator)Calculator
f_trunc (defined in Calculator)Calculator
f_uncertainty (defined in Calculator)Calculator
f_vector (defined in Calculator)Calculator
f_warning (defined in Calculator)Calculator
f_week (defined in Calculator)Calculator
f_weekday (defined in Calculator)Calculator
f_xor (defined in Calculator)Calculator
f_year (defined in Calculator)Calculator
f_yearday (defined in Calculator)Calculator
f_yearfrac (defined in Calculator)Calculator
f_zeta (defined in Calculator)Calculator
fetchExchangeRates(int timeout, string wget_args)Calculator
fetchExchangeRates(int timeout=15)Calculator
freed_ids (defined in Calculator)Calculator [protected]
functionNameChanged(MathFunction *f, bool new_item=false) (defined in Calculator)Calculator
functionNameIsValid(const string &name_) (defined in Calculator)Calculator
functionNameIsValid(const char *name_) (defined in Calculator)Calculator
functionNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) (defined in Calculator)Calculator
functionNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs) (defined in Calculator)Calculator
functionNameTaken(string name, MathFunction *object=NULL) (defined in Calculator)Calculator
functions (defined in Calculator)Calculator
getActiveExpressionItem(string name, ExpressionItem *item=NULL) (defined in Calculator)Calculator
getActiveExpressionItem(ExpressionItem *item) (defined in Calculator)Calculator
getActiveFunction(string name_) (defined in Calculator)Calculator
getActiveUnit(string name_) (defined in Calculator)Calculator
getActiveVariable(string name_) (defined in Calculator)Calculator
getBestBinaryPrefix(int exp2, int exp=1) const Calculator
getBestBinaryPrefix(const Number &exp2, const Number &exp) const Calculator
getBestDecimalPrefix(int exp10, int exp=1, bool all_prefixes=true) const Calculator
getBestDecimalPrefix(const Number &exp10, const Number &exp, bool all_prefixes=true) const Calculator
getBestUnit(Unit *u, bool allow_only_div=false) (defined in Calculator)Calculator
getComma() const Calculator
getCompositeUnit(string internal_name_) (defined in Calculator)Calculator
getDataSet(size_t index) (defined in Calculator)Calculator
getDataSet(string name) (defined in Calculator)Calculator
getDecimalPoint() const Calculator
getDegUnit()Calculator
getExactBinaryPrefix(int exp2, int exp=1) const Calculator
getExactDecimalPrefix(int exp10, int exp=1) const Calculator
getExactPrefix(const Number &o, int exp=1) const Calculator
getExchangeRatesFileName()Calculator
getExchangeRatesUrl()Calculator
getExpressionItem(string name, ExpressionItem *item=NULL) (defined in Calculator)Calculator
getFunction(string name_) (defined in Calculator)Calculator
getFunction(size_t index) const Calculator
getGraUnit()Calculator
getId(size_t id)Calculator
getInactiveExpressionItem(string name, ExpressionItem *item=NULL) (defined in Calculator)Calculator
getName(string name="", ExpressionItem *object=NULL, bool force=false, bool always_append=false) (defined in Calculator)Calculator
getNearestBinaryPrefix(int exp2, int exp=1) const Calculator
getNearestDecimalPrefix(int exp10, int exp=1) const Calculator
getPrecision() const Calculator
getPrefix(size_t index) const Calculator
getPrefix(string name_) const Calculator
getRadUnit()Calculator
getRPNRegister(size_t index=1) const (defined in Calculator)Calculator
getUnit(string name_) (defined in Calculator)Calculator
getUnit(size_t index) const Calculator
getVariable(string name_) (defined in Calculator)Calculator
getVariable(size_t index) const Calculator
gnuplot_cmdline (defined in Calculator)Calculator [protected]
gnuplot_pipe (defined in Calculator)Calculator [protected]
gnuplotOpen() (defined in Calculator)Calculator
has_gnomevfs (defined in Calculator)Calculator [protected]
hasFunction(MathFunction *f)Calculator
hasGnomeVFS()Calculator
hasUnit(Unit *u)Calculator
hasVariable(Variable *v)Calculator
i_precision (defined in Calculator)Calculator [protected]
ianglemode (defined in Calculator)Calculator [protected]
id_structs (defined in Calculator)Calculator [protected]
ids_i (defined in Calculator)Calculator [protected]
ids_p (defined in Calculator)Calculator [protected]
ILLEGAL_IN_NAMES (defined in Calculator)Calculator [protected]
ILLEGAL_IN_NAMES_MINUS_SPACE_STR (defined in Calculator)Calculator [protected]
ILLEGAL_IN_UNITNAMES (defined in Calculator)Calculator [protected]
importCSV(MathStructure &mstruct, const char *file_name, int first_row=1, string delimiter=",", vector< string > *headers=NULL) (defined in Calculator)Calculator
importCSV(const char *file_name, int first_row=1, bool headers=true, string delimiter=",", bool to_matrix=false, string name="", string title="", string category="") (defined in Calculator)Calculator
invokeGnuplot(string commands, string commandline_extra="", bool persistent=false) (defined in Calculator)Calculator
loadDefinitions(const char *file_name, bool is_user_defs=true)Calculator
loadExchangeRates()Calculator
loadGlobalCurrencies()Calculator
loadGlobalDataSets()Calculator
loadGlobalDefinitions()Calculator
loadGlobalDefinitions(string filename)Calculator
loadGlobalFunctions()Calculator
loadGlobalPrefixes()Calculator
loadGlobalUnits()Calculator
loadGlobalVariables()Calculator
loadLocalDefinitions()Calculator
local_to (defined in Calculator)Calculator [protected]
localizeExpression(string str) const Calculator
localToString() const Calculator
message(MessageType mtype, const char *TEMPLATE,...)Calculator
message()Calculator
messages (defined in Calculator)Calculator [protected]
minus_str (defined in Calculator)Calculator [protected]
minus_str_len (defined in Calculator)Calculator [protected]
moveRPNRegister(size_t old_index, size_t new_index) (defined in Calculator)Calculator
moveRPNRegisterDown(size_t index) (defined in Calculator)Calculator
moveRPNRegisterUp(size_t index) (defined in Calculator)Calculator
NAME_NUMBER_PRE_S (defined in Calculator)Calculator [protected]
NAME_NUMBER_PRE_STR (defined in Calculator)Calculator [protected]
nameChanged(ExpressionItem *item, bool new_item=false) (defined in Calculator)Calculator
nameTaken(string name, ExpressionItem *object=NULL)Calculator
nextMessage()Calculator
or_str (defined in Calculator)Calculator [protected]
OR_str (defined in Calculator)Calculator [protected]
or_str_len (defined in Calculator)Calculator [protected]
OR_str_len (defined in Calculator)Calculator [protected]
parse(string str, const ParseOptions &po=default_parse_options)Calculator
parse(MathStructure *mstruct, string str, const ParseOptions &po=default_parse_options) (defined in Calculator)Calculator
parseAdd(string &str, MathStructure *mstruct, const ParseOptions &po, MathOperation s) (defined in Calculator)Calculator
parseAdd(string &str, MathStructure *mstruct, const ParseOptions &po) (defined in Calculator)Calculator
parseAddId(MathFunction *f, const string &str, const ParseOptions &po, bool persistent=false)Calculator
parseAddIdAppend(MathFunction *f, const MathStructure &append_mstruct, const string &str, const ParseOptions &po, bool persistent=false) (defined in Calculator)Calculator
parseAddVectorId(const string &str, const ParseOptions &po, bool persistent=false) (defined in Calculator)Calculator
parseNumber(MathStructure *mstruct, string str, const ParseOptions &po=default_parse_options) (defined in Calculator)Calculator
parseOperators(MathStructure *mstruct, string str, const ParseOptions &po=default_parse_options) (defined in Calculator)Calculator
parseSigns(string &str) const (defined in Calculator)Calculator
per_str (defined in Calculator)Calculator [protected]
per_str_len (defined in Calculator)Calculator [protected]
place_currency_code_before (defined in Calculator)Calculator
place_currency_code_before_negative (defined in Calculator)Calculator
place_currency_sign_before (defined in Calculator)Calculator
place_currency_sign_before_negative (defined in Calculator)Calculator
plotVectors(PlotParameters *param, const vector< MathStructure > &y_vectors, const vector< MathStructure > &x_vectors, vector< PlotDataParameters * > &pdps, bool persistent=false) (defined in Calculator)Calculator
plus_str (defined in Calculator)Calculator [protected]
plus_str_len (defined in Calculator)Calculator [protected]
prefixes (defined in Calculator)Calculator
prefixNameChanged(Prefix *p, bool new_item=false)Calculator
print_pipe_r (defined in Calculator)Calculator [protected]
print_pipe_w (defined in Calculator)Calculator [protected]
print_thread (defined in Calculator)Calculator [protected]
print_thread_attr (defined in Calculator)Calculator [protected]
print_thread_stopped (defined in Calculator)Calculator
printMathStructureTimeOut(const MathStructure &mstruct, int msecs=100000, const PrintOptions &op=default_print_options) (defined in Calculator)Calculator
real_signs (defined in Calculator)Calculator [protected]
reset()Calculator
resetFunctions()Calculator
resetUnits()Calculator
resetVariables()Calculator
restoreState()Calculator
rpn_stack (defined in Calculator)Calculator [protected]
RPNStackEnter(MathStructure *mstruct, int msecs, const EvaluationOptions &eo=default_evaluation_options)Calculator
RPNStackEnter(string str, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)Calculator
RPNStackEnter(MathStructure *mstruct, bool eval=false, const EvaluationOptions &eo=default_evaluation_options)Calculator
RPNStackEnter(string str, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)Calculator
RPNStackSize() const (defined in Calculator)Calculator
save_printoptions (defined in Calculator)Calculator
saved_locale (defined in Calculator)Calculator [protected]
saveDataObjects() (defined in Calculator)Calculator
saveDataSets(const char *file_name, bool save_global=false) (defined in Calculator)Calculator
saveDefinitions()Calculator
saveFunctionCalled() (defined in Calculator)Calculator
saveFunctions(const char *file_name, bool save_global=false) (defined in Calculator)Calculator
savePrefixes(const char *file_name, bool save_global=false) (defined in Calculator)Calculator
saveState()Calculator
saveUnits(const char *file_name, bool save_global=false) (defined in Calculator)Calculator
saveVariables(const char *file_name, bool save_global=false) (defined in Calculator)Calculator
separateToExpression(string &str, string &to_str, const EvaluationOptions &eo) const Calculator
setDefaultAssumptions(Assumptions *ass)Calculator
setLocale()Calculator
setPrecision(int precision=DEFAULT_PRECISION)Calculator
setRPNRegister(size_t index, MathStructure *mstruct, int msecs, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
setRPNRegister(size_t index, string str, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true) (defined in Calculator)Calculator
setRPNRegister(size_t index, MathStructure *mstruct, bool eval=false, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
setRPNRegister(size_t index, string str, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true) (defined in Calculator)Calculator
showArgumentErrors() const (defined in Calculator)Calculator
signs (defined in Calculator)Calculator [protected]
stillHasFunction(MathFunction *f)Calculator
stillHasUnit(Unit *u)Calculator
stillHasVariable(Variable *v)Calculator
stopped_errors_count (defined in Calculator)Calculator [protected]
stopped_messages_count (defined in Calculator)Calculator [protected]
stopped_warnings_count (defined in Calculator)Calculator [protected]
terminateThreads()Calculator
testCondition(string expression) (defined in Calculator)Calculator
times_str (defined in Calculator)Calculator [protected]
times_str_len (defined in Calculator)Calculator [protected]
tmp_evaluationoptions (defined in Calculator)Calculator
tmp_maketodivision (defined in Calculator)Calculator
tmp_parsedstruct (defined in Calculator)Calculator
tmp_print_result (defined in Calculator)Calculator
tmp_printoptions (defined in Calculator)Calculator
tmp_proc_command (defined in Calculator)Calculator
tmp_rpn_mstruct (defined in Calculator)Calculator
tmp_rpnindex (defined in Calculator)Calculator
tmp_tostruct (defined in Calculator)Calculator
u_deg (defined in Calculator)Calculator
u_euro (defined in Calculator)Calculator
u_gra (defined in Calculator)Calculator
u_rad (defined in Calculator)Calculator
ufv (defined in Calculator)Calculator [protected]
ufv_i (defined in Calculator)Calculator [protected]
ufvl (defined in Calculator)Calculator [protected]
ufvl_i (defined in Calculator)Calculator [protected]
ufvl_t (defined in Calculator)Calculator [protected]
unitIsUsedByOtherUnits(const Unit *u) const (defined in Calculator)Calculator
unitNameChanged(Unit *u, bool new_item=false) (defined in Calculator)Calculator
unitNameIsValid(const string &name_) (defined in Calculator)Calculator
unitNameIsValid(const char *name_) (defined in Calculator)Calculator
unitNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) (defined in Calculator)Calculator
unitNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs) (defined in Calculator)Calculator
unitNameTaken(string name, Unit *object=NULL) (defined in Calculator)Calculator
units (defined in Calculator)Calculator
unlocalizeExpression(string str, const ParseOptions &po=default_parse_options) const Calculator
unsetLocale()Calculator
useDecimalComma() (defined in Calculator)Calculator
useDecimalPoint() (defined in Calculator)Calculator
utf8_pos_is_valid_in_name(char *pos) (defined in Calculator)Calculator
v_e (defined in Calculator)Calculator
v_i (defined in Calculator)Calculator
v_inf (defined in Calculator)Calculator
v_minf (defined in Calculator)Calculator
v_pi (defined in Calculator)Calculator
v_pinf (defined in Calculator)Calculator
v_undef (defined in Calculator)Calculator
v_x (defined in Calculator)Calculator
v_y (defined in Calculator)Calculator
v_z (defined in Calculator)Calculator
variableNameChanged(Variable *v, bool new_item=false) (defined in Calculator)Calculator
variableNameIsValid(const string &name_)Calculator
variableNameIsValid(const char *name_)Calculator
variableNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) (defined in Calculator)Calculator
variableNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs) (defined in Calculator)Calculator
variableNameTaken(string name, Variable *object=NULL) (defined in Calculator)Calculator
variables (defined in Calculator)Calculator
vbuffer (defined in Calculator)Calculator [protected]
XOR_str (defined in Calculator)Calculator [protected]
XOR_str_len (defined in Calculator)Calculator [protected]
~Calculator() (defined in Calculator)Calculator [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x6d.html0000644000175100017510000000762511320655045021533 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- m -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDataProperty-members.html0000644000175100017510000003177511320655045022746 00000000000000 libqalculate-0.9.7: Member List

DataProperty Member List

This is the complete list of members for DataProperty, including all inherited members.

addName(string s_name, bool is_ref=false, size_t index=0) (defined in DataProperty)DataProperty
b_approximate (defined in DataProperty)DataProperty [protected]
b_brackets (defined in DataProperty)DataProperty [protected]
b_case (defined in DataProperty)DataProperty [protected]
b_hide (defined in DataProperty)DataProperty [protected]
b_key (defined in DataProperty)DataProperty [protected]
b_uchanged (defined in DataProperty)DataProperty [protected]
clearNames() (defined in DataProperty)DataProperty
countNames() const (defined in DataProperty)DataProperty
DataProperty(DataSet *parent_set, string s_name="", string s_title="", string s_description="")DataProperty
DataProperty(const DataProperty &dp) (defined in DataProperty)DataProperty
description() const (defined in DataProperty)DataProperty
generateStruct(const string &valuestr, int is_approximate=-1) (defined in DataProperty)DataProperty
getDisplayString(const string &valuestr) (defined in DataProperty)DataProperty
getInputString(const string &valuestr) (defined in DataProperty)DataProperty
getName(size_t index=1) const (defined in DataProperty)DataProperty
getReferenceName() const (defined in DataProperty)DataProperty
getUnitString() const (defined in DataProperty)DataProperty
getUnitStruct() (defined in DataProperty)DataProperty
hasName(const string &s_name) (defined in DataProperty)DataProperty
isApproximate() const (defined in DataProperty)DataProperty
isCaseSensitive() const (defined in DataProperty)DataProperty
isHidden() const (defined in DataProperty)DataProperty
isKey() const (defined in DataProperty)DataProperty
isUserModified() const (defined in DataProperty)DataProperty
m_unit (defined in DataProperty)DataProperty [protected]
name_is_ref (defined in DataProperty)DataProperty [protected]
nameIsReference(size_t index=1) const (defined in DataProperty)DataProperty
names (defined in DataProperty)DataProperty [protected]
parent (defined in DataProperty)DataProperty [protected]
parentSet() const (defined in DataProperty)DataProperty
propertyType() const (defined in DataProperty)DataProperty
ptype (defined in DataProperty)DataProperty [protected]
sdescr (defined in DataProperty)DataProperty [protected]
set(const DataProperty &dp) (defined in DataProperty)DataProperty
setApproximate(bool is_approximate=true) (defined in DataProperty)DataProperty
setCaseSensitive(bool is_case_sensitive=true) (defined in DataProperty)DataProperty
setDescription(string s_description) (defined in DataProperty)DataProperty
setHidden(bool is_hidden=true) (defined in DataProperty)DataProperty
setKey(bool is_key=true) (defined in DataProperty)DataProperty
setName(string s_name, bool is_ref=false) (defined in DataProperty)DataProperty
setNameIsReference(size_t index=1, bool is_ref=true) (defined in DataProperty)DataProperty
setPropertyType(PropertyType property_type) (defined in DataProperty)DataProperty
setTitle(string s_title) (defined in DataProperty)DataProperty
setUnit(string s_unit) (defined in DataProperty)DataProperty
setUserModified(bool user_modified=true) (defined in DataProperty)DataProperty
setUsesBrackets(bool uses_brackets=true) (defined in DataProperty)DataProperty
stitle (defined in DataProperty)DataProperty [protected]
sunit (defined in DataProperty)DataProperty [protected]
title(bool return_name_if_no_title=true) const (defined in DataProperty)DataProperty
usesBrackets() const (defined in DataProperty)DataProperty


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classNumberArgument.html0000644000175100017510000004516411320655045021630 00000000000000 libqalculate-0.9.7: NumberArgument Class Reference

NumberArgument Class Reference

A definition for numerical arguments. More...

#include <Function.h>

Inheritance diagram for NumberArgument:

Argument

List of all members.

Public Member Functions

 NumberArgument (string name_="", ArgumentMinMaxPreDefinition minmax=ARGUMENT_MIN_MAX_NONE, bool does_test=true, bool does_error=true)
 NumberArgument (const NumberArgument *arg)
virtual void set (const Argument *arg)
virtual Argumentcopy () const
virtual string print () const
void setMin (const Number *nmin)
void setIncludeEqualsMin (bool include_equals)
bool includeEqualsMin () const
const Numbermin () const
void setMax (const Number *nmax)
void setIncludeEqualsMax (bool include_equals)
bool includeEqualsMax () const
const Numbermax () const
bool complexAllowed () const
void setComplexAllowed (bool allow_complex)
bool rationalNumber () const
void setRationalNumber (bool rational_number)
virtual int type () const

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const

Protected Attributes

Numberfmin
Numberfmax
bool b_incl_min
bool b_incl_max
bool b_complex
bool b_rational_number


Detailed Description

A definition for numerical arguments.

These arguments allows numerical values. The value can be restricted to real or rational numbers (defaults to allow all numbers, including complex), and a max and/or min value.


Member Function Documentation

virtual bool NumberArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented from Argument.

virtual string NumberArgument::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented from Argument.

virtual void NumberArgument::set ( const Argument arg  )  [virtual]

Sets the argument to a copy of an argument definition.

Parameters:
arg Argument to copy.

Reimplemented from Argument.

virtual Argument* NumberArgument::copy (  )  const [virtual]

Returns a copy of the argument definition.

Returns:
A copy.

Reimplemented from Argument.

virtual string NumberArgument::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented from Argument.

virtual int NumberArgument::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x67.html0000644000175100017510000001634311320655045020440 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- g -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classBooleanArgument.html0000644000175100017510000002514511320655045021754 00000000000000 libqalculate-0.9.7: BooleanArgument Class Reference

BooleanArgument Class Reference

A boolean argument. More...

#include <Function.h>

Inheritance diagram for BooleanArgument:

Argument

List of all members.

Public Member Functions

 BooleanArgument (string name_="", bool does_test=true, bool does_error=true)
 BooleanArgument (const BooleanArgument *arg)
virtual int type () const
virtual Argumentcopy () const
virtual string print () const

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const


Detailed Description

A boolean argument.

Accepts zero or one.


Member Function Documentation

virtual bool BooleanArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented from Argument.

virtual string BooleanArgument::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented from Argument.

virtual int BooleanArgument::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented from Argument.

virtual Argument* BooleanArgument::copy (  )  const [virtual]

Returns a copy of the argument definition.

Returns:
A copy.

Reimplemented from Argument.

virtual string BooleanArgument::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented from Argument.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classMathStructure-members.html0000644000175100017510000031104611320655045023132 00000000000000 libqalculate-0.9.7: Member List

MathStructure Member List

This is the complete list of members for MathStructure, including all inherited members.

add(const MathStructure &o, MathOperation op, bool append=false) (defined in MathStructure)MathStructure
add(const MathStructure &o, bool append=false) (defined in MathStructure)MathStructure
add(const Number &o, bool append=false) (defined in MathStructure)MathStructure
add(int i, bool append=false) (defined in MathStructure)MathStructure
add(Variable *v, bool append=false) (defined in MathStructure)MathStructure
add(Unit *u, bool append=false) (defined in MathStructure)MathStructure
add(string sym, bool append=false) (defined in MathStructure)MathStructure
add_nocopy(MathStructure *o, MathOperation op, bool append=false) (defined in MathStructure)MathStructure
add_nocopy(MathStructure *o, bool append=false) (defined in MathStructure)MathStructure
addChild(const MathStructure &o) (defined in MathStructure)MathStructure
addChild_nocopy(MathStructure *o) (defined in MathStructure)MathStructure
addColumn(const MathStructure &mfill) (defined in MathStructure)MathStructure
addColumns(size_t c, const MathStructure &mfill) (defined in MathStructure)MathStructure
addRow(const MathStructure &mfill) (defined in MathStructure)MathStructure
addRows(size_t r, const MathStructure &mfill) (defined in MathStructure)MathStructure
adjointMatrix(const EvaluationOptions &eo) (defined in MathStructure)MathStructure
b_approx (defined in MathStructure)MathStructure [protected]
b_plural (defined in MathStructure)MathStructure [protected]
b_protected (defined in MathStructure)MathStructure [protected]
base() const (defined in MathStructure)MathStructure
base() (defined in MathStructure)MathStructure
calculateAdd(const MathStructure &madd, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateAddIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateAddLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseAnd(const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseAndIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseAndLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseNot(const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseOr(const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseOrIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseOrLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseXor(const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseXorIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseXorLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateDivide(const MathStructure &mdiv, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateFunctions(const EvaluationOptions &eo, bool recursive=true) (defined in MathStructure)MathStructure
calculateInverse(const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalAnd(const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalAndIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalAndLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalNot(const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalOr(const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalOrIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalOrLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalXor(const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalXorLast(const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateMergeIndex(size_t index, const EvaluationOptions &eo, const EvaluationOptions &feo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateMultiply(const MathStructure &mmul, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateMultiplyIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateMultiplyLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateNegate(const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateRaise(const MathStructure &mexp, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateRaiseExponent(const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateReplace(const MathStructure &mfrom, const MathStructure &mto, const EvaluationOptions &eo) (defined in MathStructure)MathStructure
calculatesub(const EvaluationOptions &eo, const EvaluationOptions &feo, bool recursive=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateSubtract(const MathStructure &msub, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateUncertaintyPropagation(const EvaluationOptions &eo) (defined in MathStructure)MathStructure
CHILD(size_t v_index) const (defined in MathStructure)MathStructure [protected]
childrenUpdated(bool recursive=false)MathStructure
childToFront(size_t index) (defined in MathStructure)MathStructure
childUpdated(size_t index, bool recursive=false)MathStructure
clear(bool preserve_precision=false)MathStructure
clearMatrix(bool preserve_precision=false)MathStructure
clearVector(bool preserve_precision=false)MathStructure
coefficient(const MathStructure &xvar, const Number &pownr, MathStructure &mcoeff) const (defined in MathStructure)MathStructure
cofactor(size_t r, size_t c, MathStructure &mstruct, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
columns() const (defined in MathStructure)MathStructure
columnToVector(size_t c, MathStructure &mstruct) const (defined in MathStructure)MathStructure
compare(const MathStructure &o) const (defined in MathStructure)MathStructure
compareApproximately(const MathStructure &o) const (defined in MathStructure)MathStructure
comparisonType() const (defined in MathStructure)MathStructure
contains(const MathStructure &mstruct, bool structural_only=true, bool check_variables=false, bool check_functions=false) const (defined in MathStructure)MathStructure
containsAdditionPower() const (defined in MathStructure)MathStructure
containsDivision() const (defined in MathStructure)MathStructure
containsOpaqueContents() const (defined in MathStructure)MathStructure
containsRepresentativeOf(const MathStructure &mstruct, bool check_variables=false, bool check_functions=false) const (defined in MathStructure)MathStructure
containsRepresentativeOfType(StructureType mtype, bool check_variables=false, bool check_functions=false) const (defined in MathStructure)MathStructure
containsType(StructureType mtype, bool structural_only=true, bool check_variables=false, bool check_functions=false) const (defined in MathStructure)MathStructure
containsUnknowns() const (defined in MathStructure)MathStructure
convert(Unit *u, bool convert_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options) (defined in MathStructure)MathStructure
convert(const MathStructure unit_mstruct, bool convert_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options) (defined in MathStructure)MathStructure
countChildren() const (defined in MathStructure)MathStructure
countFunctions(bool count_subfunctions=true) const (defined in MathStructure)MathStructure
countTotalChildren(bool count_function_as_one=true) const (defined in MathStructure)MathStructure
ct_comp (defined in MathStructure)MathStructure [protected]
degree(const MathStructure &xvar) const (defined in MathStructure)MathStructure
delChild(size_t index) (defined in MathStructure)MathStructure
determinant(MathStructure &mstruct, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
differentiate(const MathStructure &x_var, const EvaluationOptions &eo) (defined in MathStructure)MathStructure
dissolveAllCompositeUnits() (defined in MathStructure)MathStructure
divide(const MathStructure &o, bool append=false) (defined in MathStructure)MathStructure
divide(const Number &o, bool append=false) (defined in MathStructure)MathStructure
divide(int i, bool append=false) (defined in MathStructure)MathStructure
divide(Variable *v, bool append=false) (defined in MathStructure)MathStructure
divide(Unit *u, bool append=false) (defined in MathStructure)MathStructure
divide(string sym, bool append=false) (defined in MathStructure)MathStructure
divide_nocopy(MathStructure *o, bool append=false) (defined in MathStructure)MathStructure
equals(const MathStructure &o) const (defined in MathStructure)MathStructure
equals(const Number &o) const (defined in MathStructure)MathStructure
equals(int i) const (defined in MathStructure)MathStructure
equals(Unit *u) const (defined in MathStructure)MathStructure
equals(Variable *v) const (defined in MathStructure)MathStructure
equals(string sym) const (defined in MathStructure)MathStructure
eval(const EvaluationOptions &eo=default_evaluation_options) (defined in MathStructure)MathStructure
evalSort(bool recursive=false) (defined in MathStructure)MathStructure
exponent() const (defined in MathStructure)MathStructure
exponent() (defined in MathStructure)MathStructure
factorize(const EvaluationOptions &eo=default_evaluation_options) (defined in MathStructure)MathStructure
factorizeUnits() (defined in MathStructure)MathStructure
find_x_var() const (defined in MathStructure)MathStructure
findAllUnknowns(MathStructure &unknowns_vector) (defined in MathStructure)MathStructure
flattenVector(MathStructure &mstruct) const (defined in MathStructure)MathStructure
format(const PrintOptions &po=default_print_options) (defined in MathStructure)MathStructure
formatsub(const PrintOptions &po=default_print_options, MathStructure *parent=NULL, size_t pindex=0, bool recursive=true) (defined in MathStructure)MathStructure
function() const (defined in MathStructure)MathStructure
function_value (defined in MathStructure)MathStructure [protected]
functionValue() const (defined in MathStructure)MathStructure
gaussianElimination(const EvaluationOptions &eo=default_evaluation_options, bool det=false) (defined in MathStructure)MathStructure
gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mresult, const EvaluationOptions &eo, MathStructure *ca=NULL, MathStructure *cb=NULL, bool check_args=true) (defined in MathStructure)MathStructure [static]
generateVector(MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector=NULL, const EvaluationOptions &eo=default_evaluation_options) const (defined in MathStructure)MathStructure
generateVector(MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector=NULL, const EvaluationOptions &eo=default_evaluation_options) const (defined in MathStructure)MathStructure
generateVector(MathStructure x_mstruct, const MathStructure &x_vector, const EvaluationOptions &eo=default_evaluation_options) const (defined in MathStructure)MathStructure
getArea(size_t r1, size_t c1, size_t r2, size_t c2, MathStructure &mstruct) const (defined in MathStructure)MathStructure
getChild(size_t index) const (defined in MathStructure)MathStructure
getChild(size_t index) (defined in MathStructure)MathStructure
getElement(size_t row, size_t column) const (defined in MathStructure)MathStructure
getElement(size_t row, size_t column) (defined in MathStructure)MathStructure
getIdentityMatrix(MathStructure &mstruct) const (defined in MathStructure)MathStructure
getRange(int start, int end, MathStructure &mstruct) const (defined in MathStructure)MathStructure
hasNegativeSign() const (defined in MathStructure)MathStructure
i_precision (defined in MathStructure)MathStructure [protected]
i_ref (defined in MathStructure)MathStructure [protected]
improve_division_multipliers(const PrintOptions &po=default_print_options) (defined in MathStructure)MathStructure
init() (defined in MathStructure)MathStructure [protected]
insertChild(const MathStructure &o, size_t index) (defined in MathStructure)MathStructure
insertChild_nocopy(MathStructure *o, size_t index) (defined in MathStructure)MathStructure
integerFactorize() (defined in MathStructure)MathStructure
integrate(const MathStructure &x_var, const EvaluationOptions &eo) (defined in MathStructure)MathStructure
inverse() (defined in MathStructure)MathStructure
invertMatrix(const EvaluationOptions &eo) (defined in MathStructure)MathStructure
isAddition() const (defined in MathStructure)MathStructure
isApproximate() const (defined in MathStructure)MathStructure
isBitwiseAnd() const (defined in MathStructure)MathStructure
isBitwiseNot() const (defined in MathStructure)MathStructure
isBitwiseOr() const (defined in MathStructure)MathStructure
isBitwiseXor() const (defined in MathStructure)MathStructure
isComparison() const (defined in MathStructure)MathStructure
isDivision() const (defined in MathStructure)MathStructure
isEmptySymbol() const (defined in MathStructure)MathStructure
isFunction() const (defined in MathStructure)MathStructure
isInfinity() const (defined in MathStructure)MathStructure
isInteger() const (defined in MathStructure)MathStructure
isInverse() const (defined in MathStructure)MathStructure
isLogicalAnd() const (defined in MathStructure)MathStructure
isLogicalNot() const (defined in MathStructure)MathStructure
isLogicalOr() const (defined in MathStructure)MathStructure
isLogicalXor() const (defined in MathStructure)MathStructure
isMatrix() const (defined in MathStructure)MathStructure
isMinusOne() const (defined in MathStructure)MathStructure
isMultiplication() const (defined in MathStructure)MathStructure
isNegate() const (defined in MathStructure)MathStructure
isNumber() const (defined in MathStructure)MathStructure
isNumber_exp() const (defined in MathStructure)MathStructure
isNumericMatrix() const (defined in MathStructure)MathStructure
isolate_x(const EvaluationOptions &eo, const MathStructure &x_var=m_undefined, bool check_result=false) (defined in MathStructure)MathStructure
isolate_x(const EvaluationOptions &eo, const EvaluationOptions &feo, const MathStructure &x_var=m_undefined, bool check_result=false) (defined in MathStructure)MathStructure
isolate_x_sub(const EvaluationOptions &eo, EvaluationOptions &eo2, const MathStructure &x_var, MathStructure *morig=NULL) (defined in MathStructure)MathStructure [protected]
isOne() const (defined in MathStructure)MathStructure
isPlural() const (defined in MathStructure)MathStructure
isPower() const (defined in MathStructure)MathStructure
isProtected() const (defined in MathStructure)MathStructure
isRationalPolynomial() const MathStructure
isSymbolic() const (defined in MathStructure)MathStructure
isUndefined() const (defined in MathStructure)MathStructure
isUnit() const (defined in MathStructure)MathStructure
isUnit_exp() const (defined in MathStructure)MathStructure
isUnitCompatible(const MathStructure &mstruct) (defined in MathStructure)MathStructure
isVariable() const (defined in MathStructure)MathStructure
isVector() const (defined in MathStructure)MathStructure
isZero() const (defined in MathStructure)MathStructure
lcm(const MathStructure &m1, const MathStructure &m2, MathStructure &mlcm, const EvaluationOptions &eo, bool check_args=true) (defined in MathStructure)MathStructure [static]
lcoefficient(const MathStructure &xvar, MathStructure &mcoeff) const (defined in MathStructure)MathStructure
ldegree(const MathStructure &xvar) const (defined in MathStructure)MathStructure
m_type (defined in MathStructure)MathStructure [protected]
MathStructure()MathStructure
MathStructure(const MathStructure &o)MathStructure
MathStructure(int num, int den=1, int exp10=0)MathStructure
MathStructure(string sym)MathStructure
MathStructure(double float_value)MathStructure
MathStructure(const MathStructure *o,...)MathStructure
MathStructure(MathFunction *o,...)MathStructure
MathStructure(Unit *u, Prefix *p=NULL)MathStructure
MathStructure(Variable *o)MathStructure
MathStructure(const Number &o)MathStructure
matrixIsSquare() const (defined in MathStructure)MathStructure
matrixToVector(MathStructure &mstruct) const (defined in MathStructure)MathStructure
maxCoefficient() (defined in MathStructure)MathStructure
merge_addition(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_bitwise_and(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_bitwise_or(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_bitwise_xor(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_logical_and(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_logical_or(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_logical_xor(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_multiplication(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false, bool do_append=true) (defined in MathStructure)MathStructure
merge_power(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
mergePrecision(const MathStructure &o) (defined in MathStructure)MathStructure
multiply(const MathStructure &o, bool append=false) (defined in MathStructure)MathStructure
multiply(const Number &o, bool append=false) (defined in MathStructure)MathStructure
multiply(int i, bool append=false) (defined in MathStructure)MathStructure
multiply(Variable *v, bool append=false) (defined in MathStructure)MathStructure
multiply(Unit *u, bool append=false) (defined in MathStructure)MathStructure
multiply(string sym, bool append=false) (defined in MathStructure)MathStructure
multiply_nocopy(MathStructure *o, bool append=false) (defined in MathStructure)MathStructure
neededMultiplicationSign(const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool par, bool par_prev, bool flat_division=true, bool flat_power=true) const (defined in MathStructure)MathStructure
needsParenthesis(const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool flat_division=true, bool flat_power=true) const (defined in MathStructure)MathStructure
negate() (defined in MathStructure)MathStructure
number() const (defined in MathStructure)MathStructure
number() (defined in MathStructure)MathStructure
numberUpdated() (defined in MathStructure)MathStructure
o_function (defined in MathStructure)MathStructure [protected]
o_number (defined in MathStructure)MathStructure [protected]
o_prefix (defined in MathStructure)MathStructure [protected]
o_uncertainty (defined in MathStructure)MathStructure [protected]
o_unit (defined in MathStructure)MathStructure [protected]
o_variable (defined in MathStructure)MathStructure [protected]
operator &&(const MathStructure &o) const (defined in MathStructure)MathStructure
operator!() const (defined in MathStructure)MathStructure
operator!=(const MathStructure &o) const (defined in MathStructure)MathStructure
operator*(const MathStructure &o) const (defined in MathStructure)MathStructure
operator*=(const MathStructure &o) (defined in MathStructure)MathStructure
operator*=(const Number &o) (defined in MathStructure)MathStructure
operator*=(int i) (defined in MathStructure)MathStructure
operator*=(Unit *u) (defined in MathStructure)MathStructure
operator*=(Variable *v) (defined in MathStructure)MathStructure
operator*=(string sym) (defined in MathStructure)MathStructure
operator+(const MathStructure &o) const (defined in MathStructure)MathStructure
operator+=(const MathStructure &o) (defined in MathStructure)MathStructure
operator+=(const Number &o) (defined in MathStructure)MathStructure
operator+=(int i) (defined in MathStructure)MathStructure
operator+=(Unit *u) (defined in MathStructure)MathStructure
operator+=(Variable *v) (defined in MathStructure)MathStructure
operator+=(string sym) (defined in MathStructure)MathStructure
operator-() const (defined in MathStructure)MathStructure
operator-(const MathStructure &o) const (defined in MathStructure)MathStructure
operator-=(const MathStructure &o) (defined in MathStructure)MathStructure
operator-=(const Number &o) (defined in MathStructure)MathStructure
operator-=(int i) (defined in MathStructure)MathStructure
operator-=(Unit *u) (defined in MathStructure)MathStructure
operator-=(Variable *v) (defined in MathStructure)MathStructure
operator-=(string sym) (defined in MathStructure)MathStructure
operator/(const MathStructure &o) const (defined in MathStructure)MathStructure
operator/=(const MathStructure &o) (defined in MathStructure)MathStructure
operator/=(const Number &o) (defined in MathStructure)MathStructure
operator/=(int i) (defined in MathStructure)MathStructure
operator/=(Unit *u) (defined in MathStructure)MathStructure
operator/=(Variable *v) (defined in MathStructure)MathStructure
operator/=(string sym) (defined in MathStructure)MathStructure
operator=(const MathStructure &o) (defined in MathStructure)MathStructure
operator=(const Number &o) (defined in MathStructure)MathStructure
operator=(int i) (defined in MathStructure)MathStructure
operator=(Unit *u) (defined in MathStructure)MathStructure
operator=(Variable *v) (defined in MathStructure)MathStructure
operator=(string sym) (defined in MathStructure)MathStructure
operator==(const MathStructure &o) const (defined in MathStructure)MathStructure
operator==(const Number &o) const (defined in MathStructure)MathStructure
operator==(int i) const (defined in MathStructure)MathStructure
operator==(Unit *u) const (defined in MathStructure)MathStructure
operator==(Variable *v) const (defined in MathStructure)MathStructure
operator==(string sym) const (defined in MathStructure)MathStructure
operator[](size_t index)MathStructure
operator[](size_t index) const MathStructure
operator^(const MathStructure &o) const (defined in MathStructure)MathStructure
operator^=(const MathStructure &o) (defined in MathStructure)MathStructure
operator^=(const Number &o) (defined in MathStructure)MathStructure
operator^=(int i) (defined in MathStructure)MathStructure
operator^=(Unit *u) (defined in MathStructure)MathStructure
operator^=(Variable *v) (defined in MathStructure)MathStructure
operator^=(string sym) (defined in MathStructure)MathStructure
operator||(const MathStructure &o) const (defined in MathStructure)MathStructure
overallCoefficient() const (defined in MathStructure)MathStructure
permanent(MathStructure &mstruct, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
pivot(size_t ro, size_t co, bool symbolic=true) (defined in MathStructure)MathStructure
polynomialContent(const MathStructure &xvar, MathStructure &mcontent, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
polynomialDivide(const MathStructure &mnum, const MathStructure &mden, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args=true) (defined in MathStructure)MathStructure [static]
polynomialPrimpart(const MathStructure &xvar, MathStructure &mprim, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
polynomialPrimpart(const MathStructure &xvar, const MathStructure &c, MathStructure &mprim, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
polynomialQuotient(const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args=true) (defined in MathStructure)MathStructure [static]
polynomialUnit(const MathStructure &xvar) const (defined in MathStructure)MathStructure
polynomialUnitContentPrimpart(const MathStructure &xvar, int &munit, MathStructure &mcontent, MathStructure &mprim, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
postFormatUnits(const PrintOptions &po=default_print_options, MathStructure *parent=NULL, size_t pindex=0) (defined in MathStructure)MathStructure
precision() const (defined in MathStructure)MathStructure
prefix() const (defined in MathStructure)MathStructure
prefixCurrencies() (defined in MathStructure)MathStructure
print(const PrintOptions &po=default_print_options, const InternalPrintStruct &ips=top_ips) const (defined in MathStructure)MathStructure
raise(const MathStructure &o) (defined in MathStructure)MathStructure
raise(const Number &o) (defined in MathStructure)MathStructure
raise(int i) (defined in MathStructure)MathStructure
raise(Variable *v) (defined in MathStructure)MathStructure
raise(Unit *u) (defined in MathStructure)MathStructure
raise(string sym) (defined in MathStructure)MathStructure
raise_nocopy(MathStructure *o) (defined in MathStructure)MathStructure
rankVector(bool ascending=true) (defined in MathStructure)MathStructure
ref() (defined in MathStructure)MathStructure
refcount() const (defined in MathStructure)MathStructure
removeType(StructureType mtype) (defined in MathStructure)MathStructure
replace(const MathStructure &mfrom, const MathStructure &mto) (defined in MathStructure)MathStructure
replace(const MathStructure &mfrom1, const MathStructure &mto1, const MathStructure &mfrom2, const MathStructure &mto2) (defined in MathStructure)MathStructure
representsBoolean() const (defined in MathStructure)MathStructure
representsComplex(bool allow_units=false) const (defined in MathStructure)MathStructure
representsEven(bool allow_units=false) const (defined in MathStructure)MathStructure
representsInteger(bool allow_units=false) const (defined in MathStructure)MathStructure
representsNegative(bool allow_units=false) const (defined in MathStructure)MathStructure
representsNonMatrix() const (defined in MathStructure)MathStructure
representsNonNegative(bool allow_units=false) const (defined in MathStructure)MathStructure
representsNonPositive(bool allow_units=false) const (defined in MathStructure)MathStructure
representsNonZero(bool allow_units=false) const (defined in MathStructure)MathStructure
representsNumber(bool allow_units=false) const (defined in MathStructure)MathStructure
representsOdd(bool allow_units=false) const (defined in MathStructure)MathStructure
representsPositive(bool allow_units=false) const (defined in MathStructure)MathStructure
representsRational(bool allow_units=false) const (defined in MathStructure)MathStructure
representsReal(bool allow_units=false) const (defined in MathStructure)MathStructure
representsUndefined(bool include_childs=false, bool include_infinite=false, bool be_strict=false) const (defined in MathStructure)MathStructure
representsZero(bool allow_units=false) const (defined in MathStructure)MathStructure
resizeMatrix(size_t r, size_t c, const MathStructure &mfill) (defined in MathStructure)MathStructure
resizeVector(size_t i, const MathStructure &mfill) (defined in MathStructure)MathStructure
rows() const (defined in MathStructure)MathStructure
rowToVector(size_t r, MathStructure &mstruct) const (defined in MathStructure)MathStructure
s_sym (defined in MathStructure)MathStructure [protected]
set(const MathStructure &o, bool merge_precision=false)MathStructure
set(int num, int den=1, int exp10=0, bool preserve_precision=false)MathStructure
set(string sym, bool preserve_precision=false)MathStructure
set(double float_value, bool preserve_precision=false)MathStructure
set(MathFunction *o,...)MathStructure
set(Unit *u, Prefix *p=NULL, bool preserve_precision=false)MathStructure
set(Variable *o, bool preserve_precision=false)MathStructure
set(const Number &o, bool preserve_precision=false)MathStructure
set_nocopy(MathStructure &o, bool merge_precision=false)MathStructure
setApproximate(bool is_approx=true) (defined in MathStructure)MathStructure
setBitwiseNot() (defined in MathStructure)MathStructure
setChild(const MathStructure &o, size_t index=1) (defined in MathStructure)MathStructure
setChild_nocopy(MathStructure *o, size_t index=1) (defined in MathStructure)MathStructure
setComparisonType(ComparisonType comparison_type) (defined in MathStructure)MathStructure
setElement(const MathStructure &mstruct, size_t row, size_t column) (defined in MathStructure)MathStructure
setFunction(MathFunction *f) (defined in MathStructure)MathStructure
setInfinity(bool preserve_precision=false) (defined in MathStructure)MathStructure
setLogicalNot() (defined in MathStructure)MathStructure
setPlural(bool is_plural) (defined in MathStructure)MathStructure
setPrecision(int prec) (defined in MathStructure)MathStructure
setPrefix(Prefix *p) (defined in MathStructure)MathStructure
setPrefixes(const PrintOptions &po=default_print_options, MathStructure *parent=NULL, size_t pindex=0) (defined in MathStructure)MathStructure
setProtected(bool do_protect=true) (defined in MathStructure)MathStructure
setToChild(size_t index, bool merge_precision=false, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
setToIdentityMatrix(size_t n) (defined in MathStructure)MathStructure
setType(StructureType mtype)MathStructure
setUncertainty(const MathStructure &o) (defined in MathStructure)MathStructure
setUndefined(bool preserve_precision=false)MathStructure
setUnit(Unit *u) (defined in MathStructure)MathStructure
setVariable(Variable *v) (defined in MathStructure)MathStructure
setVector(const MathStructure *o,...)MathStructure
simplify(const EvaluationOptions &eo=default_evaluation_options, bool unfactorize=true) (defined in MathStructure)MathStructure
size() const (defined in MathStructure)MathStructure
sort(const PrintOptions &po=default_print_options, bool recursive=true) (defined in MathStructure)MathStructure
sortVector(bool ascending=true) (defined in MathStructure)MathStructure
subtract(const MathStructure &o, bool append=false) (defined in MathStructure)MathStructure
subtract(const Number &o, bool append=false) (defined in MathStructure)MathStructure
subtract(int i, bool append=false) (defined in MathStructure)MathStructure
subtract(Variable *v, bool append=false) (defined in MathStructure)MathStructure
subtract(Unit *u, bool append=false) (defined in MathStructure)MathStructure
subtract(string sym, bool append=false) (defined in MathStructure)MathStructure
subtract_nocopy(MathStructure *o, bool append=false) (defined in MathStructure)MathStructure
swapChildren(size_t index1, size_t index2) (defined in MathStructure)MathStructure
symbol() const (defined in MathStructure)MathStructure
syncUnits(bool sync_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options) (defined in MathStructure)MathStructure
tcoefficient(const MathStructure &xvar, MathStructure &mcoeff) const (defined in MathStructure)MathStructure
testCompositeUnit(Unit *u) (defined in MathStructure)MathStructure
testDissolveCompositeUnit(Unit *u) (defined in MathStructure)MathStructure
transform(StructureType mtype, const MathStructure &o) (defined in MathStructure)MathStructure
transform(StructureType mtype, const Number &o) (defined in MathStructure)MathStructure
transform(StructureType mtype, int i) (defined in MathStructure)MathStructure
transform(StructureType mtype, Unit *u) (defined in MathStructure)MathStructure
transform(StructureType mtype, Variable *v) (defined in MathStructure)MathStructure
transform(StructureType mtype, string sym) (defined in MathStructure)MathStructure
transform(StructureType mtype) (defined in MathStructure)MathStructure
transform_nocopy(StructureType mtype, MathStructure *o) (defined in MathStructure)MathStructure
transposeMatrix() (defined in MathStructure)MathStructure
type() const (defined in MathStructure)MathStructure
uncertainty() const (defined in MathStructure)MathStructure
unformat(const EvaluationOptions &eo=default_evaluation_options) (defined in MathStructure)MathStructure
unit() const (defined in MathStructure)MathStructure
unref() (defined in MathStructure)MathStructure
v_order (defined in MathStructure)MathStructure [protected]
v_subs (defined in MathStructure)MathStructure [protected]
variable() const (defined in MathStructure)MathStructure
~MathStructure() (defined in MathStructure)MathStructure


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/annotated.html0000644000175100017510000002136511320655045017621 00000000000000 libqalculate-0.9.7: Class List

Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
AliasUnitAn unit with relation to another unit
AliasUnit_CompositeA subunit in a CompositeUnit
ArgumentA mathematical function argument definition with free value and base class for all argument definitions
ArgumentSetA set of accepted arguments
AssumptionsAn assumption about an unknown mathematical value
BinaryPrefixA binary prefix
BooleanArgumentA boolean argument
CalculatorThe almighty calculator class
CalculatorMessageA message with information to the user. Primarily used for errors and warnings
CompositeUnitA unit consisting of a number of other units
DataObjectA a data set object
DataObjectArgumentData object function argument
DataPropertyA data set property
DataPropertyArgumentData property function argument
DataSetA data set
DateArgumentA date argument
DecimalPrefixA decimal (metric) prefix
DynamicVariableAbstract base class for variables with a value which is recalculated when the precision has changed
EvaluationOptionsOptions for calculation
ExpressionItemAbstract base class for functions, variables and units
ExpressionItemArgumentArgument for functions, variables and units
ExpressionNameA name for an expression item (function, variable or unit)
FunctionArgumentA function argument
IntegerArgumentA definition for integer arguments
KnownVariableA variable with a known value
MathFunctionAbstract base class for mathematical functions
MathStructureA structure representing a mathematical value/expression/result
MatrixArgumentA matrix argument
NumberA number
NumberArgumentA definition for numerical arguments
NumberPrefixA prefix with a free numerical value
ParseOptionsOptions for parsing expressions
PlotDataParametersParameters for plot data series
PlotParametersParameters passed to plotting functions
PrefixAbstract class for prefixes
PrintOptionsOptions for formatting and display of mathematical structures/results
SortOptionsOptions for ordering the parts of a mathematical expression/result before display
SymbolicArgumentA symbolic argument
TextArgumentA text argument
UnitA unit for measurement
UnknownVariableA variable with unknown value
UserFunctionA user defined mathematical function
VariableAbstract base class for variables
VectorArgumentA vector argument

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x69.html0000644000175100017510000001330511320655045021450 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- i -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x6c.html0000644000175100017510000001172411320655045021525 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- l -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x69.html0000644000175100017510000001475211320655045020444 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- i -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x73.html0000644000175100017510000003523011320655045020431 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- s -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classSymbolicArgument-members.html0000644000175100017510000002447211320655045023610 00000000000000 libqalculate-0.9.7: Member List

SymbolicArgument Member List

This is the complete list of members for SymbolicArgument, including all inherited members.

alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
copy() const SymbolicArgument [virtual]
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const SymbolicArgument [virtual]
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)Argument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
subprintlong() const SymbolicArgument [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const SymbolicArgument [protected, virtual]
suggestsQuotes() const (defined in Argument)Argument [virtual]
SymbolicArgument(string name_="", bool does_test=true, bool does_error=true) (defined in SymbolicArgument)SymbolicArgument
SymbolicArgument(const SymbolicArgument *arg) (defined in SymbolicArgument)SymbolicArgument
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const SymbolicArgument [virtual]
zeroForbidden() const Argument
~Argument()Argument [virtual]
~SymbolicArgument() (defined in SymbolicArgument)SymbolicArgument [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classUnit.png0000644000175100017510000000156411320655045017430 00000000000000PNG  IHDRPLTE`{tRNS@f IDATx]v `%φ AzN' E\@$& Hޤ(ҧ\VWАwӓ_40ӠʬF„76eZm7boݧ;)VM)n?;?M2da;  l1A)nw`ƺܣ?3߰j?YpֱCӸp7.CVxn_+dՂ% oՄ% K4 4 4 4 4 4 4 4 4 4 4 4 T_]} wGaEgJ+:p?nUgF >E-a*Ya %IPܟ^Èh-?-]ƈw.A5F _x6I+Dޣ8f/ږRi5oDshl1z[n6_;]jЋzBsfaSk{W8m4CCþZ,$tatBce@(u:^C/6$χcQ4csf=>(}\7.DS>.S~2hoh] 4˨<ﮥ}2 ֳ@p  K4 4 4 4 4 4 4 4 4 4 4 4 *O47{•hPgJg(3u9|=uYYMHC)JJU( 7ѐ^L09h%ځR=3gWcxg%ɩC),׼ =.Zh5 /}aho\l?EamXIENDB`libqalculate-0.9.7/docs/reference/html/classAliasUnit__Composite-members.html0000644000175100017510000010200011320655045024356 00000000000000 libqalculate-0.9.7: Member List

AliasUnit_Composite Member List

This is the complete list of members for AliasUnit_Composite, including all inherited members.

abbreviation(bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unit [virtual]
addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
AliasUnit(string cat_, string name_, string plural_, string singular_, string title_, Unit *alias, string relation="1", int exp=1, string inverse="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in AliasUnit)AliasUnit
AliasUnit(const AliasUnit *unit) (defined in AliasUnit)AliasUnit
AliasUnit() (defined in AliasUnit)AliasUnit
AliasUnit_Composite(Unit *alias, int exp=1, Prefix *prefix_=NULL) (defined in AliasUnit_Composite)AliasUnit_Composite
AliasUnit_Composite(const AliasUnit_Composite *unit) (defined in AliasUnit_Composite)AliasUnit_Composite
b_active (defined in ExpressionItem)ExpressionItem [protected]
b_approx (defined in ExpressionItem)ExpressionItem [protected]
b_builtin (defined in ExpressionItem)ExpressionItem [protected]
b_changed (defined in ExpressionItem)ExpressionItem [protected]
b_destroyed (defined in ExpressionItem)ExpressionItem [protected]
b_hidden (defined in ExpressionItem)ExpressionItem [protected]
b_local (defined in ExpressionItem)ExpressionItem [protected]
b_registered (defined in ExpressionItem)ExpressionItem [protected]
b_si (defined in Unit)Unit [protected]
baseExponent(int exp=1) const (defined in AliasUnit)AliasUnit [virtual]
baseUnit() const (defined in AliasUnit)AliasUnit [virtual]
category() const ExpressionItem [virtual]
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItem [virtual]
clearNames()ExpressionItem [virtual]
clearNonReferenceNames()ExpressionItem [virtual]
convert(Unit *u, MathStructure &mvalue, MathStructure &exp) const Unit
convert(Unit *u, MathStructure &mvalue) const Unit
convert(Unit *u, bool *converted=NULL) const (defined in Unit)Unit
convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnit [virtual]
convertFromBaseUnit(MathStructure &mvalue) const (defined in AliasUnit)AliasUnit [virtual]
convertFromBaseUnit() const (defined in AliasUnit)AliasUnit [virtual]
convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit_Composite)AliasUnit_Composite [virtual]
convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnit [virtual]
convertToBaseUnit(MathStructure &mvalue) const (defined in AliasUnit)AliasUnit [virtual]
convertToBaseUnit() const (defined in AliasUnit)AliasUnit [virtual]
convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit_Composite)AliasUnit_Composite [virtual]
copy() const (defined in AliasUnit_Composite)AliasUnit_Composite [virtual]
countNames() const (defined in ExpressionItem)ExpressionItem [virtual]
description() const ExpressionItem [virtual]
destroy() (defined in ExpressionItem)ExpressionItem [virtual]
expression() const (defined in AliasUnit)AliasUnit [virtual]
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
firstBaseExponent() const (defined in AliasUnit)AliasUnit [virtual]
firstBaseUnit() const (defined in AliasUnit)AliasUnit [virtual]
getName(size_t index) const ExpressionItem [virtual]
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItem [virtual]
hasChanged() const ExpressionItem [virtual]
hasComplexExpression() const (defined in AliasUnit)AliasUnit [virtual]
hasComplexRelationTo(Unit *u) const (defined in AliasUnit)AliasUnit [virtual]
hasName(const string &sname, bool case_sensitive=true) const ExpressionItem [virtual]
hasNameCaseSensitive(const string &sname) const ExpressionItem [virtual]
i_exp (defined in AliasUnit)AliasUnit [protected]
i_precision (defined in ExpressionItem)ExpressionItem [protected]
i_ref (defined in ExpressionItem)ExpressionItem [protected]
inverseExpression() const (defined in AliasUnit)AliasUnit [virtual]
isActive() const ExpressionItem [virtual]
isApproximate() const ExpressionItem [virtual]
isBuiltin() const (defined in ExpressionItem)ExpressionItem [virtual]
isChildOf(Unit *u) const AliasUnit [virtual]
isCurrency() const Unit
isHidden() const (defined in ExpressionItem)ExpressionItem [virtual]
isLocal() const (defined in ExpressionItem)ExpressionItem [virtual]
isParentOf(Unit *u) const AliasUnit [virtual]
isRegistered() const (defined in ExpressionItem)ExpressionItem
isSIUnit() const Unit
isUsedByOtherUnits() const (defined in Unit)Unit [virtual]
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItem [virtual]
names (defined in ExpressionItem)ExpressionItem [protected]
o_unit (defined in AliasUnit)AliasUnit [protected]
plural(bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unit [virtual]
precision() const ExpressionItem [virtual]
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
prefix() const (defined in AliasUnit_Composite)AliasUnit_Composite [virtual]
prefixExponent() const (defined in AliasUnit_Composite)AliasUnit_Composite [virtual]
prefixv (defined in AliasUnit_Composite)AliasUnit_Composite [protected]
print(bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const AliasUnit_Composite [virtual]
ref() (defined in ExpressionItem)ExpressionItem [virtual]
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
refcount() const ExpressionItem [virtual]
referenceName() const (defined in ExpressionItem)ExpressionItem [virtual]
removeName(size_t index) (defined in ExpressionItem)ExpressionItem [virtual]
scat (defined in ExpressionItem)ExpressionItem [protected]
sdescr (defined in ExpressionItem)ExpressionItem [protected]
set(const ExpressionItem *item) (defined in AliasUnit_Composite)AliasUnit_Composite [virtual]
set(Unit *u, int exp=1, Prefix *prefix_=NULL) (defined in AliasUnit_Composite)AliasUnit_Composite [virtual]
setActive(bool is_active) (defined in ExpressionItem)ExpressionItem [virtual]
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItem [virtual]
setAsSIUnit()Unit
setBaseUnit(Unit *alias) (defined in AliasUnit)AliasUnit [virtual]
setCategory(string cat_)ExpressionItem [virtual]
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItem [virtual]
setDescription(string descr_)ExpressionItem [virtual]
setExponent(int exp) (defined in AliasUnit)AliasUnit [virtual]
setExpression(string relation)AliasUnit [virtual]
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItem [virtual]
setInverseExpression(string inverse)AliasUnit [virtual]
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItem [virtual]
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItem [virtual]
setName(string sname, size_t index, bool force=true)ExpressionItem [virtual]
setPrecision(int prec) (defined in ExpressionItem)ExpressionItem [virtual]
setRegistered(bool is_registered)ExpressionItem
setSystem(string s_system)Unit
setTitle(string title_)ExpressionItem [virtual]
singular(bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unit [virtual]
sinverse (defined in AliasUnit)AliasUnit [protected]
ssystem (defined in Unit)Unit [protected]
stitle (defined in ExpressionItem)ExpressionItem [protected]
subtype() const AliasUnit [virtual]
svalue (defined in AliasUnit)AliasUnit [protected]
system() const Unit
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
type() const Unit [virtual]
Unit(string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Unit)Unit
Unit() (defined in Unit)Unit
Unit(const Unit *unit) (defined in Unit)Unit
unref() (defined in ExpressionItem)ExpressionItem [virtual]
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
v_refs (defined in ExpressionItem)ExpressionItem [protected]
~AliasUnit() (defined in AliasUnit)AliasUnit [virtual]
~AliasUnit_Composite() (defined in AliasUnit_Composite)AliasUnit_Composite [virtual]
~ExpressionItem() (defined in ExpressionItem)ExpressionItem [virtual]
~Unit() (defined in Unit)Unit [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classUnit-members.html0000644000175100017510000006411711320655045021243 00000000000000 libqalculate-0.9.7: Member List

Unit Member List

This is the complete list of members for Unit, including all inherited members.

abbreviation(bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unit [virtual]
addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
b_active (defined in ExpressionItem)ExpressionItem [protected]
b_approx (defined in ExpressionItem)ExpressionItem [protected]
b_builtin (defined in ExpressionItem)ExpressionItem [protected]
b_changed (defined in ExpressionItem)ExpressionItem [protected]
b_destroyed (defined in ExpressionItem)ExpressionItem [protected]
b_hidden (defined in ExpressionItem)ExpressionItem [protected]
b_local (defined in ExpressionItem)ExpressionItem [protected]
b_registered (defined in ExpressionItem)ExpressionItem [protected]
b_si (defined in Unit)Unit [protected]
baseExponent(int exp=1) const (defined in Unit)Unit [virtual]
baseUnit() const (defined in Unit)Unit [virtual]
category() const ExpressionItem [virtual]
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItem [virtual]
clearNames()ExpressionItem [virtual]
clearNonReferenceNames()ExpressionItem [virtual]
convert(Unit *u, MathStructure &mvalue, MathStructure &exp) const Unit
convert(Unit *u, MathStructure &mvalue) const Unit
convert(Unit *u, bool *converted=NULL) const (defined in Unit)Unit
convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in Unit)Unit [virtual]
convertFromBaseUnit(MathStructure &mvalue) const (defined in Unit)Unit [virtual]
convertFromBaseUnit() const (defined in Unit)Unit [virtual]
convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in Unit)Unit [virtual]
convertToBaseUnit(MathStructure &mvalue) const (defined in Unit)Unit [virtual]
convertToBaseUnit() const (defined in Unit)Unit [virtual]
copy() const (defined in Unit)Unit [virtual]
countNames() const (defined in ExpressionItem)ExpressionItem [virtual]
description() const ExpressionItem [virtual]
destroy() (defined in ExpressionItem)ExpressionItem [virtual]
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
getName(size_t index) const ExpressionItem [virtual]
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItem [virtual]
hasChanged() const ExpressionItem [virtual]
hasComplexRelationTo(Unit *u) const (defined in Unit)Unit [virtual]
hasName(const string &sname, bool case_sensitive=true) const ExpressionItem [virtual]
hasNameCaseSensitive(const string &sname) const ExpressionItem [virtual]
i_precision (defined in ExpressionItem)ExpressionItem [protected]
i_ref (defined in ExpressionItem)ExpressionItem [protected]
isActive() const ExpressionItem [virtual]
isApproximate() const ExpressionItem [virtual]
isBuiltin() const (defined in ExpressionItem)ExpressionItem [virtual]
isChildOf(Unit *u) const Unit [virtual]
isCurrency() const Unit
isHidden() const (defined in ExpressionItem)ExpressionItem [virtual]
isLocal() const (defined in ExpressionItem)ExpressionItem [virtual]
isParentOf(Unit *u) const Unit [virtual]
isRegistered() const (defined in ExpressionItem)ExpressionItem
isSIUnit() const Unit
isUsedByOtherUnits() const (defined in Unit)Unit [virtual]
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItem [virtual]
names (defined in ExpressionItem)ExpressionItem [protected]
plural(bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unit [virtual]
precision() const ExpressionItem [virtual]
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
print(bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const Unit [virtual]
ref() (defined in ExpressionItem)ExpressionItem [virtual]
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
refcount() const ExpressionItem [virtual]
referenceName() const (defined in ExpressionItem)ExpressionItem [virtual]
removeName(size_t index) (defined in ExpressionItem)ExpressionItem [virtual]
scat (defined in ExpressionItem)ExpressionItem [protected]
sdescr (defined in ExpressionItem)ExpressionItem [protected]
set(const ExpressionItem *item) (defined in Unit)Unit [virtual]
setActive(bool is_active) (defined in ExpressionItem)ExpressionItem [virtual]
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItem [virtual]
setAsSIUnit()Unit
setCategory(string cat_)ExpressionItem [virtual]
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItem [virtual]
setDescription(string descr_)ExpressionItem [virtual]
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItem [virtual]
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItem [virtual]
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItem [virtual]
setName(string sname, size_t index, bool force=true)ExpressionItem [virtual]
setPrecision(int prec) (defined in ExpressionItem)ExpressionItem [virtual]
setRegistered(bool is_registered)ExpressionItem
setSystem(string s_system)Unit
setTitle(string title_)ExpressionItem [virtual]
singular(bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unit [virtual]
ssystem (defined in Unit)Unit [protected]
stitle (defined in ExpressionItem)ExpressionItem [protected]
subtype() const Unit [virtual]
system() const Unit
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
type() const Unit [virtual]
Unit(string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Unit)Unit
Unit() (defined in Unit)Unit
Unit(const Unit *unit) (defined in Unit)Unit
unref() (defined in ExpressionItem)ExpressionItem [virtual]
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
v_refs (defined in ExpressionItem)ExpressionItem [protected]
~ExpressionItem() (defined in ExpressionItem)ExpressionItem [virtual]
~Unit() (defined in Unit)Unit [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/util_8h.html0000644000175100017510000005115711320655045017222 00000000000000 libqalculate-0.9.7: libqalculate/util.h File Reference

libqalculate/util.h File Reference

#include <libqalculate/includes.h>

Functions

string & gsub (const string &pattern, const string &sub, string &str)
string & gsub (const char *pattern, const char *sub, string &str)
string d2s (double value, int precision=100)
string i2s (int value)
string i2s (long int value)
string i2s (unsigned int value)
string i2s (unsigned long int value)
const char * b2yn (bool b, bool capital=true)
const char * b2tf (bool b, bool capital=true)
const char * b2oo (bool b, bool capital=true)
string p2s (void *o)
int s2i (const string &str)
int s2i (const char *str)
void * s2p (const string &str)
void * s2p (const char *str)
string date2s (int year, int month, int day)
int week (string str, bool start_sunday=false)
int weekday (string str)
int yearday (string str)
void now (int &hour, int &min, int &sec)
void today (int &year, int &month, int &day)
bool addDays (int &year, int &month, int &day, int days)
string addDays (string str, int days)
bool addMonths (int &year, int &month, int &day, int months)
string addMonths (string str, int months)
bool addYears (int &year, int &month, int &day, int years)
string addYears (string str, int years)
bool s2date (string str, int &year, int &month, int &day)
bool isLeapYear (int year)
int daysPerYear (int year, int basis=0)
int daysPerMonth (int month, int year)
Number yearsBetweenDates (string date1, string date2, int basis, bool date_func=true)
int daysBetweenDates (string date1, string date2, int basis, bool date_func=true)
int daysBetweenDates (int year1, int month1, int day1, int year2, int month2, int day2, int basis, bool date_func=true)
size_t find_ending_bracket (const string &str, size_t start, int *missing=NULL)
char op2ch (MathOperation op)
string & wrap_p (string &str)
string & remove_blanks (string &str)
string & remove_duplicate_blanks (string &str)
string & remove_blank_ends (string &str)
string & remove_parenthesis (string &str)
bool is_in (const char *str, char c)
bool is_not_in (const char *str, char c)
bool is_in (const string &str, char c)
bool is_not_in (const string &str, char c)
int sign_place (string *str, size_t start=0)
int gcd (int i1, int i2)
size_t unicode_length (const string &str)
size_t unicode_length (const char *str)
bool text_length_is_one (const string &str)
bool equalsIgnoreCase (const string &str1, const string &str2)
bool equalsIgnoreCase (const string &str1, const char *str2)
void parse_qalculate_version (string qalculate_version, int *qalculate_version_numbers)
string getLocalDir ()

Detailed Description


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classAliasUnit__Composite.png0000644000175100017510000000113211320655045022552 00000000000000PNG  IHDR~0ʾPLTE`{tRNS@fIDAThKr Pk57h/UJcv4n*,i2|a~|+](W<-oNo:⹋('⳾(p^kuE|\҆K|'Pd#}Ysڇ1gz̛7o{z.}5uOT4L}ʻ]i`ӇF{N+eKHUyx/x^EAݾϽ76=߿q^eٷA;|o|3Ή^^6IENDB`libqalculate-0.9.7/docs/reference/html/functions_0x6c.html0000644000175100017510000001351411320655045020511 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- l -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/files.html0000644000175100017510000000522011320655045016736 00000000000000 libqalculate-0.9.7: File Index

File List

Here is a list of all documented files with brief descriptions:
libqalculate/Calculator.h
libqalculate/DataSet.h
libqalculate/ExpressionItem.h
libqalculate/Function.h
libqalculate/includes.h
libqalculate/MathStructure.h
libqalculate/Number.h
libqalculate/Prefix.h
libqalculate/Unit.h
libqalculate/util.h
libqalculate/Variable.h

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classBinaryPrefix.png0000644000175100017510000000054211320655045021106 00000000000000PNG  IHDRRPx?PLTE`{tRNS@fIDATH] -7oi?-M3nw6 DEOUm$~Q/d;lב|{ F_qK.Mg8LWz $Yš1n v+ҭ"G!Y!@|V$/TrpN缤ά޲kJ3l96:6UGZ'!XqXplpx-4IENDB`libqalculate-0.9.7/docs/reference/html/structPlotDataParameters.html0000644000175100017510000001075211320655045022643 00000000000000 libqalculate-0.9.7: PlotDataParameters Struct Reference

PlotDataParameters Struct Reference

Parameters for plot data series. More...

#include <Calculator.h>

List of all members.

Public Attributes

string title
 Title label.
PlotSmoothing smoothing
 Plot smoothing.
PlotStyle style
 Plot style.
bool yaxis2
 Use scale on second y-axis.
bool xaxis2
 Use scale on second x-axis.


Detailed Description

Parameters for plot data series.
The documentation for this struct was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x66.html0000644000175100017510000001052211320655045020430 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- f -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classExpressionItem-members.html0000644000175100017510000004634211320655045023302 00000000000000 libqalculate-0.9.7: Member List

ExpressionItem Member List

This is the complete list of members for ExpressionItem, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
b_active (defined in ExpressionItem)ExpressionItem [protected]
b_approx (defined in ExpressionItem)ExpressionItem [protected]
b_builtin (defined in ExpressionItem)ExpressionItem [protected]
b_changed (defined in ExpressionItem)ExpressionItem [protected]
b_destroyed (defined in ExpressionItem)ExpressionItem [protected]
b_hidden (defined in ExpressionItem)ExpressionItem [protected]
b_local (defined in ExpressionItem)ExpressionItem [protected]
b_registered (defined in ExpressionItem)ExpressionItem [protected]
category() const ExpressionItem [virtual]
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItem [virtual]
clearNames()ExpressionItem [virtual]
clearNonReferenceNames()ExpressionItem [virtual]
copy() const =0 (defined in ExpressionItem)ExpressionItem [pure virtual]
countNames() const (defined in ExpressionItem)ExpressionItem [virtual]
description() const ExpressionItem [virtual]
destroy() (defined in ExpressionItem)ExpressionItem [virtual]
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
getName(size_t index) const ExpressionItem [virtual]
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItem [virtual]
hasChanged() const ExpressionItem [virtual]
hasName(const string &sname, bool case_sensitive=true) const ExpressionItem [virtual]
hasNameCaseSensitive(const string &sname) const ExpressionItem [virtual]
i_precision (defined in ExpressionItem)ExpressionItem [protected]
i_ref (defined in ExpressionItem)ExpressionItem [protected]
isActive() const ExpressionItem [virtual]
isApproximate() const ExpressionItem [virtual]
isBuiltin() const (defined in ExpressionItem)ExpressionItem [virtual]
isHidden() const (defined in ExpressionItem)ExpressionItem [virtual]
isLocal() const (defined in ExpressionItem)ExpressionItem [virtual]
isRegistered() const (defined in ExpressionItem)ExpressionItem
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItem [virtual]
names (defined in ExpressionItem)ExpressionItem [protected]
precision() const ExpressionItem [virtual]
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
ref() (defined in ExpressionItem)ExpressionItem [virtual]
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
refcount() const ExpressionItem [virtual]
referenceName() const (defined in ExpressionItem)ExpressionItem [virtual]
removeName(size_t index) (defined in ExpressionItem)ExpressionItem [virtual]
scat (defined in ExpressionItem)ExpressionItem [protected]
sdescr (defined in ExpressionItem)ExpressionItem [protected]
set(const ExpressionItem *item) (defined in ExpressionItem)ExpressionItem [virtual]
setActive(bool is_active) (defined in ExpressionItem)ExpressionItem [virtual]
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItem [virtual]
setCategory(string cat_)ExpressionItem [virtual]
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItem [virtual]
setDescription(string descr_)ExpressionItem [virtual]
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItem [virtual]
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItem [virtual]
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItem [virtual]
setName(string sname, size_t index, bool force=true)ExpressionItem [virtual]
setPrecision(int prec) (defined in ExpressionItem)ExpressionItem [virtual]
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItem [virtual]
stitle (defined in ExpressionItem)ExpressionItem [protected]
subtype() const =0ExpressionItem [pure virtual]
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
type() const =0ExpressionItem [pure virtual]
unref() (defined in ExpressionItem)ExpressionItem [virtual]
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
v_refs (defined in ExpressionItem)ExpressionItem [protected]
~ExpressionItem() (defined in ExpressionItem)ExpressionItem [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/structPrintOptions-members.html0000644000175100017510000002630111320655045023204 00000000000000 libqalculate-0.9.7: Member List

PrintOptions Member List

This is the complete list of members for PrintOptions, including all inherited members.

abbreviate_namesPrintOptions
allow_factorizationPrintOptions
allow_non_usablePrintOptions
basePrintOptions
base_displayPrintOptions
can_display_unicode_string_argPrintOptions
can_display_unicode_string_functionPrintOptions
comma() const PrintOptions
comma_signPrintOptions
decimalpoint() const PrintOptions
decimalpoint_signPrintOptions
division_signPrintOptions
excessive_parenthesisPrintOptions
halfexp_to_sqrtPrintOptions
hide_underscore_spacesPrintOptions
improve_division_multipliersPrintOptions
indicate_infinite_seriesPrintOptions
is_approximatePrintOptions
limit_implicit_multiplicationPrintOptions
lower_case_ePrintOptions
lower_case_numbersPrintOptions
max_decimalsPrintOptions
min_decimalsPrintOptions
min_exp (defined in PrintOptions)PrintOptions
multiplication_signPrintOptions
negative_exponentsPrintOptions
number_fraction_formatPrintOptions
place_units_separatelyPrintOptions
prefixPrintOptions
preserve_formatPrintOptions
PrintOptions() (defined in PrintOptions)PrintOptions [inline]
restrict_to_parent_precisionPrintOptions
round_halfway_to_evenPrintOptions
short_multiplicationPrintOptions
show_ending_zeroesPrintOptions
sort_optionsPrintOptions
spaciousPrintOptions
spell_out_logical_operatorsPrintOptions
use_all_prefixesPrintOptions
use_denominator_prefixPrintOptions
use_max_decimalsPrintOptions
use_min_decimalsPrintOptions
use_prefixes_for_currenciesPrintOptions
use_reference_namesPrintOptions
use_unicode_signsPrintOptions
use_unit_prefixesPrintOptions


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classBinaryPrefix.html0000644000175100017510000003404511320655045021273 00000000000000 libqalculate-0.9.7: BinaryPrefix Class Reference

BinaryPrefix Class Reference

A binary prefix. More...

#include <Prefix.h>

Inheritance diagram for BinaryPrefix:

Prefix

List of all members.

Public Member Functions

 BinaryPrefix (int exp2, string long_name, string short_name="", string unicode_name="")
int exponent (int iexp=1) const
Number exponent (const Number &nexp) const
void setExponent (int iexp)
Number value (const Number &nexp) const
Number value (int iexp) const
Number value () const
int type () const

Protected Attributes

int exp


Detailed Description

A binary prefix.

A Binary prefix has an integer exponent which with a base of two constitutes the value of the prefix (value=2^exponent).


Constructor & Destructor Documentation

BinaryPrefix::BinaryPrefix ( int  exp2,
string  long_name,
string  short_name = "",
string  unicode_name = "" 
)

Create a binary prefix.

Parameters:
exp2 Exponent for the value.
long_name Long name.
short_name Short name.
unicode_name Unicode name.


Member Function Documentation

int BinaryPrefix::exponent ( int  iexp = 1  )  const

Returns the exponent.

Parameters:
iexp Exponent of the unit.
Returns:
The exponent of the prefix.

Number BinaryPrefix::exponent ( const Number nexp  )  const

Returns the exponent.

Parameters:
nexp Exponent of the unit.
Returns:
The exponent of the prefix.

void BinaryPrefix::setExponent ( int  iexp  ) 

Sets the exponent of the prefix.

Parameters:
iexp New exponent for the prefix.

Number BinaryPrefix::value ( const Number nexp  )  const [virtual]

Returns the value of the prefix.

Parameters:
nexp The power of the prefixed unit.
Returns:
The value of the prefix.

Implements Prefix.

Number BinaryPrefix::value ( int  iexp  )  const [virtual]

Returns the value of the prefix.

Parameters:
iexp The power of the prefixed unit.
Returns:
The value of the prefix.

Implements Prefix.

Number BinaryPrefix::value (  )  const [virtual]

Returns the value of the prefix.

Returns:
The value of the prefix.

Implements Prefix.

int BinaryPrefix::type (  )  const [virtual]

Returns type, subclass, of the prefix. This can be PREFIX_DECIMAL for prefixes of the class DecimalPrefix, PREFIX_BINARY for BinaryPrefix, or PREFIX_NUMBER for NumberPrefix.

Returns:
The type of the prefix.

Implements Prefix.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/Calculator_8h.html0000644000175100017510000001151211320655044020324 00000000000000 libqalculate-0.9.7: libqalculate/Calculator.h File Reference

libqalculate/Calculator.h File Reference

#include <libqalculate/includes.h>
#include <libqalculate/util.h>
#include <pthread.h>
#include <libqalculate/MathStructure.h>

Classes

struct  PlotParameters
 Parameters passed to plotting functions. More...
struct  PlotDataParameters
 Parameters for plot data series. More...
class  CalculatorMessage
 A message with information to the user. Primarily used for errors and warnings. More...
struct  Element
class  Calculator
 The almighty calculator class. More...

Defines

#define UFV_LENGTHS   20

Typedefs

typedef vector< Prefix * > p_type

Enumerations

enum  MessageType { MESSAGE_INFORMATION, MESSAGE_WARNING, MESSAGE_ERROR }
 Message types.
enum  {
  ELEMENT_CLASS_NOT_DEFINED, ALKALI_METALS, ALKALI_EARTH_METALS, LANTHANIDES,
  ACTINIDES, TRANSITION_METALS, METALS, METALLOIDS,
  NONMETALS, HALOGENS, NOBLE_GASES, TRANSACTINIDES
}

Detailed Description


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/Unit_8h.html0000644000175100017510000001271211320655045017156 00000000000000 libqalculate-0.9.7: libqalculate/Unit.h File Reference

libqalculate/Unit.h File Reference

#include <libqalculate/ExpressionItem.h>
#include <libqalculate/includes.h>

Classes

class  Unit
 A unit for measurement. More...
class  AliasUnit
 An unit with relation to another unit. More...
class  AliasUnit_Composite
 A subunit in a CompositeUnit. More...
class  CompositeUnit
 A unit consisting of a number of other units. More...

Enumerations

enum  UnitSubtype { SUBTYPE_BASE_UNIT, SUBTYPE_ALIAS_UNIT, SUBTYPE_COMPOSITE_UNIT }
 Type of unit. More...

Detailed Description


Enumeration Type Documentation

Type of unit.

Enumerator:
SUBTYPE_BASE_UNIT  class Unit
SUBTYPE_ALIAS_UNIT  class AliasUnit
SUBTYPE_COMPOSITE_UNIT  class CompositeUnit


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classExpressionItemArgument-members.html0000644000175100017510000002500611320655045024777 00000000000000 libqalculate-0.9.7: Member List

ExpressionItemArgument Member List

This is the complete list of members for ExpressionItemArgument, including all inherited members.

alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
copy() const ExpressionItemArgument [virtual]
ExpressionItemArgument(string name_="", bool does_test=true, bool does_error=true) (defined in ExpressionItemArgument)ExpressionItemArgument
ExpressionItemArgument(const ExpressionItemArgument *arg) (defined in ExpressionItemArgument)ExpressionItemArgument
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const ExpressionItemArgument [virtual]
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)Argument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
subprintlong() const ExpressionItemArgument [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const ExpressionItemArgument [protected, virtual]
suggestsQuotes() const (defined in Argument)Argument [virtual]
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const ExpressionItemArgument [virtual]
zeroForbidden() const Argument
~Argument()Argument [virtual]
~ExpressionItemArgument() (defined in ExpressionItemArgument)ExpressionItemArgument [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDataSet-members.html0000644000175100017510000012124011320655045021640 00000000000000 libqalculate-0.9.7: Member List

DataSet Member List

This is the complete list of members for DataSet, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addObject(DataObject *o) (defined in DataSet)DataSet
addProperty(DataProperty *dp) (defined in DataSet)DataSet
appendDefaultValues(MathStructure &vargs) (defined in MathFunction)MathFunction
argc (defined in MathFunction)MathFunction [protected]
argdefs (defined in MathFunction)MathFunction [protected]
args() const MathFunction
args(const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)MathFunction
b_active (defined in ExpressionItem)ExpressionItem [protected]
b_approx (defined in ExpressionItem)ExpressionItem [protected]
b_builtin (defined in ExpressionItem)ExpressionItem [protected]
b_changed (defined in ExpressionItem)ExpressionItem [protected]
b_destroyed (defined in ExpressionItem)ExpressionItem [protected]
b_hidden (defined in ExpressionItem)ExpressionItem [protected]
b_loaded (defined in DataSet)DataSet [protected]
b_local (defined in ExpressionItem)ExpressionItem [protected]
b_registered (defined in ExpressionItem)ExpressionItem [protected]
calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)DataSet [virtual]
calculate(const string &eq, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunction [virtual]
calculate(MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunction [virtual]
category() const ExpressionItem [virtual]
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItem [virtual]
clearArgumentDefinitions()MathFunction
clearNames()ExpressionItem [virtual]
clearNonReferenceNames()ExpressionItem [virtual]
condition() const MathFunction
copy() const (defined in DataSet)DataSet [virtual]
copyright() const (defined in DataSet)DataSet
countNames() const (defined in ExpressionItem)ExpressionItem [virtual]
createFunctionMathStructureFromSVArgs(vector< string > &svargs) (defined in MathFunction)MathFunction [protected, virtual]
createFunctionMathStructureFromVArgs(const MathStructure &vargs) (defined in MathFunction)MathFunction [protected, virtual]
DataSet(string s_category="", string s_name="", string s_default_file="", string s_title="", string s_description="", bool is_local=true) (defined in DataSet)DataSet
DataSet(const DataSet *o) (defined in DataSet)DataSet
default_values (defined in MathFunction)MathFunction [protected]
defaultDataFile() const (defined in DataSet)DataSet
defaultProperty() const (defined in DataSet)DataSet
delObject(DataObject *o) (defined in DataSet)DataSet
delObject(DataObjectIter *it) (defined in DataSet)DataSet
delProperty(DataProperty *dp) (defined in DataSet)DataSet
delProperty(DataPropertyIter *it) (defined in DataSet)DataSet
description() const ExpressionItem [virtual]
destroy() (defined in ExpressionItem)ExpressionItem [virtual]
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
getArgumentDefinition(size_t index)MathFunction
getDefaultValue(size_t arg_) const (defined in MathFunction)MathFunction
getFirstObject(DataObjectIter *it) (defined in DataSet)DataSet
getFirstProperty(DataPropertyIter *it) (defined in DataSet)DataSet
getFirstPropertyName(DataPropertyIter *it) (defined in DataSet)DataSet
getName(size_t index) const ExpressionItem [virtual]
getNextObject(DataObjectIter *it) (defined in DataSet)DataSet
getNextProperty(DataPropertyIter *it) (defined in DataSet)DataSet
getNextPropertyName(DataPropertyIter *it) (defined in DataSet)DataSet
getObject(string object) (defined in DataSet)DataSet
getObject(const MathStructure &object) (defined in DataSet)DataSet
getObjectProperty(string property, string object) (defined in DataSet)DataSet
getObjectPropertyDisplayString(string property, string object) (defined in DataSet)DataSet
getObjectPropertyInputString(string property, string object) (defined in DataSet)DataSet
getObjectProperyStruct(string property, string object) (defined in DataSet)DataSet
getPrimaryKeyProperty() (defined in DataSet)DataSet
getProperty(string property) (defined in DataSet)DataSet
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItem [virtual]
hasChanged() const ExpressionItem [virtual]
hasName(const string &sname, bool case_sensitive=true) const ExpressionItem [virtual]
hasNameCaseSensitive(const string &sname) const ExpressionItem [virtual]
i_precision (defined in ExpressionItem)ExpressionItem [protected]
i_ref (defined in ExpressionItem)ExpressionItem [protected]
isActive() const ExpressionItem [virtual]
isApproximate() const ExpressionItem [virtual]
isBuiltin() const (defined in ExpressionItem)ExpressionItem [virtual]
isHidden() const (defined in ExpressionItem)ExpressionItem [virtual]
isLocal() const (defined in ExpressionItem)ExpressionItem [virtual]
isRegistered() const (defined in ExpressionItem)ExpressionItem
last_argdef_index (defined in MathFunction)MathFunction [protected]
lastArgumentDefinitionIndex() const MathFunction
loadObjects(const char *file_name=NULL, bool is_user_defs=true) (defined in DataSet)DataSet
MathFunction(string name_, int argc_, int max_argc_=0, string cat_="", string title_="", string descr_="", bool is_active=true) (defined in MathFunction)MathFunction
MathFunction(const MathFunction *function) (defined in MathFunction)MathFunction
MathFunction() (defined in MathFunction)MathFunction
max_argc (defined in MathFunction)MathFunction [protected]
maxargs() const MathFunction
minargs() const MathFunction
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItem [virtual]
names (defined in ExpressionItem)ExpressionItem [protected]
objects (defined in DataSet)DataSet [protected]
objectsLoaded() const (defined in DataSet)DataSet
parse(const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunction [virtual]
parse(MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunction [virtual]
precision() const ExpressionItem [virtual]
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
printCondition()MathFunction
printProperties(string object) (defined in DataSet)DataSet
printProperties(DataObject *o) (defined in DataSet)DataSet
produceArgumentsVector(const MathStructure &vargs, int begin=-1, int end=-1) (defined in MathFunction)MathFunction
produceVector(const MathStructure &vargs, int begin=-1, int end=-1) (defined in MathFunction)MathFunction
properties (defined in DataSet)DataSet [protected]
ref() (defined in ExpressionItem)ExpressionItem [virtual]
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
refcount() const ExpressionItem [virtual]
referenceName() const (defined in ExpressionItem)ExpressionItem [virtual]
removeName(size_t index) (defined in ExpressionItem)ExpressionItem [virtual]
representsBoolean(const MathStructure &) const (defined in MathFunction)MathFunction [virtual]
representsComplex(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsEven(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsInteger(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNonMatrix(const MathStructure &) const (defined in MathFunction)MathFunction [virtual]
representsNonNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNonPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNonZero(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsNumber(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsOdd(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsRational(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsReal(const MathStructure &, bool=false) const (defined in MathFunction)MathFunction [virtual]
representsUndefined(const MathStructure &) const (defined in MathFunction)MathFunction [virtual]
saveObjects(const char *file_name=NULL, bool save_global=false) (defined in DataSet)DataSet
scat (defined in ExpressionItem)ExpressionItem [protected]
scondition (defined in MathFunction)MathFunction [protected]
scopyright (defined in DataSet)DataSet [protected]
sdescr (defined in ExpressionItem)ExpressionItem [protected]
set(const ExpressionItem *item) (defined in DataSet)DataSet [virtual]
setActive(bool is_active) (defined in ExpressionItem)ExpressionItem [virtual]
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItem [virtual]
setArgumentDefinition(size_t index, Argument *argdef)MathFunction
setCategory(string cat_)ExpressionItem [virtual]
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItem [virtual]
setCondition(string expression)MathFunction
setCopyright(string s_copyright) (defined in DataSet)DataSet
setDefaultDataFile(string s_file) (defined in DataSet)DataSet
setDefaultProperty(string property) (defined in DataSet)DataSet
setDefaultValue(size_t arg_, string value_) (defined in MathFunction)MathFunction
setDescription(string descr_)ExpressionItem [virtual]
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItem [virtual]
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItem [virtual]
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItem [virtual]
setName(string sname, size_t index, bool force=true)ExpressionItem [virtual]
setObjectsLoaded(bool objects_loaded) (defined in DataSet)DataSet
setPrecision(int prec) (defined in ExpressionItem)ExpressionItem [virtual]
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItem [virtual]
sfile (defined in DataSet)DataSet [protected]
stitle (defined in ExpressionItem)ExpressionItem [protected]
stringArgs(const string &str, vector< string > &svargs) (defined in MathFunction)MathFunction
subtype() const DataSet [virtual]
testArgumentCount(int itmp) (defined in MathFunction)MathFunction
testArguments(MathStructure &vargs) (defined in MathFunction)MathFunction [protected]
testCondition(const MathStructure &vargs)MathFunction
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
type() const MathFunction [virtual]
unref() (defined in ExpressionItem)ExpressionItem [virtual]
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
v_refs (defined in ExpressionItem)ExpressionItem [protected]
~ExpressionItem() (defined in ExpressionItem)ExpressionItem [virtual]
~MathFunction() (defined in MathFunction)MathFunction [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classVectorArgument.png0000644000175100017510000000062511320655045021453 00000000000000PNG  IHDRhP-RPLTE`{tRNS@f+IDATXv `r$o {z?܄sDs45"vCE &Bhh g1629Rliʟ$R# d)>pO2Xyp6Zv{tMe_7+ns/EoQhow ]B'E2_IxuH왱@v(!`0( XHLBF9o>}a-"T(dA^:S(~;_yBނP=P=Jqu u?j?#y}iŭi?TRIENDB`libqalculate-0.9.7/docs/reference/html/functions_func_0x6b.html0000644000175100017510000000675411320655045021533 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- k -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDataObject.html0000644000175100017510000005341711320655045020675 00000000000000 libqalculate-0.9.7: DataObject Class Reference

DataObject Class Reference

A a data set object. More...

#include <DataSet.h>

List of all members.

Public Member Functions

 DataObject (DataSet *parent_set)
void eraseProperty (DataProperty *property)
void setProperty (DataProperty *property, string s_value, int is_approximate=-1)
void setNonlocalizedKeyProperty (DataProperty *property, string s_value)
const MathStructuregetPropertyStruct (DataProperty *property)
const string & getProperty (DataProperty *property, int *is_approximate=NULL)
const string & getNonlocalizedKeyProperty (DataProperty *property)
string getPropertyInputString (DataProperty *property)
string getPropertyDisplayString (DataProperty *property)
bool isUserModified () const
void setUserModified (bool user_modified=true)
DataSetparentSet () const

Protected Attributes

vector< DataProperty * > properties
vector< string > s_properties
vector< string > s_nonlocalized_properties
vector< MathStructure * > m_properties
vector< int > a_properties
DataSetparent
bool b_uchanged


Detailed Description

A a data set object.

Data objects consist of property-value pairs.


Constructor & Destructor Documentation

DataObject::DataObject ( DataSet parent_set  ) 

Create a data object.

Parameters:
parent_set Data set that the object will belong to.


Member Function Documentation

void DataObject::eraseProperty ( DataProperty property  ) 

Unset (erase value) a property.

Parameters:
property Property to unset.

void DataObject::setProperty ( DataProperty property,
string  s_value,
int  is_approximate = -1 
)

Set value for a property.

Parameters:
property Property to set (must belong to parent data set).
s_vale Value for the property.
is_approximate If the value is approximate. 1 for approximate, 0 for exact, -1 for property default.

void DataObject::setNonlocalizedKeyProperty ( DataProperty property,
string  s_value 
)

Set an untranslated value for a key property. Used when a text value is translated, but the original value still is needed as a reference key.

Parameters:
property Property to set (must belong to parent data set).
s_vale Value for the property.

const MathStructure* DataObject::getPropertyStruct ( DataProperty property  ) 

Returns parsed value for a property. Parses the text string value if not parsed before

Parameters:
property Property to read.
Returns:
Parsed value or NULL if property value is not set.

const string& DataObject::getProperty ( DataProperty property,
int *  is_approximate = NULL 
)

Returns unparsed value for a property.

Parameters:
property Property to read.
[out] is_approximate If the value is approximate. Is set to 1 for approximate, 0 for exact, -1 for property default, if not NULL.
Returns:
Unparsed value or empty string if property value is not set.

const string& DataObject::getNonlocalizedKeyProperty ( DataProperty property  ) 

Returns unparsed untranslated value for a key property. Used when a text value is translated, but the original value still is needed as a reference key.

Parameters:
property Property to read.
Returns:
Unparsed untranslated value or empty string if property value is not set.

string DataObject::getPropertyInputString ( DataProperty property  ) 

Returns value for a property in a format suitable for use in expressions with unit appended.

Parameters:
property Property to read.
Returns:
Value in input format or empty string if property value is not set.

string DataObject::getPropertyDisplayString ( DataProperty property  ) 

Returns value for a property in a format suitable for display with unit appended.

Parameters:
property Property to read.
Returns:
Value in display format or empty string if property value is not set.

bool DataObject::isUserModified (  )  const

If the object has been modified by the end user (if setUserModified() has been called).

Returns:
true if the object has been modified by the user.

void DataObject::setUserModified ( bool  user_modified = true  ) 

Specify if the object has been modified by the end user.

Parameters:
user_modified true if the object has been modified by the user.

DataSet* DataObject::parentSet (  )  const

Returns the data set that the object belongs to.

Returns:
Parent data set.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x65.html0000644000175100017510000001145511320655045020435 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- e -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classBinaryPrefix-members.html0000644000175100017510000001503311320655045022717 00000000000000 libqalculate-0.9.7: Member List

BinaryPrefix Member List

This is the complete list of members for BinaryPrefix, including all inherited members.

BinaryPrefix(int exp2, string long_name, string short_name="", string unicode_name="")BinaryPrefix
exp (defined in BinaryPrefix)BinaryPrefix [protected]
exponent(int iexp=1) const BinaryPrefix
exponent(const Number &nexp) const BinaryPrefix
l_name (defined in Prefix)Prefix [protected]
longName(bool return_short_if_no_long=true, bool use_unicode=false) const Prefix
name(bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const Prefix
Prefix(string long_name, string short_name="", string unicode_name="")Prefix
s_name (defined in Prefix)Prefix [protected]
setExponent(int iexp)BinaryPrefix
setLongName(string long_name)Prefix
setShortName(string short_name)Prefix
setUnicodeName(string unicode_name)Prefix
shortName(bool return_long_if_no_short=true, bool use_unicode=false) const Prefix
type() const BinaryPrefix [virtual]
u_name (defined in Prefix)Prefix [protected]
unicodeName(bool return_short_if_no_uni=true) const Prefix
value(const Number &nexp) const BinaryPrefix [virtual]
value(int iexp) const BinaryPrefix [virtual]
value() const BinaryPrefix [virtual]
~BinaryPrefix() (defined in BinaryPrefix)BinaryPrefix
~Prefix() (defined in Prefix)Prefix [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x62.html0000644000175100017510000001030711320655045020425 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- b -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classVariable-members.html0000644000175100017510000005750111320655045022050 00000000000000 libqalculate-0.9.7: Member List

Variable Member List

This is the complete list of members for Variable, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItem [virtual]
b_active (defined in ExpressionItem)ExpressionItem [protected]
b_approx (defined in ExpressionItem)ExpressionItem [protected]
b_builtin (defined in ExpressionItem)ExpressionItem [protected]
b_changed (defined in ExpressionItem)ExpressionItem [protected]
b_destroyed (defined in ExpressionItem)ExpressionItem [protected]
b_hidden (defined in ExpressionItem)ExpressionItem [protected]
b_local (defined in ExpressionItem)ExpressionItem [protected]
b_registered (defined in ExpressionItem)ExpressionItem [protected]
category() const ExpressionItem [virtual]
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItem [virtual]
clearNames()ExpressionItem [virtual]
clearNonReferenceNames()ExpressionItem [virtual]
copy() const =0 (defined in Variable)Variable [pure virtual]
countNames() const (defined in ExpressionItem)ExpressionItem [virtual]
description() const ExpressionItem [virtual]
destroy() (defined in ExpressionItem)ExpressionItem [virtual]
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
getName(size_t index) const ExpressionItem [virtual]
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItem [virtual]
hasChanged() const ExpressionItem [virtual]
hasName(const string &sname, bool case_sensitive=true) const ExpressionItem [virtual]
hasNameCaseSensitive(const string &sname) const ExpressionItem [virtual]
i_precision (defined in ExpressionItem)ExpressionItem [protected]
i_ref (defined in ExpressionItem)ExpressionItem [protected]
isActive() const ExpressionItem [virtual]
isApproximate() const ExpressionItem [virtual]
isBuiltin() const (defined in ExpressionItem)ExpressionItem [virtual]
isHidden() const (defined in ExpressionItem)ExpressionItem [virtual]
isKnown() const =0Variable [pure virtual]
isLocal() const (defined in ExpressionItem)ExpressionItem [virtual]
isRegistered() const (defined in ExpressionItem)ExpressionItem
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItem [virtual]
names (defined in ExpressionItem)ExpressionItem [protected]
precision() const ExpressionItem [virtual]
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
ref() (defined in ExpressionItem)ExpressionItem [virtual]
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
refcount() const ExpressionItem [virtual]
referenceName() const (defined in ExpressionItem)ExpressionItem [virtual]
removeName(size_t index) (defined in ExpressionItem)ExpressionItem [virtual]
representsBoolean() (defined in Variable)Variable [inline, virtual]
representsComplex(bool=false) (defined in Variable)Variable [inline, virtual]
representsEven(bool=false) (defined in Variable)Variable [inline, virtual]
representsInteger(bool=false) (defined in Variable)Variable [inline, virtual]
representsNegative(bool=false) (defined in Variable)Variable [inline, virtual]
representsNonMatrix() (defined in Variable)Variable [inline, virtual]
representsNonNegative(bool=false) (defined in Variable)Variable [inline, virtual]
representsNonPositive(bool=false) (defined in Variable)Variable [inline, virtual]
representsNonZero(bool=false) (defined in Variable)Variable [inline, virtual]
representsNumber(bool=false) (defined in Variable)Variable [inline, virtual]
representsOdd(bool=false) (defined in Variable)Variable [inline, virtual]
representsPositive(bool=false)Variable [inline, virtual]
representsRational(bool=false) (defined in Variable)Variable [inline, virtual]
representsReal(bool=false) (defined in Variable)Variable [inline, virtual]
representsUndefined(bool=false, bool=false, bool=false) (defined in Variable)Variable [inline, virtual]
scat (defined in ExpressionItem)ExpressionItem [protected]
sdescr (defined in ExpressionItem)ExpressionItem [protected]
set(const ExpressionItem *item) (defined in Variable)Variable [virtual]
setActive(bool is_active) (defined in ExpressionItem)ExpressionItem [virtual]
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItem [virtual]
setCategory(string cat_)ExpressionItem [virtual]
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItem [virtual]
setDescription(string descr_)ExpressionItem [virtual]
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItem [virtual]
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItem [virtual]
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItem [virtual]
setName(string sname, size_t index, bool force=true)ExpressionItem [virtual]
setPrecision(int prec) (defined in ExpressionItem)ExpressionItem [virtual]
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItem [virtual]
stitle (defined in ExpressionItem)ExpressionItem [protected]
subtype() const Variable [inline, virtual]
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const ExpressionItem [virtual]
type() const Variable [inline, virtual]
unref() (defined in ExpressionItem)ExpressionItem [virtual]
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItem [virtual]
v_refs (defined in ExpressionItem)ExpressionItem [protected]
Variable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Variable)Variable
Variable() (defined in Variable)Variable
Variable(const Variable *variable) (defined in Variable)Variable
~ExpressionItem() (defined in ExpressionItem)ExpressionItem [virtual]
~Variable() (defined in Variable)Variable [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/DataSet_8h.html0000644000175100017510000001122211320655045017557 00000000000000 libqalculate-0.9.7: libqalculate/DataSet.h File Reference

libqalculate/DataSet.h File Reference

#include <libqalculate/includes.h>
#include <libqalculate/Function.h>

Classes

class  DataObject
 A a data set object. More...
class  DataProperty
 A data set property. More...
class  DataSet
 A data set. More...
class  DataPropertyArgument
 Data property function argument. More...
class  DataObjectArgument
 Data object function argument. More...

Typedefs

typedef Sgi::vector
< DataProperty * >::iterator 
DataObjectPropertyIter
typedef vector< DataProperty * >
::iterator 
DataPropertyIter
typedef vector< DataObject * >
::iterator 
DataObjectIter

Enumerations

enum  PropertyType { PROPERTY_EXPRESSION, PROPERTY_NUMBER, PROPERTY_STRING }

Detailed Description


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classArgumentSet.png0000644000175100017510000000060211320655045020737 00000000000000PNG  IHDRTPuOPLTE`{tRNS@fIDATHAr Pk5_7ޠPV" v xi3SOMAp>K|-e>D|eV. 7TAA=heXm[*#]Q>սbN8r&]$,kJrwy}O.zы/pRNt>:ID#JwzHk $ŀt4DK6fhjԇxkx=P}KGk)|*- Pk5ӭ?Jiy?LFQ_E/q@pIENDB`libqalculate-0.9.7/docs/reference/html/classUnit.html0000644000175100017510000007210211320655045017604 00000000000000 libqalculate-0.9.7: Unit Class Reference

Unit Class Reference

A unit for measurement. More...

#include <Unit.h>

Inheritance diagram for Unit:

ExpressionItem AliasUnit CompositeUnit AliasUnit_Composite

List of all members.

Public Member Functions

 Unit (string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 Unit (const Unit *unit)
virtual ExpressionItemcopy () const
virtual void set (const ExpressionItem *item)
bool isSIUnit () const
void setAsSIUnit ()
void setSystem (string s_system)
const string & system () const
bool isCurrency () const
virtual string print (bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const string & plural (bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const string & singular (bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual const string & abbreviation (bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
virtual bool isUsedByOtherUnits () const
virtual UnitbaseUnit () const
virtual MathStructureconvertToBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
virtual MathStructureconvertFromBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
virtual MathStructureconvertToBaseUnit (MathStructure &mvalue) const
virtual MathStructureconvertFromBaseUnit (MathStructure &mvalue) const
virtual MathStructure convertToBaseUnit () const
virtual MathStructure convertFromBaseUnit () const
virtual int baseExponent (int exp=1) const
virtual int type () const
virtual int subtype () const
virtual bool isChildOf (Unit *u) const
virtual bool isParentOf (Unit *u) const
virtual bool hasComplexRelationTo (Unit *u) const
bool convert (Unit *u, MathStructure &mvalue, MathStructure &exp) const
bool convert (Unit *u, MathStructure &mvalue) const
MathStructure convert (Unit *u, bool *converted=NULL) const

Protected Attributes

string ssystem
bool b_si


Detailed Description

A unit for measurement.

The Unit class both represents a base unit and is the base class for other unit types. Base units are units defined as basis for other units. Meters and seconds are typical base units.

For base units, a name is all that is needed. Base units do however normally have three different names defined for use in expressions - abbreviation (ex. "m"), singular ("meter") and plural ("meters").


Member Function Documentation

bool Unit::isSIUnit (  )  const

Returns if the unit is part of the SI standard.

Returns:
true if the unit is part of the SI standard.

void Unit::setAsSIUnit (  ) 

State that the unit is part of the SI standard. Sets system to "SI".

void Unit::setSystem ( string  s_system  ) 

Sets which system/standard ("SI", "SGC", etc.) the unit is part of. Setting system to "SI" (case-insensitive), is equivalent to setAsSIUnit().

const string& Unit::system (  )  const

Returns the system/standard that the unit is part of.

Returns:
System string.

bool Unit::isCurrency (  )  const

Returns if the unit is a currency (Euro is base unit).

Returns:
true if the unit is a currency.

virtual string Unit::print ( bool  plural_,
bool  short_,
bool  use_unicode = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const [virtual]

Returns a display string representing the unit in an expression.

Equivalent to preferredName() for Unit and AliasUnit, but closer to MathStructure::print() for CompositeUnit (prints out base expression).

Reimplemented in AliasUnit_Composite, and CompositeUnit.

virtual int Unit::type (  )  const [virtual]

Returns the type of the expression item, corresponding to which subclass the object belongs to.

Returns:
ExpressionItemType.

Implements ExpressionItem.

virtual int Unit::subtype (  )  const [virtual]

Returns the subtype of the unit, corresponding to which subsubclass the object belongs to.

Returns:
UnitSubtype.

Implements ExpressionItem.

Reimplemented in AliasUnit, and CompositeUnit.

virtual bool Unit::isChildOf ( Unit u  )  const [virtual]

If specified unit is a base unit for this unit, directly or with other units in between. Equivalent to u->isParentOf(this).

Reimplemented in AliasUnit.

virtual bool Unit::isParentOf ( Unit u  )  const [virtual]

If this unit is a base unit for specified unit, directly or with other units in between. Equivalent to u->isChildOf(this).

Reimplemented in AliasUnit.

bool Unit::convert ( Unit u,
MathStructure mvalue,
MathStructure exp 
) const

Converts a value from specified unit and exponent to this unit. value * (unit^exponent) = new value * (this^new exponent) This function cannot convert to or from CompositeUnit.

Parameters:
u Unit to convert from.
[in,out] mvalue Quantity value.
[in,out] exp Exponent.
Returns:
true if the value was successfully converted.

bool Unit::convert ( Unit u,
MathStructure mvalue 
) const

Converts a value from specified unit and exponent to this unit. value * unit = new value * this This function cannot convert to or from CompositeUnit.

Parameters:
u Unit to convert from.
[in,out] mvalue Quantity value.
Returns:
true if the value was successfully converted.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x74.html0000644000175100017510000001503611320655045020434 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- t -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDataSet.png0000644000175100017510000000075511320655045020037 00000000000000PNG  IHDR`PLTE`{tRNS@fIDATX[r $;A$E"8Qx礹8eOwֲ"F"!r4 e>R 1y^!5IZ@b 5 =CbHijOk]}dcRJ?.3̑W~ x[u3p 0 0zN XUۨ VnER,a&b, 6cWl%-P$dlU-@IFT@Pew@]l\7nLV3j&ͅy.$΀uٷst6 :8P| 5s2(R5:`ރZ!06nf?3_[)C2IENDB`libqalculate-0.9.7/docs/reference/html/ExpressionItem_8h.html0000644000175100017510000000407211320655045021215 00000000000000 libqalculate-0.9.7: libqalculate/ExpressionItem.h File Reference

libqalculate/ExpressionItem.h File Reference

#include <libqalculate/includes.h>

Classes

struct  ExpressionName
 A name for an expression item (function, variable or unit). More...
class  ExpressionItem
 Abstract base class for functions, variables and units. More...

Detailed Description


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classes.html0000644000175100017510000002233411320655045017276 00000000000000 libqalculate-0.9.7: Alphabetical List

Class Index

A | B | C | D | E | F | I | K | M | N | P | S | T | U | V

  A  
CompositeUnit   ExpressionItem   MatrixArgument   SortOptions   
AliasUnit   
  D  
ExpressionItemArgument   
  N  
SymbolicArgument   
AliasUnit_Composite   DataObject   ExpressionName   Number   
  T  
Argument   DataObjectArgument   
  F  
NumberArgument   TextArgument   
ArgumentSet   DataProperty   FunctionArgument   NumberPrefix   
  U  
Assumptions   DataPropertyArgument   
  I  
  P  
Unit   
  B  
DataSet   IntegerArgument   ParseOptions   UnknownVariable   
BinaryPrefix   DateArgument   
  K  
PlotDataParameters   UserFunction   
BooleanArgument   DecimalPrefix   KnownVariable   PlotParameters   
  V  
  C  
DynamicVariable   
  M  
Prefix   Variable   
Calculator   
  E  
MathFunction   PrintOptions   VectorArgument   
CalculatorMessage   EvaluationOptions   MathStructure   
  S  

A | B | C | D | E | F | I | K | M | N | P | S | T | U | V


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x64.html0000644000175100017510000001160611320655045020432 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- d -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classIntegerArgument.html0000644000175100017510000003513411320655045021771 00000000000000 libqalculate-0.9.7: IntegerArgument Class Reference

IntegerArgument Class Reference

A definition for integer arguments. More...

#include <Function.h>

Inheritance diagram for IntegerArgument:

Argument

List of all members.

Public Member Functions

 IntegerArgument (string name_="", ArgumentMinMaxPreDefinition minmax=ARGUMENT_MIN_MAX_NONE, bool does_test=true, bool does_error=true)
 IntegerArgument (const IntegerArgument *arg)
virtual void set (const Argument *arg)
virtual Argumentcopy () const
virtual string print () const
void setMin (const Number *nmin)
const Numbermin () const
void setMax (const Number *nmax)
const Numbermax () const
virtual int type () const

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const

Protected Attributes

Numberimin
Numberimax


Detailed Description

A definition for integer arguments.

These arguments allows numerical integer values. The value can be restricted to a max and/or min value.


Member Function Documentation

virtual bool IntegerArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented from Argument.

virtual string IntegerArgument::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented from Argument.

virtual void IntegerArgument::set ( const Argument arg  )  [virtual]

Sets the argument to a copy of an argument definition.

Parameters:
arg Argument to copy.

Reimplemented from Argument.

virtual Argument* IntegerArgument::copy (  )  const [virtual]

Returns a copy of the argument definition.

Returns:
A copy.

Reimplemented from Argument.

virtual string IntegerArgument::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented from Argument.

virtual int IntegerArgument::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/structEvaluationOptions.html0000644000175100017510000003262611320655045022576 00000000000000 libqalculate-0.9.7: EvaluationOptions Struct Reference

EvaluationOptions Struct Reference

Options for calculation. More...

#include <includes.h>

List of all members.

Public Attributes

ApproximationMode approximation
 How exact the result must be. Default: TRY_EXACT.
bool sync_units
 If units will be synced/converted to allow evaluation (ex. 1 min + 1 s=60 s+ 1 s = 61 s). Default: true.
bool sync_complex_unit_relations
 If units with complex/non-linear relations (ex. degress celsius and fahrenheit) will synced/converted. Default: true.
bool keep_prefixes
 If unit prefixes in original expression will be kept. Default: false.
bool calculate_variables
 If known variables will be replaced by their value. Default: true.
bool calculate_functions
 If functions will be calculated. Default: true.
bool test_comparisons
 If comparisons will be evaluated (ex. 5>2 => 1). Default: true.
bool isolate_x
 If a varaible will be isolated to the left side in equations/comparisons (ex. x+y=2 => x=2-y). Default: true.
bool expand
 If factors (and bases) containing addition will be expanded (ex. z(x+y)=zx+zy). Default: true.
bool reduce_divisions
 If non-numerical parts of a fraction will be reduced (ex. (5x)/(3xy) =5/(3y) . Default: true.
bool allow_complex
 If complex numbers will be used for evaluation. Default: true.
bool allow_infinite
 If infinite numbers will be used for evaluation. Default: true.
bool assume_denominators_nonzero
 If simplification will be made easier by assuming that denominators with unknown value not is zero. Default: false.
bool warn_about_denominators_assumed_nonzero
 Warn if a denominator with unknown value was assumed non-zero (with assume_denominators_nonzero set to true) to allow simplification. Default: false.
bool split_squares
 If powers with exponent 1/2 that only have an approximate result will be split to the least base (sqrt(8) = 2 * sqrt(2)). Default: true.
bool keep_zero_units
 If units with zero quantity will be preserved. Default: true.
AutoPostConversion auto_post_conversion
 If and how units will be automatically converted. Does not affect syncing of units. Default: POST_CONVERSION_NONE.
StructuringMode structuring
 If the evaluation result will be simplified or factorized.
ParseOptions parse_options
 Options for parsing of expression. Default: default_parse_options.
const MathStructureisolate_var
 If set will decide which variable to isolate in an equation. Default: NULL.


Detailed Description

Options for calculation.
The documentation for this struct was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/Variable_8h.html0000644000175100017510000003323011320655045017762 00000000000000 libqalculate-0.9.7: libqalculate/Variable.h File Reference

libqalculate/Variable.h File Reference

#include <libqalculate/ExpressionItem.h>
#include <libqalculate/includes.h>

Classes

class  Assumptions
 An assumption about an unknown mathematical value. More...
class  Variable
 Abstract base class for variables. More...
class  UnknownVariable
 A variable with unknown value. More...
class  KnownVariable
 A variable with a known value. More...
class  DynamicVariable
 Abstract base class for variables with a value which is recalculated when the precision has changed. More...

Defines

#define DECLARE_BUILTIN_VARIABLE(x)

Enumerations

enum  AssumptionType {
  ASSUMPTION_TYPE_NONE = 0, ASSUMPTION_TYPE_NONMATRIX = 1, ASSUMPTION_TYPE_NUMBER = 2, ASSUMPTION_TYPE_COMPLEX = 3,
  ASSUMPTION_TYPE_REAL = 4, ASSUMPTION_TYPE_RATIONAL = 5, ASSUMPTION_TYPE_INTEGER = 6
}
 Type assumption. More...
enum  AssumptionSign {
  ASSUMPTION_SIGN_UNKNOWN, ASSUMPTION_SIGN_POSITIVE, ASSUMPTION_SIGN_NONNEGATIVE, ASSUMPTION_SIGN_NEGATIVE,
  ASSUMPTION_SIGN_NONPOSITIVE, ASSUMPTION_SIGN_NONZERO
}
 Signedness assumption. More...
enum  VariableSubtype { SUBTYPE_VARIABLE, SUBTYPE_UNKNOWN_VARIABLE, SUBTYPE_KNOWN_VARIABLE }
 Type of variable. More...

Detailed Description


Define Documentation

#define DECLARE_BUILTIN_VARIABLE (  ) 

Value:

class x : public DynamicVariable { \
                                          private: \
                                                void calculate() const; \
                                          public: \
                                                x(); \
                                                x(const x *variable) {set(variable);} \
                                                ExpressionItem *copy() const {return new x(this);} \
                                        };


Enumeration Type Documentation

Signedness assumption.

Enumerator:
ASSUMPTION_SIGN_UNKNOWN  x = ?
ASSUMPTION_SIGN_POSITIVE  x > 0
ASSUMPTION_SIGN_NONNEGATIVE  x >= 0
ASSUMPTION_SIGN_NEGATIVE  x < 0
ASSUMPTION_SIGN_NONPOSITIVE  x <= 0
ASSUMPTION_SIGN_NONZERO  x != 0

Type assumption.

Each type is a subset of the type above.

Enumerator:
ASSUMPTION_TYPE_NONMATRIX  Multiplication is NOT commutative.
ASSUMPTION_TYPE_COMPLEX  im(x) != 0

Type of variable.

Enumerator:
SUBTYPE_VARIABLE  class Variable
SUBTYPE_UNKNOWN_VARIABLE  class UnknownVariable
SUBTYPE_KNOWN_VARIABLE  class KnownVariable


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x75.html0000644000175100017510000000747511320655045021460 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- u -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classAssumptions.html0000644000175100017510000003042711320655045021216 00000000000000 libqalculate-0.9.7: Assumptions Class Reference

Assumptions Class Reference

An assumption about an unknown mathematical value. More...

#include <Variable.h>

List of all members.

Public Member Functions

bool isPositive ()
bool isNegative ()
bool isNonNegative ()
bool isNonPositive ()
bool isInteger ()
bool isNumber ()
bool isRational ()
bool isReal ()
bool isComplex ()
bool isNonZero ()
bool isNonMatrix ()
AssumptionType type ()
AssumptionSign sign ()
void setType (AssumptionType ant)
void setSign (AssumptionSign as)
void setMin (const Number *nmin)
void setIncludeEqualsMin (bool include_equals)
bool includeEqualsMin () const
const Numbermin () const
void setMax (const Number *nmax)
void setIncludeEqualsMax (bool include_equals)
bool includeEqualsMax () const
const Numbermax () const

Protected Attributes

AssumptionType i_type
AssumptionSign i_sign
Numberfmin
Numberfmax
bool b_incl_min
bool b_incl_max


Detailed Description

An assumption about an unknown mathematical value.

Assumptions have a type and a sign. The type describes the type of the value -- if it represents a number or something else, and what type of number is represented. The sign restricts the signedness of a number. The sign generally only applies the assumptions representing a number. The assumption class also includes max and min values, which however are not used anywhere yet.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classCompositeUnit.png0000644000175100017510000000070411320655045021306 00000000000000PNG  IHDR`PLTE`{tRNS@fZIDATX]r  7h/OOY6i6" }Q[Z׫ Sc &DGl(Wd5@-@a,r_W clkHe ^k(@RbRpijoj]J}QTٓ~0%?3//N`6~y,LG@ZyuS|`W#1$*6`Eqa-a.Wp~\ 2E`- prϏ 70 Ң{@a = a%]m9jk椟 5bNIENDB`libqalculate-0.9.7/docs/reference/html/functions_func_0x65.html0000644000175100017510000001074111320655045021445 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- e -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classTextArgument-members.html0000644000175100017510000002430211320655045022743 00000000000000 libqalculate-0.9.7: Member List

TextArgument Member List

This is the complete list of members for TextArgument, including all inherited members.

alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
copy() const TextArgument [virtual]
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const TextArgument [virtual]
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)Argument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
subprintlong() const TextArgument [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const TextArgument [protected, virtual]
suggestsQuotes() const (defined in TextArgument)TextArgument [virtual]
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
TextArgument(string name_="", bool does_test=true, bool does_error=true) (defined in TextArgument)TextArgument
TextArgument(const TextArgument *arg) (defined in TextArgument)TextArgument
type() const TextArgument [virtual]
zeroForbidden() const Argument
~Argument()Argument [virtual]
~TextArgument() (defined in TextArgument)TextArgument [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDateArgument.png0000644000175100017510000000060411320655045021063 00000000000000PNG  IHDR\PfPLTE`{tRNS@fIDATHQ Pw ok?mMdK Sx5Uʥ&_g39 Vʤm+T7iэnZ!'Zr 9;~^׹N8->A Js//ܢ-iܓmG?vR`fMuJIdB(qH^66qƪ .ieƭ~e2Ю9'z瞌]D/ S'==w{z2[T{rqyf)<>`IENDB`libqalculate-0.9.7/docs/reference/html/classNumberArgument-members.html0000644000175100017510000003472211320655045023256 00000000000000 libqalculate-0.9.7: Member List

NumberArgument Member List

This is the complete list of members for NumberArgument, including all inherited members.

alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_complex (defined in NumberArgument)NumberArgument [protected]
b_error (defined in Argument)Argument [protected]
b_incl_max (defined in NumberArgument)NumberArgument [protected]
b_incl_min (defined in NumberArgument)NumberArgument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_rational_number (defined in NumberArgument)NumberArgument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
complexAllowed() const (defined in NumberArgument)NumberArgument
copy() const NumberArgument [virtual]
fmax (defined in NumberArgument)NumberArgument [protected]
fmin (defined in NumberArgument)NumberArgument [protected]
getCustomCondition() const Argument
includeEqualsMax() const (defined in NumberArgument)NumberArgument
includeEqualsMin() const (defined in NumberArgument)NumberArgument
matrixAllowed() const (defined in Argument)Argument
max() const (defined in NumberArgument)NumberArgument
min() const (defined in NumberArgument)NumberArgument
name() const Argument
NumberArgument(string name_="", ArgumentMinMaxPreDefinition minmax=ARGUMENT_MIN_MAX_NONE, bool does_test=true, bool does_error=true) (defined in NumberArgument)NumberArgument
NumberArgument(const NumberArgument *arg) (defined in NumberArgument)NumberArgument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const NumberArgument [virtual]
printlong() const Argument
rationalNumber() const (defined in NumberArgument)NumberArgument
rationalPolynomial() const Argument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)NumberArgument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setComplexAllowed(bool allow_complex) (defined in NumberArgument)NumberArgument
setCustomCondition(string condition)Argument
setIncludeEqualsMax(bool include_equals) (defined in NumberArgument)NumberArgument
setIncludeEqualsMin(bool include_equals) (defined in NumberArgument)NumberArgument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setMax(const Number *nmax) (defined in NumberArgument)NumberArgument
setMin(const Number *nmin) (defined in NumberArgument)NumberArgument
setName(string name_)Argument
setRationalNumber(bool rational_number) (defined in NumberArgument)NumberArgument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
subprintlong() const NumberArgument [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const NumberArgument [protected, virtual]
suggestsQuotes() const (defined in Argument)Argument [virtual]
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const NumberArgument [virtual]
zeroForbidden() const Argument
~Argument()Argument [virtual]
~NumberArgument() (defined in NumberArgument)NumberArgument [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x7a.html0000644000175100017510000000710111320655045021516 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- z -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDataObject-members.html0000644000175100017510000001341611320655045022320 00000000000000 libqalculate-0.9.7: Member List

DataObject Member List

This is the complete list of members for DataObject, including all inherited members.

a_properties (defined in DataObject)DataObject [protected]
b_uchanged (defined in DataObject)DataObject [protected]
DataObject(DataSet *parent_set)DataObject
eraseProperty(DataProperty *property)DataObject
getNonlocalizedKeyProperty(DataProperty *property)DataObject
getProperty(DataProperty *property, int *is_approximate=NULL)DataObject
getPropertyDisplayString(DataProperty *property)DataObject
getPropertyInputString(DataProperty *property)DataObject
getPropertyStruct(DataProperty *property)DataObject
isUserModified() const DataObject
m_properties (defined in DataObject)DataObject [protected]
parent (defined in DataObject)DataObject [protected]
parentSet() const DataObject
properties (defined in DataObject)DataObject [protected]
s_nonlocalized_properties (defined in DataObject)DataObject [protected]
s_properties (defined in DataObject)DataObject [protected]
setNonlocalizedKeyProperty(DataProperty *property, string s_value)DataObject
setProperty(DataProperty *property, string s_value, int is_approximate=-1)DataObject
setUserModified(bool user_modified=true)DataObject


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classDataProperty.html0000644000175100017510000005262511320655045021313 00000000000000 libqalculate-0.9.7: DataProperty Class Reference

DataProperty Class Reference

A data set property. More...

#include <DataSet.h>

List of all members.

Public Member Functions

 DataProperty (DataSet *parent_set, string s_name="", string s_title="", string s_description="")
 DataProperty (const DataProperty &dp)
void set (const DataProperty &dp)
void setName (string s_name, bool is_ref=false)
void setNameIsReference (size_t index=1, bool is_ref=true)
bool nameIsReference (size_t index=1) const
void clearNames ()
void addName (string s_name, bool is_ref=false, size_t index=0)
size_t hasName (const string &s_name)
size_t countNames () const
const string & getName (size_t index=1) const
const string & getReferenceName () const
void setTitle (string s_title)
const string & title (bool return_name_if_no_title=true) const
void setDescription (string s_description)
const string & description () const
void setUnit (string s_unit)
const string & getUnitString () const
const MathStructuregetUnitStruct ()
string getInputString (const string &valuestr)
string getDisplayString (const string &valuestr)
MathStructuregenerateStruct (const string &valuestr, int is_approximate=-1)
void setKey (bool is_key=true)
bool isKey () const
void setHidden (bool is_hidden=true)
bool isHidden () const
void setCaseSensitive (bool is_case_sensitive=true)
bool isCaseSensitive () const
void setUsesBrackets (bool uses_brackets=true)
bool usesBrackets () const
void setApproximate (bool is_approximate=true)
bool isApproximate () const
void setPropertyType (PropertyType property_type)
PropertyType propertyType () const
bool isUserModified () const
void setUserModified (bool user_modified=true)
DataSetparentSet () const

Protected Attributes

vector< string > names
vector< bool > name_is_ref
string sdescr
string stitle
string sunit
MathStructurem_unit
bool b_approximate
bool b_brackets
bool b_key
bool b_case
bool b_hide
DataSetparent
PropertyType ptype
bool b_uchanged


Detailed Description

A data set property.

Property definitions for use with data set objects.


Constructor & Destructor Documentation

DataProperty::DataProperty ( DataSet parent_set,
string  s_name = "",
string  s_title = "",
string  s_description = "" 
)

Create a data property.

Parameters:
s_name Property name (initial) used for reference.
s_title Descriptive name/title.
s_description Description.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_0x79.html0000644000175100017510000001033511320655045020436 00000000000000 libqalculate-0.9.7: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- y -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classTextArgument.png0000644000175100017510000000060311320655045021131 00000000000000PNG  IHDRYP*TPLTE`{tRNS@fIDATHK0 x:oМ1UlcƀHè& 9/PO"Ԟ,^3g5$M o&\G*M6'4֒4nwZN'G4mwʂjN !bA 0Nsf+9;w4QKMNkAֆA׹K`MV i־h/ZTLs^r%^:C]i=i`.-ǣEr'T]o9Gzl,:8"nuWIENDB`libqalculate-0.9.7/docs/reference/html/functions_func_0x68.html0000644000175100017510000001022011320655045021440 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- h -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classFunctionArgument-members.html0000644000175100017510000002447211320655045023614 00000000000000 libqalculate-0.9.7: Member List

FunctionArgument Member List

This is the complete list of members for FunctionArgument, including all inherited members.

alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
copy() const FunctionArgument [virtual]
FunctionArgument(string name_="", bool does_test=true, bool does_error=true) (defined in FunctionArgument)FunctionArgument
FunctionArgument(const FunctionArgument *arg) (defined in FunctionArgument)FunctionArgument
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const FunctionArgument [virtual]
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)Argument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
subprintlong() const FunctionArgument [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const FunctionArgument [protected, virtual]
suggestsQuotes() const (defined in Argument)Argument [virtual]
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const FunctionArgument [virtual]
zeroForbidden() const Argument
~Argument()Argument [virtual]
~FunctionArgument() (defined in FunctionArgument)FunctionArgument [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classTextArgument.html0000644000175100017510000002621511320655045021320 00000000000000 libqalculate-0.9.7: TextArgument Class Reference

TextArgument Class Reference

A text argument. More...

#include <Function.h>

Inheritance diagram for TextArgument:

Argument

List of all members.

Public Member Functions

 TextArgument (string name_="", bool does_test=true, bool does_error=true)
 TextArgument (const TextArgument *arg)
virtual int type () const
virtual Argumentcopy () const
virtual string print () const
virtual bool suggestsQuotes () const

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
virtual string subprintlong () const


Detailed Description

A text argument.

Accepts text (symbolic) structures. Argument values are parsed as text, unless surrounded by back slashes (which are then removed). Surrounding Parentheses and first quotation marks are removed.


Member Function Documentation

virtual bool TextArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const [protected, virtual]

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters:
value Value to test.
eo Evaluation options to use if the value needs to be evaluated.
Returns:
true if the value is valid for the argument definition.

Reimplemented from Argument.

virtual string TextArgument::subprintlong (  )  const [protected, virtual]

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns:
Long description.

Reimplemented from Argument.

virtual int TextArgument::type (  )  const [virtual]

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns:
ArgumentType.

Reimplemented from Argument.

virtual Argument* TextArgument::copy (  )  const [virtual]

Returns a copy of the argument definition.

Returns:
A copy.

Reimplemented from Argument.

virtual string TextArgument::print (  )  const [virtual]

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns:
Short description.

Reimplemented from Argument.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classVariable.html0000644000175100017510000003514511320655045020420 00000000000000 libqalculate-0.9.7: Variable Class Reference

Variable Class Reference

Abstract base class for variables. More...

#include <Variable.h>

Inheritance diagram for Variable:

ExpressionItem KnownVariable UnknownVariable DynamicVariable

List of all members.

Public Member Functions

 Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 Variable (const Variable *variable)
virtual ExpressionItemcopy () const =0
virtual void set (const ExpressionItem *item)
virtual int type () const
virtual int subtype () const
virtual bool isKnown () const =0
virtual bool representsPositive (bool=false)
virtual bool representsNegative (bool=false)
virtual bool representsNonNegative (bool=false)
virtual bool representsNonPositive (bool=false)
virtual bool representsInteger (bool=false)
virtual bool representsNumber (bool=false)
virtual bool representsRational (bool=false)
virtual bool representsReal (bool=false)
virtual bool representsComplex (bool=false)
virtual bool representsNonZero (bool=false)
virtual bool representsEven (bool=false)
virtual bool representsOdd (bool=false)
virtual bool representsUndefined (bool=false, bool=false, bool=false)
virtual bool representsBoolean ()
virtual bool representsNonMatrix ()


Detailed Description

Abstract base class for variables.

A variable is an alpha-numerical representation of a known or unknown value.


Member Function Documentation

virtual int Variable::type (  )  const [inline, virtual]

Returns the type of the expression item, corresponding to which subclass the object belongs to.

Returns:
ExpressionItemType.

Implements ExpressionItem.

References TYPE_VARIABLE.

virtual int Variable::subtype (  )  const [inline, virtual]

Returns the subtype of the variable, corresponding to which subsubclass the object belongs to.

Returns:
VariableSubtype.

Implements ExpressionItem.

Reimplemented in UnknownVariable, and KnownVariable.

References SUBTYPE_VARIABLE.

virtual bool Variable::isKnown (  )  const [pure virtual]

Returns if the variable has a known value (as oppossed to assumptions).

Returns:
true if the variable is of class KnownVariable, false if UnknownVariable.

Implemented in UnknownVariable, and KnownVariable.

virtual bool Variable::representsPositive ( bool  = false  )  [inline, virtual]

Returns if the variable represents a positive value.

Reimplemented in UnknownVariable, KnownVariable, and DynamicVariable.


The documentation for this class was generated from the following file:

Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/functions_func_0x70.html0000644000175100017510000001502511320655045021441 00000000000000 libqalculate-0.9.7: Class Members - Functions
 

- p -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classBooleanArgument.png0000644000175100017510000000063011320655045021564 00000000000000PNG  IHDRpP3bNPLTE`{tRNS@f.IDATXQ P$7ABGR*TY3B[G0_g j?C%r1@A}$L7G"uDNɘ +e{$ZBX1ztd(RSUu6,Whd/xlG?x6vavl}@Me-O8@ Y)C!h2At$Z6挔RM0O,LVF}RΧW(3Uml[\ɢ8C*`9"_ "|+@^]IENDB`libqalculate-0.9.7/docs/reference/html/globals_eval.html0000644000175100017510000001526611320655045020301 00000000000000 libqalculate-0.9.7: Class Members
 

- a -

- f -

- p -

- s -

- t -


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/globals_enum.html0000644000175100017510000000737011320655045020313 00000000000000 libqalculate-0.9.7: Class Members
 


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/html/classArgument-members.html0000644000175100017510000002257311320655045022106 00000000000000 libqalculate-0.9.7: Member List

Argument Member List

This is the complete list of members for Argument, including all inherited members.

alerts() const Argument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argument [protected]
b_matrix (defined in Argument)Argument [protected]
b_rational (defined in Argument)Argument [protected]
b_test (defined in Argument)Argument [protected]
b_text (defined in Argument)Argument [protected]
b_zero (defined in Argument)Argument [protected]
copy() const Argument [virtual]
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argument [virtual]
print() const Argument [virtual]
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argument [protected]
set(const Argument *arg)Argument [virtual]
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argument [protected]
subprintlong() const Argument [protected, virtual]
subtest(MathStructure &value, const EvaluationOptions &eo) const Argument [protected, virtual]
suggestsQuotes() const (defined in Argument)Argument [virtual]
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const Argument [virtual]
zeroForbidden() const Argument
~Argument()Argument [virtual]


Generated on Tue Jan 5 08:26:29 2010 for libqalculate-0.9.7 by  doxygen 1.5.5
libqalculate-0.9.7/docs/reference/Makefile.in0000644000175100017510000002751311320655032016054 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ # # docs/reference/Makefile.am for qalculate # VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = docs/reference DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = 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)$(referencedir)" referenceDATA_INSTALL = $(INSTALL_DATA) DATA = $(reference_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_CPPFLAGS = @CLN_CPPFLAGS@ CLN_LIBS = @CLN_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@ INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@ INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@ INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@ INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@ INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@ INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@ INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@ INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@ INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@ INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@ INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@ INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NMEDIT = @NMEDIT@ 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@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ referencedir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/reference/html reference_DATA = html/*.png html/*.html html/*.css EXTRA_DIST = html/*.png html/*.html html/*.css all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 docs/reference/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/reference/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-referenceDATA: $(reference_DATA) @$(NORMAL_INSTALL) test -z "$(referencedir)" || $(MKDIR_P) "$(DESTDIR)$(referencedir)" @list='$(reference_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(referenceDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(referencedir)/$$f'"; \ $(referenceDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(referencedir)/$$f"; \ done uninstall-referenceDATA: @$(NORMAL_UNINSTALL) @list='$(reference_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(referencedir)/$$f'"; \ rm -f "$(DESTDIR)$(referencedir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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 $(DATA) installdirs: for dir in "$(DESTDIR)$(referencedir)"; 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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-referenceDATA install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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-referenceDATA .MAKE: install-am install-strip .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-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-referenceDATA \ 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-referenceDATA # 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: libqalculate-0.9.7/docs/Makefile.in0000644000175100017510000003776611320655032014131 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ # # docs/Makefile.am for qalculate # VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = docs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_CPPFLAGS = @CLN_CPPFLAGS@ CLN_LIBS = @CLN_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@ INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@ INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@ INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@ INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@ INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@ INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@ INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@ INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@ INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@ INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@ INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@ INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NMEDIT = @NMEDIT@ 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@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = reference all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 docs/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ 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; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { 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: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; nonempty = 1; } \ END { if (nonempty) { 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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 list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean 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-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: libqalculate-0.9.7/aclocal.m40000644000175100017510000111441511320655030012756 00000000000000# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008 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. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(AC_AUTOCONF_VERSION, [2.61],, [m4_warning([this file was generated for autoconf 2.61. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 1995-2002 Free Software Foundation, Inc. # Copyright (C) 2001-2003,2004 Red Hat, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # # Macro to add for using GNU gettext. # Ulrich Drepper , 1995, 1996 # # Modified to never use included libintl. # Owen Taylor , 12/15/1998 # # Major rework to remove unused code # Owen Taylor , 12/11/2002 # # Added better handling of ALL_LINGUAS from GNU gettext version # written by Bruno Haible, Owen Taylor 5/30/3002 # # Modified to require ngettext # Matthias Clasen 08/06/2004 # # We need this here as well, since someone might use autoconf-2.5x # to configure GLib then an older version to configure a package # using AM_GLIB_GNU_GETTEXT AC_PREREQ(2.53) dnl dnl We go to great lengths to make sure that aclocal won't dnl try to pull in the installed version of these macros dnl when running aclocal in the glib directory. dnl m4_copy([AC_DEFUN],[glib_DEFUN]) m4_copy([AC_REQUIRE],[glib_REQUIRE]) dnl dnl At the end, if we're not within glib, we'll define the public dnl definitions in terms of our private definitions. dnl # GLIB_LC_MESSAGES #-------------------- glib_DEFUN([GLIB_LC_MESSAGES], [AC_CHECK_HEADERS([locale.h]) if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi fi]) # GLIB_PATH_PROG_WITH_TEST #---------------------------- dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], [# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) # GLIB_WITH_NLS #----------------- glib_DEFUN([GLIB_WITH_NLS], dnl NLS is obligatory [USE_NLS=yes AC_SUBST(USE_NLS) gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= AC_CHECK_HEADER(libintl.h, [gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, [AC_TRY_LINK([ #include ], [return !ngettext ("","", 1)], gt_cv_func_ngettext_libc=yes, gt_cv_func_ngettext_libc=no) ]) if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, [AC_TRY_LINK([ #include ], [return !dgettext ("","")], gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no) ]) fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CHECK_FUNCS(bind_textdomain_codeset) fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then AC_CHECK_LIB(intl, bindtextdomain, [AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dgettext, gt_cv_func_dgettext_libintl=yes)])]) if test "$gt_cv_func_dgettext_libintl" != "yes" ; then AC_MSG_CHECKING([if -liconv is needed to use gettext]) AC_MSG_RESULT([]) AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dcgettext, [gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv], :,-liconv)], :,-liconv) fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset AC_CHECK_FUNCS(bind_textdomain_codeset) LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs" fi if test "$gt_cv_have_gettext" = "yes"; then AC_DEFINE(HAVE_GETTEXT,1, [Define if the GNU gettext() function is already present or preinstalled.]) GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" AC_CHECK_FUNCS(dcgettext) MSGFMT_OPTS= AC_MSG_CHECKING([if msgfmt accepts -c]) GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" ], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_SUBST(MSGFMT_OPTS) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr], [CATOBJEXT=.gmo DATADIRNAME=share], [case $host in *-*-solaris*) dnl On Solaris, if bind_textdomain_codeset is in libc, dnl GNU format message catalog is always supported, dnl since both are added to the libc all together. dnl Hence, we'd like to go with DATADIRNAME=share and dnl and CATOBJEXT=.gmo in this case. AC_CHECK_FUNC(bind_textdomain_codeset, [CATOBJEXT=.gmo DATADIRNAME=share], [CATOBJEXT=.mo DATADIRNAME=lib]) ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac]) LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi ]) if test "$gt_cv_have_gettext" = "yes" ; then AC_DEFINE(ENABLE_NLS, 1, [always defined to indicate that i18n is enabled]) fi dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is not GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po AC_OUTPUT_COMMANDS( [case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac]) dnl These rules are solely for the distribution goal. While doing this dnl we only have to keep exactly one list of the available catalogs dnl in configure.in. for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done dnl Make all variables we use known to autoconf. AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(DATADIRNAME) AC_SUBST(GMOFILES) AC_SUBST(INSTOBJEXT) AC_SUBST(INTLLIBS) AC_SUBST(PO_IN_DATADIR_TRUE) AC_SUBST(PO_IN_DATADIR_FALSE) AC_SUBST(POFILES) AC_SUBST(POSUB) ]) # AM_GLIB_GNU_GETTEXT # ------------------- # Do checks necessary for use of gettext. If a suitable implementation # of gettext is found in either in libintl or in the C library, # it will set INTLLIBS to the libraries needed for use of gettext # and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable # gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() # on various variables needed by the Makefile.in.in installed by # glib-gettextize. dnl glib_DEFUN([GLIB_GNU_GETTEXT], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_HEADER_STDC])dnl GLIB_LC_MESSAGES GLIB_WITH_NLS if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else AC_MSG_CHECKING(for catalogs to be installed) NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS AC_MSG_RESULT($LINGUAS) fi dnl Construct list of names of catalog files to be constructed. if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but ($top_srcdir). dnl Try to locate is. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) dnl Generate list of files to be processed by xgettext which will dnl be included in po/Makefile. test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES ]) # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) # ------------------------------- # Define VARIABLE to the location where catalog files will # be installed by po/Makefile. glib_DEFUN([GLIB_DEFINE_LOCALEDIR], [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl glib_save_prefix="$prefix" glib_save_exec_prefix="$exec_prefix" glib_save_datarootdir="$datarootdir" test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix=$prefix datarootdir=`eval echo "${datarootdir}"` if test "x$CATOBJEXT" = "x.mo" ; then localedir=`eval echo "${libdir}/locale"` else localedir=`eval echo "${datadir}/locale"` fi prefix="$glib_save_prefix" exec_prefix="$glib_save_exec_prefix" datarootdir="$glib_save_datarootdir" AC_DEFINE_UNQUOTED($1, "$localedir", [Define the location where the catalogs will be installed]) ]) dnl dnl Now the definitions that aclocal will find dnl ifdef(glib_configure_in,[],[ AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) ])dnl # GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) # # Create a temporary file with TEST-FILE as its contents and pass the # file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with # 0 and perform ACTION-IF-FAIL for any other exit status. AC_DEFUN([GLIB_RUN_PROG], [cat >conftest.foo <<_ACEOF $2 _ACEOF if AC_RUN_LOG([$1 conftest.foo]); then m4_ifval([$3], [$3], [:]) m4_ifvaln([$4], [else $4])dnl echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD fi]) dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) # serial 36 IT_PROG_INTLTOOL AC_DEFUN([IT_PROG_INTLTOOL], [AC_PREREQ([2.50])dnl case "$am__api_version" in 1.[01234]) AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) ;; *) ;; esac if test -n "$1"; then AC_MSG_CHECKING([for intltool >= $1]) INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in` [INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split($ 2, VERSION, "."); print VERSION[1] * 1000 + VERSION[2] * 100 + VERSION[3];}' ${ac_aux_dir}/intltool-update.in` ] AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.]) fi INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' AC_SUBST(INTLTOOL_DESKTOP_RULE) AC_SUBST(INTLTOOL_DIRECTORY_RULE) AC_SUBST(INTLTOOL_KEYS_RULE) AC_SUBST(INTLTOOL_PROP_RULE) AC_SUBST(INTLTOOL_OAF_RULE) AC_SUBST(INTLTOOL_PONG_RULE) AC_SUBST(INTLTOOL_SERVER_RULE) AC_SUBST(INTLTOOL_SHEET_RULE) AC_SUBST(INTLTOOL_SOUNDLIST_RULE) AC_SUBST(INTLTOOL_UI_RULE) AC_SUBST(INTLTOOL_XAM_RULE) AC_SUBST(INTLTOOL_KBD_RULE) AC_SUBST(INTLTOOL_XML_RULE) AC_SUBST(INTLTOOL_XML_NOMERGE_RULE) AC_SUBST(INTLTOOL_CAVES_RULE) AC_SUBST(INTLTOOL_SCHEMAS_RULE) AC_SUBST(INTLTOOL_THEME_RULE) AC_SUBST(INTLTOOL_SERVICE_RULE) AC_SUBST(INTLTOOL_POLICY_RULE) # Check the gettext tools to make sure they are GNU AC_PATH_PROG(XGETTEXT, xgettext) AC_PATH_PROG(MSGMERGE, msgmerge) AC_PATH_PROG(MSGFMT, msgfmt) if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi # Use the tools built into the package, not the ones that are installed. AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract') AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge') AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update') AC_PATH_PROG(INTLTOOL_PERL, perl) if test -z "$INTLTOOL_PERL"; then AC_MSG_ERROR([perl not found; required for intltool]) fi if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then AC_MSG_ERROR([perl 5.x required for intltool]) fi if test "x$2" != "xno-xml"; then AC_MSG_CHECKING([for XML::Parser]) if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then AC_MSG_RESULT([ok]) else AC_MSG_ERROR([XML::Parser perl module is required for intltool]) fi fi # Substitute ALL_LINGUAS so we can use it in po/Makefile AC_SUBST(ALL_LINGUAS) # Set DATADIRNAME correctly if it is not set yet # (copied from glib-gettext.m4) if test -z "$DATADIRNAME"; then AC_LINK_IFELSE( [AC_LANG_PROGRAM([[]], [[extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr]])], [DATADIRNAME=share], [case $host in *-*-solaris*) dnl On Solaris, if bind_textdomain_codeset is in libc, dnl GNU format message catalog is always supported, dnl since both are added to the libc all together. dnl Hence, we'd like to go with DATADIRNAME=share dnl in this case. AC_CHECK_FUNC(bind_textdomain_codeset, [DATADIRNAME=share], [DATADIRNAME=lib]) ;; *) [DATADIRNAME=lib] ;; esac]) fi AC_SUBST(DATADIRNAME) IT_PO_SUBDIR([po]) dnl The following is very similar to dnl dnl AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update]) dnl dnl with the following slight differences: dnl - the *.in files are in ac_aux_dir, dnl - if the file haven't changed upon reconfigure, it's not touched, dnl - the evaluation of the third parameter enables a hack which computes dnl the actual value of $libdir, dnl - the user sees "executing intltool commands", instead of dnl "creating intltool-extract" and such. dnl dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were dnl a reason for it. AC_CONFIG_COMMANDS([intltool], [ for file in intltool-extract intltool-merge intltool-update; do sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \ -e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \ -e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \ < ${ac_aux_dir}/${file}.in > ${file}.out if cmp -s ${file} ${file}.out 2>/dev/null; then rm -f ${file}.out else mv -f ${file}.out ${file} fi chmod ugo+x ${file} chmod u+w ${file} done ], [INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}' prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir" INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}']) ]) # IT_PO_SUBDIR(DIRNAME) # --------------------- # All po subdirs have to be declared with this macro; the subdir "po" is # declared by IT_PROG_INTLTOOL. # AC_DEFUN([IT_PO_SUBDIR], [AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. dnl dnl The following CONFIG_COMMANDS should be exetuted at the very end dnl of config.status. AC_CONFIG_COMMANDS_PRE([ AC_CONFIG_COMMANDS([$1/stamp-it], [ rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp" >"$1/stamp-it.tmp" [sed '/^#/d s/^[[].*] *// /^[ ]*$/d '"s|^| $ac_top_srcdir/|" \ "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" ] if test ! -f "$1/Makefile"; then AC_MSG_ERROR([$1/Makefile is not ready.]) fi mv "$1/Makefile" "$1/Makefile.tmp" [sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r $1/POTFILES } ' "$1/Makefile.tmp" >"$1/Makefile"] rm -f "$1/Makefile.tmp" mv "$1/stamp-it.tmp" "$1/stamp-it" ]) ])dnl ]) # deprecated macros AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL]) # A hint is needed for aclocal from Automake <= 1.9.4: # AC_DEFUN([AC_PROG_INTLTOOL], ...) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 52 Debian 1.5.26-1ubuntu1 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_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 _LT_REQUIRED_DARWIN_CHECKS 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_REQUIRE([LT_AC_PROG_SED])dnl ac_outfile=conftest.$ac_objext echo "$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_REQUIRE([LT_AC_PROG_SED])dnl ac_outfile=conftest.$ac_objext echo "$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 -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # -------------------------- # Check for some things on darwin AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. echo "int foo(void){return 1;}" > conftest.c $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib ${wl}-single_module conftest.c if test -f libconftest.dylib; then lt_cv_apple_cc_single_mod=yes rm -rf libconftest.dylib* fi rm conftest.c fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[0123]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil="~$DSYMUTIL \$lib || :" else _lt_dsymutil= fi ;; esac ]) # _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_REQUIRE([LT_AC_PROG_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # 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 "$lt_aix_libpath_sed"` 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-*kfreebsd*-gnu|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-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; 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-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; 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" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; 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]) echo "$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_REQUIRE([LT_AC_PROG_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$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 -r 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 ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then 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` else 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` fi ;; 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="-ldld"], [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="-ldld"]) ]) ]) ]) ]) ]) ;; 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_PROG_SED])dnl 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 echo "$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" old_striplib="$STRIP -S" 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_REQUIRE([LT_AC_PROG_SED])dnl 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" m4_if($1,[],[ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$lt_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. lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`echo $lt_search_path_spec` 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' ;; aix[[4-9]]*) 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`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 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 ;; 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 ;; *) # from 4.6 on, and DragonFly 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' ;; interix[[3-9]]*) 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* | k*bsd*-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' 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 # 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/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $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' ;; netbsdelf*-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='NetBSD ld.elf_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" ;; rdos*) dynamic_linker=no ;; 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 AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec], [lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"]) sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec], [lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"]) sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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_REQUIRE([LT_AC_PROG_SED])dnl 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 recognize 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 recognize 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 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /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 ;; interix[[3-9]]*) # 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* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) 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 ;; rdos*) 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;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _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 ;; aix[[4-9]]*) 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)= _LT_AC_TAGVAR(compiler_lib_search_dirs, $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;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # 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 ;; aix[[4-9]]*) 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]].*|aix[[5-9]]*) 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 : 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*) _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 _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" if test "$GXX" = 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_dar_single_mod${_lt_dsymutil}" _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then _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${_lt_dsymutil}" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed '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${_lt_dar_export_syms}${_lt_dsymutil}" fi 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` $xlcverstring' _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 $xlcverstring~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* | 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(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 ;; interix[[3-9]]*) _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* | k*bsd*-gnu) 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* | pgcpp*) # 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' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _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)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. 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' ;; esac ;; 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* | netbsdelf*-gnu) 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*) if test -f /usr/libexec/ld.so; then _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' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; 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 compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z 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' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac 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], [AC_REQUIRE([LT_AC_PROG_SED])dnl 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 <&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_AC_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac ])# AC_LIBTOOL_POSTDEP_PREDEP # AC_LIBTOOL_LANG_F77_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_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) AC_DEFUN([_LT_AC_LANG_F77_CONFIG], [AC_REQUIRE([AC_PROG_F77]) AC_LANG_PUSH(Fortran 77) _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_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 # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # 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" CC=${F77-"f77"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) 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 ;; aix[[4-9]]*) 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]) _LT_AC_TAGVAR(GCC, $1)="$G77" _LT_AC_TAGVAR(LD, $1)="$LD" 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" ])# AC_LIBTOOL_LANG_F77_CONFIG # AC_LIBTOOL_LANG_GCJ_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_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], [AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # 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" CC=${GCJ-"gcj"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds 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_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_GCJ_CONFIG # AC_LIBTOOL_LANG_RC_CONFIG # ------------------------- # Ensure that the configuration vars for the Windows resource 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_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) AC_DEFUN([_LT_AC_LANG_RC_CONFIG], [AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # 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" CC=${RC-"windres"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_RC_CONFIG # AC_LIBTOOL_CONFIG([TAGNAME]) # ---------------------------- # If TAGNAME is not passed, then create an initial libtool script # with a default configuration from the untagged config vars. Otherwise # add code to config.status for appending the configuration named by # TAGNAME from the matching tagged config vars. AC_DEFUN([AC_LIBTOOL_CONFIG], [# The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ _LT_AC_TAGVAR(compiler, $1) \ _LT_AC_TAGVAR(CC, $1) \ _LT_AC_TAGVAR(LD, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ _LT_AC_TAGVAR(old_archive_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ _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) \ _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \ _LT_AC_TAGVAR(archive_cmds, $1) \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ _LT_AC_TAGVAR(postinstall_cmds, $1) \ _LT_AC_TAGVAR(postuninstall_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ _LT_AC_TAGVAR(allow_undefined_flag, $1) \ _LT_AC_TAGVAR(no_undefined_flag, $1) \ _LT_AC_TAGVAR(export_symbols_cmds, $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_automatic, $1) \ _LT_AC_TAGVAR(module_cmds, $1) \ _LT_AC_TAGVAR(module_expsym_cmds, $1) \ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ _LT_AC_TAGVAR(fix_srcfile_path, $1) \ _LT_AC_TAGVAR(exclude_expsyms, $1) \ _LT_AC_TAGVAR(include_expsyms, $1); do case $var in _LT_AC_TAGVAR(old_archive_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ _LT_AC_TAGVAR(archive_cmds, $1) | \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ _LT_AC_TAGVAR(module_cmds, $1) | \ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\[$]0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` ;; esac ifelse([$1], [], [cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" AC_MSG_NOTICE([creating $ofile])], [cfgfile="$ofile"]) cat <<__EOF__ >> "$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, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # 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) # 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=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # 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 directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # 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=$lt_sys_lib_search_path_spec # 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_fix_srcfile_path # 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([LT_AC_PROG_SED]) 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* | k*bsd*-gnu) 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 -rf 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* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_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)= ;; interix[[3-9]]*) # 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 aix[[4-9]]*) # 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* | 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* | k*bsd*-gnu) 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* | pgcpp*) # 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' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _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 ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; 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* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_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' ;; interix[[3-9]]*) # 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* | cygwin* | 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). m4_if([$1], [GCJ], [], [_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* | k*bsd*-gnu) 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' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _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)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _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)='' ;; esac ;; 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' ;; rdos*) _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_cv_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_cv_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_REQUIRE([LT_AC_PROG_SED])dnl 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 aix[[4-9]]*) # 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' ;; linux* | k*bsd*-gnu) _LT_AC_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ],[ 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_|_GLOBAL__F[ID]_.*'] # 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. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. 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 aix[[3-9]]*) # 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/'\'' -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 ;; interix[[3-9]]*) _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' ;; gnu* | linux* | k*bsd*-gnu) 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 case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi _LT_AC_TAGVAR(link_all_deplibs, $1)=no else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) 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 ;; aix[[4-9]]*) 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]].*|aix[[5-9]]*) 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 : 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_dar_single_mod${_lt_dsymutil}" _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" 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` $xlcverstring' _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 $xlcverstring~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* | 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* | netbsdelf*-gnu) 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*) if test -f /usr/libexec/ld.so; then _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 else _LT_AC_TAGVAR(ld_shlibs, $1)=no 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 and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; 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* | 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' 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* echo "$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) ]) # Cheap backport of AS_EXECUTABLE_P and required macros # from Autoconf 2.59; we should not use $as_executable_p directly. # _AS_TEST_PREPARE # ---------------- m4_ifndef([_AS_TEST_PREPARE], [m4_defun([_AS_TEST_PREPARE], [if test -x / >/dev/null 2>&1; then as_executable_p='test -x' else as_executable_p='test -f' fi ])])# _AS_TEST_PREPARE # AS_EXECUTABLE_P # --------------- # Check whether a file is executable. m4_ifndef([AS_EXECUTABLE_P], [m4_defun([AS_EXECUTABLE_P], [AS_REQUIRE([_AS_TEST_PREPARE])dnl $as_executable_p $1[]dnl ])])# AS_EXECUTABLE_P # 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, 2006, 2007 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. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) # 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` ]) # Copyright (C) 1996, 1997, 1999, 2000, 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 4 # This was merged into AC_PROG_CC in Autoconf. AU_DEFUN([AM_PROG_CC_STDC], [AC_PROG_CC AC_DIAGNOSE([obsolete], [$0: your code should no longer depend upon `am_cv_prog_cc_stdc', but upon `ac_cv_prog_cc_stdc'. Remove this warning and the assignment when you adjust the code. You can also remove the above call to AC_PROG_CC if you already called it elsewhere.]) am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc ]) AU_DEFUN([fp_PROG_CC_STDC]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # 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 # 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])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl 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, 2006 # 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 9 # 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], UPC, [depcc="$UPC" am_compiler_list=], [$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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/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"]) ]) # 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 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008 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 13 # 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.60])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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi 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 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])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 AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])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_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/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-"\$(SHELL) $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])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 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 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # 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, 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 5 # 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 AC_REQUIRE_AUX_FILE([missing])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, 2006 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 for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # 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="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 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_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # 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 libqalculate-0.9.7/data/0000777000175100017510000000000011320655052012110 500000000000000libqalculate-0.9.7/data/datasets.xml.in0000644000175100017510000001332611320653617014775 00000000000000 <_title>Data Sets <_title>!datasets!Elements elements.xml <_names>r:atom <_title>!datasets!Element <_title>Symbol text true <_names>r:symbol <_title>!datasets!Number number true <_names>!datasets!r:number <_title>Name text true <_names>r:name <_title>Classification <_description>A number representing an element group: 1 Alkali Metal 2 Alkaline-Earth Metal 3 Lanthanide 4 Actinide 5 Transition Metal 6 Metal 7 Metalloid 8 Non-Metal 9 Halogen 10 Noble Gas 11 Transactinide number <_names>r:class <_title>Weight number true u true <_names>r:weight,mass <_title>Boiling Point number K true <_names>r:boiling <_title>Melting Point number K true <_names>r:melting <_title>Density <_description>Density at 295K number g/cm^3 true <_names>r:density <_title>Ionization Potential number eV true <_names>r:ionization <_title>Covalent Radius number Å true <_names>r:covalent <_title>X Position number true <_names>r:x_pos <_title>Y Position number true <_names>r:y_pos <_title>Planets planets.xml This data uses material from the Wikipedia articles "Earth" (http://www.wikipedia.org/wiki/Earth), "Jupiter (planet)" (http://www.wikipedia.org/wiki/Jupiter_(planet)), "Mars (planet)" (http://www.wikipedia.org/wiki/Mars_(planet)), "Mercury (planet)" (http://www.wikipedia.org/wiki/Mercury_(planet)), "Neptune (planet)" (http://www.wikipedia.org/wiki/Neptune_(planet)), "Pluto (planet)" (http://www.wikipedia.org/wiki/Pluto_(planet)), "Saturn (planet)" (http://www.wikipedia.org/wiki/Saturn_(planet)), "Uranus (planet)" (http://www.wikipedia.org/wiki/Uranus_(planet)), and "Venus (planet)" (http://en.wikipedia.org/wiki/Venus_(planet)), licensed under the GNU Free Documentation License (http://www.gnu.org/copyleft/fdl.html) <_names>r:planet <_title>Planet <_title>Name text true <_names>r:name <_title>Orbital Period (Year) number d true <_names>!datasets!r:year <_title>Average Orbital Speed number km/s true <_names>r:speed <_title>Eccentricity number true <_names>r:eccentricity <_title>Inclination number true <_names>r:inclination <_title>Number of Satellites number <_names>r:satellites <_title>!datasets!Mass number kg true <_names>r:mass <_title>Mean Density number g/cm^3 true <_names>r:density <_title>Surface Area number km^2 true <_names>!datasets!r:area <_title>Equatorial Gravity number m/s^2 true <_names>r:gravity <_title>Mean Surface Temperature number K true <_names>r:temperature libqalculate-0.9.7/data/Makefile.am0000644000175100017510000000052111305546371014064 00000000000000# # data/Makefile.am for qalculate # xmldir = $(datadir)/qalculate xml_in_files = currencies.xml.in datasets.xml.in elements.xml.in functions.xml.in planets.xml.in prefixes.xml.in units.xml.in variables.xml.in xml_DATA = $(xml_in_files:.xml.in=.xml) @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ EXTRA_DIST = \ $(xml_in_files) $(xml_DATA) libqalculate-0.9.7/data/elements.xml.in0000644000175100017510000010237111320653617015000 00000000000000 <_name>Hydrogen 8 1.00794 20.28 13.81 0.000084 13.5984 0.37 1 1 <_name>Helium 10 4.002602 4.216 0.95 0.0001785 24.5874 0.32 18 1 <_name>Lithium 1 6.941 1615 453.7 0.53 5.3917 1.34 1 2 <_name>Beryllium 2 9.012182 3243 1560 1.85 9.3227 0.90 2 2 <_name>Boron 7 10.811 4275 2365 2.46 8.2980 0.82 13 2 <_name>Carbon 8 12.0107 5100 3825 3.51 11.2603 0.77 14 2 <_name>Nitrogen 8 14.00674 77.344 63.15 0.00117 14.5341 0.75 15 2 <_name>Oxygen 8 15.9994 90.188 54.8 0.00133 13.6181 0.73 16 2 <_name>Fluorine 9 18.9984032 85 53.55 0.00158 17.4228 0.71 17 2 <_name>Neon 10 20.1797 27.1 24.55 0.0008999 21.5645 0.69 18 2 <_name>Sodium 1 22.989770 1156 371 0.97 5.1391 1.54 1 3 <_name>Magnesium 2 24.3050 1380 922 1.74 7.6462 1.30 2 3 <_name>Aluminum 6 26.981538 2740 933.5 2.7 5.9858 1.18 13 3 <_name>Silicon 7 28.0855 2630 1683 2.33 8.1517 1.11 14 3 <_name>Phosphorus 8 30.973761 553 317.3 1.82 10.4867 1.06 15 3 <_name>Sulfur 8 32.065 717.82 392.2 2.06 10.3600 1.02 16 3 <_name>Chlorine 9 35.453 239.18 172.17 0.00295 12.9676 0.99 17 3 <_name>Argon 10 39.948 87.45 83.95 0.00166 15.7596 0.97 18 3 <_name>Potassium 1 39.0983 1033 336.8 0.86 4.3407 1.96 1 4 <_name>Calcium 2 40.078 1757 1112 1.54 6.1132 1.74 2 4 <_name>Scandium 5 44.955912 3109 1814 2.99 6.5615 1.44 3 4 <_name>Titanium 5 47.867 3560 1935 4.51 6.8281 1.36 4 4 <_name>Vanadium 5 50.9415 3650 2163 6.09 6.7462 1.25 5 4 <_name>Chromium 5 51.9961 2945 2130 7.14 6.7665 1.27 6 4 <_name>Manganese 5 54.938049 2235 1518 7.44 7.4340 1.39 7 4 <_name>Iron 5 55.845 3023 1808 7.874 7.9024 1.25 8 4 <_name>Cobalt 5 58.933200 3143 1768 8.89 7.8810 1.26 9 4 <_name>Nickel 5 58.6934 3005 1726 8.91 7.6398 1.21 10 4 <_name>Copper 5 63.546 2840 1356.6 8.92 7.7264 1.38 11 4 <_name>Zinc 5 65.409 1180 692.73 7.14 9.3942 1.31 12 4 <_name>Gallium 6 69.723 2478 302.92 5.91 5.9993 1.26 13 4 <_name>Germanium 7 72.64 3107 1211.5 5.32 7.8994 1.22 14 4 <_name>Arsenic 7 74.92160 876 1090 5.72 9.7886 1.19 15 4 <_name>Selenium 8 78.96 958 494 4.82 9.7524 1.16 16 4 <_name>Bromine 9 79.904 331.85 265.95 3.14 11.8138 1.14 17 4 <_name>Krypton 10 83.798 120.85 116 0.00448 13.9996 1.10 18 4 <_name>Rubidium 1 85.4678 961 312.63 1.53 4.1771 2.11 1 5 <_name>Strontium 2 87.62 1655 1042 2.63 5.6949 1.92 2 5 <_name>Yttrium 5 88.90585 3611 1795 4.47 6.2173 1.62 3 5 <_name>Zirconium 5 91.224 4682 2128 6.51 6.6339 1.48 4 5 <_name>Niobium 5 92.90638 5015 2742 8.58 6.7589 1.37 5 5 <_name>Molybdenum 5 95.94 4912 2896 10.28 7.0924 1.45 6 5 <_name>Technetium 5 [98] 4538 2477 11.49 7.28 1.56 7 5 <_name>Ruthenium 5 101.07 4425 2610 12.45 7.3605 1.26 8 5 <_name>Rhodium 5 102.90550 3970 2236 12.41 7.4589 1.35 9 5 <_name>Palladium 5 106.42 3240 1825 12.02 8.3369 1.31 10 5 <_name>Silver 5 107.8682 2436 1235.1 10.49 7.5762 1.53 11 5 <_name>Cadmium 5 112.411 1040 594.26 8.64 8.9938 1.48 12 5 <_name>Indium 6 114.818 2350 429.78 7.31 5.7864 1.44 13 5 <_name>Tin 6 118.710 2876 505.12 7.29 7.3439 1.41 14 5 <_name>Antimony 7 121.760 1860 903.91 6.69 8.6084 1.38 15 5 <_name>Tellurium 7 127.60 1261 722.72 6.25 9.0096 1.35 16 5 <_name>Iodine 9 126.90447 457.5 386.7 4.94 10.4513 1.33 17 5 <_name>Xenon 10 131.293 165.1 161.39 0.00449 12.1298 1.30 18 5 <_name>Cesium 1 132.90545 944 301.54 1.9 3.8939 2.25 1 6 <_name>Barium 2 137.327 2078 1002 3.65 5.2117 1.98 2 6 <_name>Lanthanum 3 138.9055 3737 1191 6.16 5.5769 1.69 3 9 <_name>Cerium 3 140.116 3715 1071 6.77 5.5387 4 9 <_name>Praseodymium 3 140.90765 3785 1204 6.48 5.473 5 9 <_name>Neodymium 3 144.24 3347 1294 7 5.5250 6 9 <_name>Promethium 3 [145] 3273 1315 7.22 5.582 7 9 <_name>Samarium 3 150.36 2067 1347 7.54 5.6437 8 9 <_name>Europium 3 151.964 1800 1095 5.25 5.6704 9 9 <_name>Gadolinium 3 157.25 3545 1585 7.89 6.1498 10 9 <_name>Terbium 3 158.92534 3500 1629 8.25 5.8638 11 9 <_name>Dysprosium 3 162.500 2840 1685 8.56 5.9389 12 9 <_name>Holmium 3 164.93032 2968 1747 8.78 6.0215 13 9 <_name>Erbium 3 167.259 3140 1802 9.05 6.1077 14 9 <_name>Thulium 3 168.93421 2223 1818 9.32 6.1843 15 9 <_name>Ytterbium 3 173.04 1469 1092 9.32 6.2542 16 9 <_name>Lutetium 3 174.967 3668 1936 9.84 5.4259 1.60 3 6 <_name>Hafnium 5 178.49 4875 2504 13.31 6.8251 1.50 4 6 <_name>Tantalum 5 180.9479 5730 3293 16.68 7.5496 1.38 5 6 <_name>Tungsten 5 183.84 5825 3695 19.26 7.8640 1.46 6 6 <_name>Rhenium 5 186.207 5870 3455 21.03 7.8335 1.59 7 6 <_name>Osmium 5 190.23 5300 3300 22.61 8.4382 1.28 8 6 <_name>Iridium 5 192.217 4700 2720 22.65 8.9670 1.37 9 6 <_name>Platinum 5 195.078 4100 2042.1 21.45 8.9588 1.28 10 6 <_name>Gold 5 196.96655 3130 1337.58 19.32 9.2255 1.44 11 6 <_name>!elements!Mercury 5 200.59 629.88 234.31 13.55 10.4375 1.49 12 6 <_name>Thallium 6 204.3833 1746 577 11.85 6.1082 1.48 13 6 <_name>Lead 6 207.2 2023 600.65 11.34 7.4167 1.47 14 6 <_name>Bismuth 6 208.98038 1837 544.59 9.8 7.2855 1.46 15 6 <_name>Polonium 7 [209] 1235 527 9.2 8.414 16 6 <_name>Astatine 9 [210] 211.4 575 9.5 17 6 <_name>Radon 10 [222] 211.4 202 0.00923 10.7485 1.45 18 6 <_name>Francium 1 [223] 950 300 4.0727 1 7 <_name>Radium 2 [226] 1413 973 5.5 5.2784 2 7 <_name>Actinium 4 [227] 3470 1324 10.07 5.17 3 10 <_name>Thorium 4 232.0381 5060 2028 11.72 6.3067 4 10 <_name>Protactinium 4 231.03588 4300 1845 15.37 5.89 5 10 <_name>Uranium 4 238.02891 4407 1408 18.97 6.1941 6 10 <_name>Neptunium 4 [237] 4175 912 20.48 6.2657 7 10 <_name>Plutonium 4 [244] 3505 913 19.74 6.0260 8 10 <_name>Americium 4 [243] 2880 1449 13.67 5.9738 9 10 <_name>Curium 4 [247] 3383 1620 13.51 5.9914 10 10 <_name>Berkelium 4 [247] 1258 13.25 6.1979 11 10 <_name>Californium 4 [251] 1172 15.1 6.2817 12 10 <_name>Einsteinium 4 [252] 1130 8.84 6.42 13 10 <_name>Fermium 4 [257] 1800 6.50 14 10 <_name>Mendelevium 4 [258] 1100 6.58 15 10 <_name>Nobelium 4 [259] 1100 6.65 16 10 <_name>Lawrencium 4 [262] 1900 4.9 3 7 <_name>Rutherfordium 11 [261] 6.0 4 7 <_name>Dubnium 11 [262] 5 7 <_name>Seaborgium 11 [266] 6 7 <_name>Bohrium 11 [264] 7 7 <_name>Hassium 11 [269] 8 7 <_name>Meitnerium 11 [268] 9 7 <_name>Darmstadtium 11 [271] 10 7 <_name>Roentgenium 11 [272] 11 7 <_name>Ununbium 11 [285] 12 7 <_name>Ununtrium 11 [284] 13 7 <_name>Ununquadium 11 [289] 14 7 <_name>Ununpentium 11 [288] 15 7 <_name>Ununhexium 11 [292] 16 7 <_name>Ununseptium 11 17 7 <_name>Ununoctium 11 18 7 libqalculate-0.9.7/data/variables.xml.in0000644000175100017510000003366411305546371015145 00000000000000 <_title>Small Numbers <_title>Per Mille <_names>r:permille,au:‰ 1/1000 <_title>Per Myriad <_names>r:permyriad,au:‱ 1/10000 <_title>Procent <_names>a:%,r:procent 1/100 <_title>Large Numbers <_title>Googolplex <_names>r:googolplex 10^(10^100) <_title>Googol <_names>r:googol 10^100 <_title>Centillion <_names>-r:centillion 1E303 <_title>Vigintillion <_names>-r:vigintillion 1E63 <_title>Novemdecillion <_names>-r:novemdecillion 1E60 <_title>Octodecillion <_names>-r:octodecillion 1E57 <_title>Septendecillion <_names>-r:septendecillion 1E54 <_title>Sexdecillion <_names>-r:sexdecillion 1E51 <_title>Quindecillion <_names>-r:quindecillion 1E48 <_title>Quattuordecillion <_names>-r:quattuordecillion 1E45 <_title>Tredecillion <_names>-r:tredecillion 1E42 <_title>Duodecillion <_names>-r:duodecillion 1E39 <_title>Undecillion <_names>-r:undecillion 1E36 <_title>Decillion <_names>-r:decillion 1E33 <_title>Nonillion <_names>-r:nonillion 1E30 <_title>Octillion <_names>-r:octillion 1E27 <_title>Septillion <_names>-r:septillion 1E24 <_title>Sextillion <_names>-r:sextillion 1E21 <_title>Quintillion <_names>-r:quintillion 1E18 <_title>Quadrillion <_names>-r:quadrillion 1E15 <_title>Trillion <_names>-r:trillion 1E12 <_title>Billion <_names>-r:billion 1E9 <_title>Million <_names>-r:million 1E6 <_title>Thousand <_names>-r:thousand 1E3 <_title>Hundred <_names>-r:hundred 1E2 <_title>Physical Constants <_title>Universal Constants <_title>Speed of Light in Vacuum <_names>ar:c,speed_of_light 299792458*m*s^(-1) <_title>Planck Time <_names>r:planck_time,ais:t_P 5.39121E-44*s <_title>Planck Temperature <_names>r:planck_temperature,ais:T_P 1.41679E32*K <_title>Planck Mass <_names>r:planck_mass,ais:m_P 2.17645E-5*g <_title>Planck Length <_names>r:planck_length,ais:l_P 1.61624E-35*m <_title>Planck Constant <_names>r:planck 6.6260693E-34*J*s <_title>Planck Constant over 2 pi <_names>r:planck2pi planck/(2*pi) <_title>Newtonian Constant of Gravitation <_names>r:newtonian_constant,a:G 6.6742E-11*m^3*kg^(-1)*s^(-2) <_title>Electric Constant (Permittivity of Free Space) <_names>r:electric_constant,aisu:ε_0 1/(4E-7*pi*299792458^2)*F*m^(-1) <_title>Magnetic Constant (Permeability of Free Space) <_names>r:magnetic_constant,aisu:μ_0 4E-7*pi*N*A^(-2) <_title>Characteristic Impedance of Vacuum <_names>r:characteristic_impedance,ais:Z_0 4E-7*pi*299792458*ohm <_title>Electromagnetic Constants <_title>Borh Magneton <_names>r:bohr_magneton,aisu:μ_B 927.400949E-26*J*T^(-1) <_title>Conductance Quantum <_names>r:conductance_quantum,ais:G_0 7.748091733E-5*S <_title>Elementary Charge <_names>r:elementary_charge,ais:e_charge 1.60217653E-19*C <_title>Josephson Constant <_names>r:josephson,ais:K_J 483597.879E9*Hz*V^(-1) <_title>Magnetic Flux Quantum <_names>r:magnetic_flux_quantum,aisu:Φ_0 2.06783372E-15*Wb <_title>Nuclear Magneton <_names>r:nuclear_magneton,aisu:μ_N 5.05078343E-27*J*T^(-1) <_title>von Klitzing Constant <_names>r:klitzing,ais:R_K 25812.807449*ohm <_title>Atomic and Nuclear Constants <_title>Alpha Particle Mass <_names>r:alpha_particle_mass,aisu:m_α 6.6446565E-24*g <_title>Bohr Radius <_names>r:bohr_radius,ais:a_o 0.5291772108E-10*m <_title>Classical Electron Radius <_names>r:classical_electron_radius,ais:r_e 2.817940325E-15*m <_title>Compton Wavelength <_names>r:compton_wavelength,aisu:λ_C 2.426310238E-12*m <_title>Electron Mass <_names>r:electron_mass,ais:m_e 9.1093826E-28*g <_title>Helion Mass <_names>r:helion_mass,ais:m_h 5.00641214E-24*g <_title>Neutron Mass <_names>r:neutron_mass,ais:m_n 1.67492728E-24*g <_title>Proton Mass <_names>r:proton_mass,ais:m_p 1.67262171E-24*g <_title>Rydberg Constant <_names>r:rydberg,aisu:R_∞ 10973731.568525*m^(-1) <_title>Tau Mass <_names>r:tau_mass,aisu:m_τ 3.16777E-24*g <_title>Physico-Chemical Constants <_title>Atomic Mass Constant <_names>r:atomic_mass,ais:m_u 1.66053886E-24*g <_title>Avogadro Constant <_names>r:avogadro,ais:N_A 6.0221415E23*mol^(-1) <_title>Boltzmann Constant <_names>r:boltzmann 1.3806505E-23*J*K^(-1) <_title>Faraday Constant <_names>r:faraday 96485.3383*C*mol^(-1) <_title>First Radiation Constant <_names>r:first_radiation,ais:c_1 3.74177138E-16*W*m^2 <_title>Ideal Gas Constant <_names>r:ideal_gas 8.314472*J*K^(-1)*mol^(-1) <_title>Second Radiation Constant <_names>r:second_radiation,ais:c_2 1.4387752E-2*m*K <_title>Basic Constants <_title>Golden Ratio <_names>r:golden,au:φ (1+sqrt(5))/2 <_title>Omega Constant <_names>r:omega lambertw(1) <_title>Pythagora's Constant (sqrt 2) <_names>r:pythagoras sqrt(2) <_title>Apery's Constant <_names>r:apery zeta(3) <_title>Base of Natural Logarithms (e) <_names>r:e <_title>Archimede's Constant (pi) <_names>au:π,r:pi <_title>Euler's Constant <_names>au:γ,r:euler <_title>Catalan's Constant <_names>r:catalan <_title>Special Numbers <_title>Imaginary i (sqrt -1) <_names>r:i <_title>Infinity <_names>r:infinity <_title>Positive Infinity <_names>r:plus_infinity <_title>Negative Infinity <_names>r:minus_infinity <_title>Undefined <_names>r:undefined <_title>False <_names>r:false,r:no 0 <_title>True <_names>r:true,r:yes 1 <_title>Unknowns <_names>r:x <_names>r:y <_names>r:z libqalculate-0.9.7/data/currencies.xml.in0000644000175100017510000001710411305546371015326 00000000000000 <_title>Currency <_title>European Euros <_names>ar:EUR,au:€,euro,p:euros <_title>U.S. Dollars <_names>a:$,ar:USD,dollar,p:dollars <_title>Japanese Yen <_names>ar:JPY,au:¥,yen <_title>Danish Kroner <_names>ar:DKK <_title>British Pounds <_names>ar:GBP,au:£ <_title>Thai Bat <_names>ar:THB <_title>Swedish Krona <_names>ar:SEK <_title>Swiss Francs <_names>ar:CHF <_title>Icelandic Krona <_names>ar:ISK <_title>Norwegian Kroner <_names>ar:NOK <_title>Bulgarian Lev <_names>lev,ar:BGN <_title>Russian Ruble <_names>ar:RUB,ruble <_title>Phillipine Peso <_names>ar:PHP <_title>Malaysian Ringgit <_names>ar:MYR <_title>Croatian Kuna <_names>ar:HRK <_title>Yuan Renmimbi (PR China) <_names>ar:CNY <_title>Indonesian Rupiah <_names>ar:IDR <_title>Cypriot Pound <_names>ar:CYP <_title>Czech Koruna <_names>ar:CZK <_title>Estonian Kroon <_names>ar:EEK <_title>Hungarian Forint <_names>forint,ar:HUF <_title>Lithuanian Lit <_names>lit,ar:LTL <_title>Latvian Lat <_names>lat,ar:LVL <_title>Maltese Lira <_names>ar:MTL <_title>Polish Zloty <_names>zloty,ar:PLN <_title>Romanian New Leu <_names>leu,ar:RON <_title>Slovenian Tolar <_names>tolar,ar:SIT <_title>Slovakian Koruna <_names>ar:SKK <_title>Turkish New Lira <_names>ar:TRY <_title>Australian Dollars <_names>ar:AUD <_title>Canadian Dollars <_names>ar:CAD <_title>Hong Kong Dollars <_names>ar:HKD <_title>New Zealand Dollars <_names>ar:NZD <_title>Singapore Dollars <_names>ar:SGD <_title>South Korean Won <_names>ar:KRW <_title>South African Rand <_names>ar:ZAR <_title>Euro Cent <_names>r:eurocent,p:eurocents EUR 1/100 1 <_title>Cent (USD) <_names>au:¢,r:cent,p:cents USD 1/100 1 <_title>Belgian Franc <_names>ar:BEF EUR 1/40.3399 1 <_title>Greek Drachma <_names>ar:GRD EUR 1/340.750 1 <_title>French Franc <_names>ar:FRF,franc EUR 1/6.55957 1 <_title>Italian Lira <_names>ar:ITL,lira EUR 1/1936.27 1 <_title>Dutch Guilder <_names>ar:NLG,guilder EUR 1/2.20371 1 <_title>Portuguese Escudo <_names>ar:PTE,escudo EUR 1/200.482 1 <_title>Deutche Mark <_names>ar:DEM,mark EUR 1/1.95583 1 <_title>Spanish Peseta <_names>ar:ESP,peseta,p:pesetas EUR 1/166.386 1 <_title>Irish Pound <_names>ar:IEP EUR 1/0.787564 1 <_title>Luxembourg Franc <_names>ar:LUF EUR 1/40.3399 1 <_title>Austrian Schilling <_names>ar:ATS,schilling EUR 1/13.7603 1 <_title>Finnish Markka <_names>ar:FIM,markka EUR 1/5.94573 1 libqalculate-0.9.7/data/datasets.xml0000644000175100017510000003261611320655050014364 00000000000000 Data Sets Gegevensverzamelingen Dataset 数据集 !datasets!Elements Elementen Element 元素 elements.xml r:atom atoom r:atom !datasets!Element Element 元素 Symbol Symbool Symbol 符号 text true r:symbol symbool r:symbol !datasets!Number Getal Nummer 编号 number true !datasets!r:number getal nummer 编号 Name Naam Namn 名称 text true r:name naam namn r:name Classification Klassificatie Klassificering 分类 A number representing an element group: 1 Alkali Metal 2 Alkaline-Earth Metal 3 Lanthanide 4 Actinide 5 Transition Metal 6 Metal 7 Metalloid 8 Non-Metal 9 Halogen 10 Noble Gas 11 Transactinide Een getal vertegenwoordigt een groep van elementen: 1 Alkalisch metaal 2 Alkalischaardmetaal 3 Lanthanide 4 Actinide 5 Overgangsmetaal 6 Metaal 7 Metalloïde 8 Niet-metaal 9 Halogeen 10 Edelgas 11 Transactinide Ett nummer som representerar en elementgrupp: 1 Alkalimetall 2 Jordalkalimetall 3 Lantanid 4 Aktinid 5 Övergångsmetall 6 Metall 7 Halvmetall 8 Icke-metall 9 Halogen 10 Ädelgas 11 Transaktinid 一个代表元素族的数字: 1 碱金属 2 硷土金属 3 镧系元素 4 锕系元素 5 过渡金属元素 6 金属 7 半金属元素 8 非金属 9 卤素 10 惰性气体 11 锕系后元素 number r:class klasse klass r:class Weight Gewicht Vikt 重量 number true u true r:weight,mass gewicht,massa vikt,massa r:weight,mass Boiling Point Kookpunt Kokpunkt 沸点 number K true r:boiling kokend kokpunkt r:boiling Melting Point Smeltpunt Smältpunkt 熔点 number K true r:melting smeltend smältpunkt r:melting Density Dichtheid Densitet 密度 Density at 295K Dichtheid bij 295K Densitet vid 295K 295K时的密度 number g/cm^3 true r:density dichtheid densitet r:density Ionization Potential Ionisatiepotentiaal Joniseringspotential 电离电位 number eV true r:ionization ionisatie jonisering r:ionization Covalent Radius Covalente straal Kovalent radie 共价半径 number Å true r:covalent covalent kovalent r:covalent X Position X Positie X坐标 number true r:x_pos r:x_pos Y Position Y Positie Y坐标 number true r:y_pos r:y_pos Planets Planeten Planeter 行星 planets.xml This data uses material from the Wikipedia articles "Earth" (http://www.wikipedia.org/wiki/Earth), "Jupiter (planet)" (http://www.wikipedia.org/wiki/Jupiter_(planet)), "Mars (planet)" (http://www.wikipedia.org/wiki/Mars_(planet)), "Mercury (planet)" (http://www.wikipedia.org/wiki/Mercury_(planet)), "Neptune (planet)" (http://www.wikipedia.org/wiki/Neptune_(planet)), "Pluto (planet)" (http://www.wikipedia.org/wiki/Pluto_(planet)), "Saturn (planet)" (http://www.wikipedia.org/wiki/Saturn_(planet)), "Uranus (planet)" (http://www.wikipedia.org/wiki/Uranus_(planet)), and "Venus (planet)" (http://en.wikipedia.org/wiki/Venus_(planet)), licensed under the GNU Free Documentation License (http://www.gnu.org/copyleft/fdl.html) r:planet planeet r:planet Planet Planeet 行星 Name Naam Namn 名称 text true r:name naam namn r:name Orbital Period (Year) Omloopperiode (Jaar) Omkretstid (år) 轨道周期(年) number d true !datasets!r:year jaar år Average Orbital Speed Gemiddelde baansnelheid Genomsnittlig kretsloppshastighet 平均归到速度 number km/s true r:speed snelheid hastighet r:speed Eccentricity Excentriciteit Excentricitet 偏心率 number true r:eccentricity excentriciteit excentricitet r:eccentricity Inclination Inclinatie Inklination 倾角 number true r:inclination inclinatie inklination r:inclination Number of Satellites Aantal satellieten Antal satelliter 卫星个数 number r:satellites satellieten satelliter r:satellites !datasets!Mass Massa Massa 质量 number kg true r:mass massa massa r:mass Mean Density Gemiddelde dichtheid Genomsnittlig densitet 平均密度 number g/cm^3 true r:density dichtheid densitet r:density Surface Area Oppervlak (3D) Ytarea 表面积 number km^2 true !datasets!r:area oppervlak 面积 Equatorial Gravity Equatoriale zwaartekracht Ekvatoriell tyngdkraft 赤道重力 number m/s^2 true r:gravity zwaartekracht tyngdkraft r:gravity Mean Surface Temperature Gemiddelde oppervlaktetemperatuur Genomsnittlig yttemperatur 平均表面温度 number K true r:temperature temperatuur temperatur r:temperature libqalculate-0.9.7/data/variables.xml0000644000175100017510000010562311320655052014525 00000000000000 Small Numbers Kleine getallen Små tal 小数字 Per Mille Per mille Promille 千分之一 r:permille,au:‰ r:permille,au:‰ 1/1000 Per Myriad Per myriad 万分之一 r:permyriad,au:‱ r:permyriad,au:‱ 1/10000 Procent Procent a:%,r:procent a:%,r:procent 1/100 Large Numbers Grote getallen Stora tal 大数 Googolplex Googolplex r:googolplex r:googolplex 10^(10^100) Googol Googol 大数 r:googol r:googol 10^100 Centillion Quinquagintiljard 百万的一百次方 -r:centillion quinquagintiljard -r:centillion 1E303 Vigintillion Deciljard Deciljard -r:vigintillion deciljard deciljard,p:deciljarder -r:vigintillion 1E63 Novemdecillion deciljoen Deciljon -r:novemdecillion deciljoen deciljon,p:deciljoner -r:novemdecillion 1E60 Octodecillion Noniljard Noniljard -r:octodecillion noniljard noniljard,p:noniljarder -r:octodecillion 1E57 Septendecillion Noniljoen Noniljon -r:septendecillion noniljoen noniljon,p:noniljoner -r:septendecillion 1E54 Sexdecillion Octiljard Oktiljard -r:sexdecillion octiljard oktiljard,p:oktiljarder -r:sexdecillion 1E51 Quindecillion Octiljoen Oktiljon -r:quindecillion octiljoen oktiljon,p:oktiljoner -r:quindecillion 1E48 Quattuordecillion Septiljard Septiljard -r:quattuordecillion septiljard septiljard,p:septiljarder -r:quattuordecillion 1E45 Tredecillion Septiljoen Septiljon -r:tredecillion septiljoen septiljon,p:septiljoner -r:tredecillion 1E42 Duodecillion Sextiljard Sextiljard -r:duodecillion sextiljard sextiljard,p:sextiljarder -r:duodecillion 1E39 Undecillion Sextiljoen Sextiljon -r:undecillion sextiljoen sextiljon,p:sextiljoner -r:undecillion 1E36 Decillion Quintiljard Kvintiljard -r:decillion quintiljard kvintiljard,p:kvintiljarder -r:decillion 1E33 Nonillion Quintiljoen Kvintiljon -r:nonillion quintiljoen kvintiljon,p:kvintiljoner -r:nonillion 1E30 Octillion Quadriljard Kvadriljard -r:octillion quadriljard kvadriljard,p:kvadriljarder -r:octillion 1E27 Septillion Quadriljoen Kvadriljon -r:septillion quadriljoen kvadriljon,p:kvadriljoner -r:septillion 1E24 Sextillion Triljard Triljard -r:sextillion triljard triljard,p:triljarder -r:sextillion 1E21 Quintillion Triljoen Triljon -r:quintillion triljoen triljon,p:triljoner -r:quintillion 1E18 Quadrillion Biljard Biljard -r:quadrillion biljard biljard,p:biljarder -r:quadrillion 1E15 Trillion Biljoen Biljon -r:trillion biljoen biljon,p:biljoner -r:trillion 1E12 Billion Miljard Miljard 十亿 -r:billion miljard miljard,p:miljarder -r:billion 1E9 Million Miljoen Miljon 百万 -r:million miljoen miljon,p:miljoner -r:million 1E6 Thousand Duizend Tusen -r:thousand duizend tusen -r:thousand 1E3 Hundred Honderd Hundra -r:hundred honderd hundra -r:hundred 1E2 Physical Constants Natuurkundige constanten Fysiska konstanter 物理常数 Universal Constants Universele constanten Universala konstanter 普适常数 Speed of Light in Vacuum Lichtsnelheid in vacuüm Ljusets hastighet i vakuum 真空中光速 ar:c,speed_of_light c,licht_snelheid a:c,ljusets_hastighet ar:c,speed_of_light 299792458*m*s^(-1) Planck Time Plancktijd Planck-tid 普朗克时间 r:planck_time,ais:t_P planck_tijd,t_P r:planck_time,ais:t_P 5.39121E-44*s Planck Temperature Plancktemperatuur Planck-temperatur 普朗克温度 r:planck_temperature,ais:T_P planck_temperatuur,T_P r:planck_temperature,ais:T_P 1.41679E32*K Planck Mass Planckmassa Planck-massa 普朗克质量 r:planck_mass,ais:m_P planck_massa,m_P r:planck_mass,ais:m_P 2.17645E-5*g Planck Length Plancklengte Planck-längd 普朗克长度 r:planck_length,ais:l_P planck_lengte,l_P r:planck_length,ais:l_P 1.61624E-35*m Planck Constant Planck constante Plancks konstant 普朗克常数 r:planck r:planck 6.6260693E-34*J*s Planck Constant over 2 pi Planck constante gedeeld door 2 pi Plancks konstant över 2 pi 普朗克常数每2π r:planck2pi r:planck2pi planck/(2*pi) Newtonian Constant of Gravitation Newtons zwaartekrachtconstante Newtonska gravitationskonstanten 牛顿引力常数 r:newtonian_constant,a:G newton_constante,G r:newtonian_constant,a:G 6.6742E-11*m^3*kg^(-1)*s^(-2) Electric Constant (Permittivity of Free Space) Elektrische constante (permittiviteit vrije ruimte) Elektriska konstanten 介电常数(自由空间介电常数) r:electric_constant,aisu:ε_0 elektrische_constante,ε_0 r:electric_constant,aisu:ε_0 1/(4E-7*pi*299792458^2)*F*m^(-1) Magnetic Constant (Permeability of Free Space) Magnetische constante (permeabiliteit vrije ruimte) Magnetiska konstanten 磁常数(自由空间磁导率) r:magnetic_constant,aisu:μ_0 magnetische_constante,μ_0 r:magnetic_constant,aisu:μ_0 4E-7*pi*N*A^(-2) Characteristic Impedance of Vacuum Karakteristieke impedantie vacuüm Karaktäristisk impedans för vakuum 真空特性阻抗 r:characteristic_impedance,ais:Z_0 karakteristieke_impedantie,Z_0 r:characteristic_impedance,ais:Z_0 4E-7*pi*299792458*ohm Electromagnetic Constants Elektromagnetische constanten Elektromagnetiska konstanter 电磁常数 Borh Magneton Borh Magneton Bohrs magneton 玻尔磁子 r:bohr_magneton,aisu:μ_B r:bohr_magneton,aisu:μ_B 927.400949E-26*J*T^(-1) Conductance Quantum Geleidingsvermogen kwantum Konduktanskvantum 量子电导 r:conductance_quantum,ais:G_0 geleidings_kwantum,G_0 r:conductance_quantum,ais:G_0 7.748091733E-5*S Elementary Charge Elementaire lading Elementarladdning 基本电荷 r:elementary_charge,ais:e_charge elementaire_lading,e_lading r:elementary_charge,ais:e_charge 1.60217653E-19*C Josephson Constant Josephson constante Josephsons konstant 约瑟夫森常数 r:josephson,ais:K_J r:josephson,ais:K_J 483597.879E9*Hz*V^(-1) Magnetic Flux Quantum Magnetische flux kwantum Magnetflödeskonstanten 磁通量量子 r:magnetic_flux_quantum,aisu:Φ_0 magnetische_flux_kwantum,Φ_0 r:magnetic_flux_quantum,aisu:Φ_0 2.06783372E-15*Wb Nuclear Magneton Nucleaire magneton Kärnmagneton 核磁子 r:nuclear_magneton,aisu:μ_N nucleaire_magneton,μ_N r:nuclear_magneton,aisu:μ_N 5.05078343E-27*J*T^(-1) von Klitzing Constant von Klitzing constante 冯·克里青常数 r:klitzing,ais:R_K r:klitzing,ais:R_K 25812.807449*ohm Atomic and Nuclear Constants Atomaire- en nucleaire constanten Atomära och nukleära konstanter 原子与核物理常数 Alpha Particle Mass Massa alfadeeltje Alfapartikelmassa α粒子质量 r:alpha_particle_mass,aisu:m_α alfa_deeltje_massa,m_α r:alpha_particle_mass,aisu:m_α 6.6446565E-24*g Bohr Radius Bohr-straal Bohr-radie 玻尔半径 r:bohr_radius,ais:a_o r:bohr_radius,ais:a_o 0.5291772108E-10*m Classical Electron Radius Klassieke straal elektron Klassisk elektron-radie 经典电子半径 r:classical_electron_radius,ais:r_e klassieke_electron_radius,r_e r:classical_electron_radius,ais:r_e 2.817940325E-15*m Compton Wavelength Compton golflengte Compton-våglängd 康普顿波长 r:compton_wavelength,aisu:λ_C compton_golflengte,λ_C r:compton_wavelength,aisu:λ_C 2.426310238E-12*m Electron Mass Elektronmassa Elektronmassa 电子质量 r:electron_mass,ais:m_e elektron_massa,m_e r:electron_mass,ais:m_e 9.1093826E-28*g Helion Mass Helionmassa Helion-massa Helion质量 r:helion_mass,ais:m_h helion_massa,m_h r:helion_mass,ais:m_h 5.00641214E-24*g Neutron Mass Neutronmassa Neutronmassa 中子质量 r:neutron_mass,ais:m_n neutron_massa,m_n r:neutron_mass,ais:m_n 1.67492728E-24*g Proton Mass Protonmassa Protonmassa 质子质量 r:proton_mass,ais:m_p proton_massa,m_p r:proton_mass,ais:m_p 1.67262171E-24*g Rydberg Constant Rydberg constante Rydbergs konstant 里德伯常数 r:rydberg,aisu:R_∞ r:rydberg,aisu:R_∞ 10973731.568525*m^(-1) Tau Mass Tau massa Tau-massa γ质量 r:tau_mass,aisu:m_τ tau_massa,m_τ r:tau_mass,aisu:m_τ 3.16777E-24*g Physico-Chemical Constants Fysisch-chemische constanten Fysikalisk-kemiska konstanter 物理化学常数 Atomic Mass Constant Atomaire massaconstante Atommassenhet 原子质量常数 r:atomic_mass,ais:m_u atoommassa,m_u atommassa,ais:m_u r:atomic_mass,ais:m_u 1.66053886E-24*g Avogadro Constant Avogadro's constante Avogadros konstant 阿佛加德罗常数 r:avogadro,ais:N_A r:avogadro,ais:N_A 6.0221415E23*mol^(-1) Boltzmann Constant Constante van Boltzmann Boltzmanns konstant 玻耳兹曼常数 r:boltzmann r:boltzmann 1.3806505E-23*J*K^(-1) Faraday Constant Faraday constante Faradays konstant 法拉第常数 r:faraday r:faraday 96485.3383*C*mol^(-1) First Radiation Constant Eerste stralingsconstante Första strålningskonstanten 第一辐射常数 r:first_radiation,ais:c_1 eerste_straling,c_1 r:first_radiation,ais:c_1 3.74177138E-16*W*m^2 Ideal Gas Constant Ideale gasconstante Gaskonstant 理想气体常数 r:ideal_gas ideale_gas r:ideal_gas 8.314472*J*K^(-1)*mol^(-1) Second Radiation Constant Tweede stralingsconstante Andra strålningskonstanten 第二辐射常数 r:second_radiation,ais:c_2 tweede_straling,c_2 r:second_radiation,ais:c_2 1.4387752E-2*m*K Basic Constants Basisconstanten Grundläggande konstanter 基本常数 Golden Ratio Gulden snede Golden ratio 黄金比例 r:golden,au:φ gouden,φ r:golden,au:φ (1+sqrt(5))/2 Omega Constant Omega constante Omegakonstanten Ω常数 r:omega lambertw(1) Pythagora's Constant (sqrt 2) Pythagoras constante (sqrt 2) Pythagoras konstant (sqrt 2) 毕达哥拉斯常数(根号2) r:pythagoras r:pythagoras sqrt(2) Apery's Constant Apery's constante Aperys konstant Apery常数 r:apery r:apery zeta(3) Base of Natural Logarithms (e) Grondtal natuurlijke logaritmen (e) Basen för naturliga logaritmer (e) 自然对数的底e r:e r:e Archimede's Constant (pi) Archimede's constante (pi) Archimedes konstant (pi) 圆周率(π) au:π,r:pi au:π,r:pi Euler's Constant Euler's constante Eulers konstant 欧拉常数 au:γ,r:euler au:γ,r:euler Catalan's Constant Catalan's constante Catalans konstant Catalan常数 r:catalan r:catalan Special Numbers Bijzondere getallen Speciella nummer 特殊数字 Imaginary i (sqrt -1) Imaginaire i (sqrt -1) Imaginärt i (sqrt -1) 虚数i(sqrt -1) r:i . r:i Infinity Oneindig Oändlighet 无穷 r:infinity oneindig oändlighet r:infinity Positive Infinity Positief oneindig Positiv oändlighet 正无穷 r:plus_infinity plus_oneindig plus_oändlighet r:plus_infinity Negative Infinity Negatief oneindig Negativ oändlighet 负无穷 r:minus_infinity min_oneindig minus_oändlighet r:minus_infinity Undefined Ongedefinieerd Odefinierad 未定义的 r:undefined ongedefinieerd odefinierad r:undefined False Onwaar Falskt r:false,r:no onwaar,nee falskt,nej r:false,r:no 0 True Waar Sant r:true,r:yes waar,ja sant,ja r:true,r:yes 1 Unknowns Onbekenden Okända 未知数 r:x r:x r:y r:y r:z r:z libqalculate-0.9.7/data/elements.xml0000644000175100017510000012702711320655050014371 00000000000000 Hydrogen Waterstof Väte 8 1.00794 20.28 13.81 0.000084 13.5984 0.37 1 1 Helium Helium 10 4.002602 4.216 0.95 0.0001785 24.5874 0.32 18 1 Lithium Lithium Litium 1 6.941 1615 453.7 0.53 5.3917 1.34 1 2 Beryllium Beryllium 2 9.012182 3243 1560 1.85 9.3227 0.90 2 2 Boron Boor Bor 7 10.811 4275 2365 2.46 8.2980 0.82 13 2 Carbon Koolstof Kol 8 12.0107 5100 3825 3.51 11.2603 0.77 14 2 Nitrogen Stikstof Kväve 8 14.00674 77.344 63.15 0.00117 14.5341 0.75 15 2 Oxygen Zuurstof Syre 8 15.9994 90.188 54.8 0.00133 13.6181 0.73 16 2 Fluorine Fluor Fluor 9 18.9984032 85 53.55 0.00158 17.4228 0.71 17 2 Neon Neon 10 20.1797 27.1 24.55 0.0008999 21.5645 0.69 18 2 Sodium Natrium Natrium 1 22.989770 1156 371 0.97 5.1391 1.54 1 3 Magnesium Magnesium 2 24.3050 1380 922 1.74 7.6462 1.30 2 3 Aluminum Aluminium Aluminium 6 26.981538 2740 933.5 2.7 5.9858 1.18 13 3 Silicon Silicium Kisel 7 28.0855 2630 1683 2.33 8.1517 1.11 14 3 Phosphorus Fosfor Fosfor 8 30.973761 553 317.3 1.82 10.4867 1.06 15 3 Sulfur Zwavel Svavel 8 32.065 717.82 392.2 2.06 10.3600 1.02 16 3 Chlorine Chloor Klor 9 35.453 239.18 172.17 0.00295 12.9676 0.99 17 3 Argon Argon 10 39.948 87.45 83.95 0.00166 15.7596 0.97 18 3 Potassium Kalium Kalium 1 39.0983 1033 336.8 0.86 4.3407 1.96 1 4 Calcium Calcium Kalcium 2 40.078 1757 1112 1.54 6.1132 1.74 2 4 Scandium Scandium Skandium 5 44.955912 3109 1814 2.99 6.5615 1.44 3 4 Titanium Titaan Titan 5 47.867 3560 1935 4.51 6.8281 1.36 4 4 Vanadium Vanadium Vanadin 5 50.9415 3650 2163 6.09 6.7462 1.25 5 4 Chromium Chroom Krom 5 51.9961 2945 2130 7.14 6.7665 1.27 6 4 Manganese Mangaan Mangan 5 54.938049 2235 1518 7.44 7.4340 1.39 7 4 Iron IJzer Järn 5 55.845 3023 1808 7.874 7.9024 1.25 8 4 Cobalt Kobalt Kobolt 5 58.933200 3143 1768 8.89 7.8810 1.26 9 4 Nickel Nikkel 5 58.6934 3005 1726 8.91 7.6398 1.21 10 4 Copper Koper Koppar 5 63.546 2840 1356.6 8.92 7.7264 1.38 11 4 Zinc Zink Zink 5 65.409 1180 692.73 7.14 9.3942 1.31 12 4 Gallium Gallium 6 69.723 2478 302.92 5.91 5.9993 1.26 13 4 Germanium Germanium 7 72.64 3107 1211.5 5.32 7.8994 1.22 14 4 Arsenic Arsenicum Arsenik 7 74.92160 876 1090 5.72 9.7886 1.19 15 4 Selenium Selenium Selen 8 78.96 958 494 4.82 9.7524 1.16 16 4 Bromine Broom Brom 9 79.904 331.85 265.95 3.14 11.8138 1.14 17 4 Krypton Krypton 10 83.798 120.85 116 0.00448 13.9996 1.10 18 4 Rubidium Rubidium 1 85.4678 961 312.63 1.53 4.1771 2.11 1 5 Strontium Strontium 2 87.62 1655 1042 2.63 5.6949 1.92 2 5 Yttrium Yttrium 5 88.90585 3611 1795 4.47 6.2173 1.62 3 5 Zirconium Zirconium Zirkonium 5 91.224 4682 2128 6.51 6.6339 1.48 4 5 Niobium Niobium Niob 5 92.90638 5015 2742 8.58 6.7589 1.37 5 5 Molybdenum Molybdeen Molybden 5 95.94 4912 2896 10.28 7.0924 1.45 6 5 Technetium Technetium Teknetium 5 [98] 4538 2477 11.49 7.28 1.56 7 5 Ruthenium Ruthenium Rutenium 5 101.07 4425 2610 12.45 7.3605 1.26 8 5 Rhodium Rhodium Rodium 5 102.90550 3970 2236 12.41 7.4589 1.35 9 5 Palladium Palladium 5 106.42 3240 1825 12.02 8.3369 1.31 10 5 Silver Zilver 5 107.8682 2436 1235.1 10.49 7.5762 1.53 11 5 Cadmium Cadmium Kadmium 5 112.411 1040 594.26 8.64 8.9938 1.48 12 5 Indium Indium 6 114.818 2350 429.78 7.31 5.7864 1.44 13 5 Tin Tin Tenn 6 118.710 2876 505.12 7.29 7.3439 1.41 14 5 Antimony Antimoon Antimon 7 121.760 1860 903.91 6.69 8.6084 1.38 15 5 Tellurium Telluur Tellur 7 127.60 1261 722.72 6.25 9.0096 1.35 16 5 Iodine Jood Jod 9 126.90447 457.5 386.7 4.94 10.4513 1.33 17 5 Xenon Xenon 10 131.293 165.1 161.39 0.00449 12.1298 1.30 18 5 Cesium Cesium 1 132.90545 944 301.54 1.9 3.8939 2.25 1 6 Barium Barium 2 137.327 2078 1002 3.65 5.2117 1.98 2 6 Lanthanum Lanthaan Lantan 3 138.9055 3737 1191 6.16 5.5769 1.69 3 9 Cerium Cerium 3 140.116 3715 1071 6.77 5.5387 4 9 Praseodymium Praseodymium Praseodym 3 140.90765 3785 1204 6.48 5.473 5 9 Neodymium Neodymium Neodym 3 144.24 3347 1294 7 5.5250 6 9 Promethium Promethium Prometium 3 [145] 3273 1315 7.22 5.582 7 9 Samarium Samarium 3 150.36 2067 1347 7.54 5.6437 8 9 Europium Europium 3 151.964 1800 1095 5.25 5.6704 9 9 Gadolinium Gadolinium Gadolinium guld 3 157.25 3545 1585 7.89 6.1498 10 9 Terbium Terbium 3 158.92534 3500 1629 8.25 5.8638 11 9 Dysprosium Dysprosium 3 162.500 2840 1685 8.56 5.9389 12 9 Holmium Holmium 3 164.93032 2968 1747 8.78 6.0215 13 9 Erbium Erbium 3 167.259 3140 1802 9.05 6.1077 14 9 Thulium Thulium Tulium 3 168.93421 2223 1818 9.32 6.1843 15 9 Ytterbium Ytterbium 3 173.04 1469 1092 9.32 6.2542 16 9 Lutetium Lutetium 3 174.967 3668 1936 9.84 5.4259 1.60 3 6 Hafnium Hafnium 5 178.49 4875 2504 13.31 6.8251 1.50 4 6 Tantalum Tantaal Tantal 5 180.9479 5730 3293 16.68 7.5496 1.38 5 6 Tungsten Tungsten Volfram 5 183.84 5825 3695 19.26 7.8640 1.46 6 6 Rhenium Rhenium 5 186.207 5870 3455 21.03 7.8335 1.59 7 6 Osmium Osmium 5 190.23 5300 3300 22.61 8.4382 1.28 8 6 Iridium Iridium 5 192.217 4700 2720 22.65 8.9670 1.37 9 6 Platinum Platina Platina 5 195.078 4100 2042.1 21.45 8.9588 1.28 10 6 Gold Goud Guld 5 196.96655 3130 1337.58 19.32 9.2255 1.44 11 6 !elements!Mercury Kwik Kvicksilver 5 200.59 629.88 234.31 13.55 10.4375 1.49 12 6 Thallium Thallium Tallium 6 204.3833 1746 577 11.85 6.1082 1.48 13 6 Lead Lood Bly 6 207.2 2023 600.65 11.34 7.4167 1.47 14 6 Bismuth Bismut Vismut 6 208.98038 1837 544.59 9.8 7.2855 1.46 15 6 Polonium Polonium 7 [209] 1235 527 9.2 8.414 16 6 Astatine Astatine Astat 9 [210] 211.4 575 9.5 17 6 Radon Radon 10 [222] 211.4 202 0.00923 10.7485 1.45 18 6 Francium Francium 1 [223] 950 300 4.0727 1 7 Radium Radium 2 [226] 1413 973 5.5 5.2784 2 7 Actinium Actinium Aktinium 4 [227] 3470 1324 10.07 5.17 3 10 Thorium Thorium Torium 4 232.0381 5060 2028 11.72 6.3067 4 10 Protactinium Protactinium Protaktinium 4 231.03588 4300 1845 15.37 5.89 5 10 Uranium Uraan Uran 4 238.02891 4407 1408 18.97 6.1941 6 10 Neptunium Neptunium 4 [237] 4175 912 20.48 6.2657 7 10 Plutonium Plutonium 4 [244] 3505 913 19.74 6.0260 8 10 Americium Americium 4 [243] 2880 1449 13.67 5.9738 9 10 Curium Curium 4 [247] 3383 1620 13.51 5.9914 10 10 Berkelium Berkelium 4 [247] 1258 13.25 6.1979 11 10 Californium Californium 4 [251] 1172 15.1 6.2817 12 10 Einsteinium Einsteinium 4 [252] 1130 8.84 6.42 13 10 Fermium Fermium 4 [257] 1800 6.50 14 10 Mendelevium Mendelevium 4 [258] 1100 6.58 15 10 Nobelium Nobelium 4 [259] 1100 6.65 16 10 Lawrencium Lawrencium 4 [262] 1900 4.9 3 7 Rutherfordium Rutherfordium 11 [261] 6.0 4 7 Dubnium Dubnium 11 [262] 5 7 Seaborgium Seaborgium 11 [266] 6 7 Bohrium Bohrium 11 [264] 7 7 Hassium Hassium 11 [269] 8 7 Meitnerium Meitnerium 11 [268] 9 7 Darmstadtium Darmstadtium 11 [271] 10 7 Roentgenium Roentgenium 11 [272] 11 7 Ununbium Ununbium 11 [285] 12 7 Ununtrium Ununtrium 11 [284] 13 7 Ununquadium Ununquadium 11 [289] 14 7 Ununpentium Ununpentium 11 [288] 15 7 Ununhexium Ununhexium 11 [292] 16 7 Ununseptium Ununseptium 11 17 7 Ununoctium Ununoctium 11 18 7 libqalculate-0.9.7/data/planets.xml.in0000644000175100017510000000750311305546371014634 00000000000000 <_name>Earth 365.25696 29.7859 0.01671022 0.00005 1 5.9737E24 5.515 510.0657E6 9.766 287 <_name>Mars 686.9601 24.1309 0.09341233 1.85061 2 6.4191E23 3.94 1.44E8 3.71 210 <_name>!planets!Mercury 87.96935 47.8725 0.20563069 7.00487 0 3.302E23 5.43 7.5E7 3.70 440 <_name>Venus 224.70096 35.0214 0.00677323 3.39471 0 4.869E24 5.24 4.60E8 8.87 737 <_name>Jupiter 4335.3545 13.0697 0.04839266 1.30530 63 1.899E27 1.33 6.41E10 23.12 152 <_name>Saturn 10757.7365 9.6724 0.05415060 2.48446 33 5.688E26 0.69 4.38E10 8.96 143 <_name>Neptune 60224.9036 5.4778 0.00858587 1.76917 13 1.024E26 1.64 7.65E9 11.0 53 <_name>Pluto 90613.3058 4.7490 0.24880766 17.14175 1 1.290E22 2.05 1.7E7 0.6 44 <_name>Uranus 30708.1600 6.8352 0.04716771 0.76986 27 8.686E25 1.29 8.13E9 8.69 68 libqalculate-0.9.7/data/planets.xml0000644000175100017510000001013111320655051014207 00000000000000 Earth Aarde Jorden 地球 365.25696 29.7859 0.01671022 0.00005 1 5.9737E24 5.515 510.0657E6 9.766 287 Mars Mars 火星 686.9601 24.1309 0.09341233 1.85061 2 6.4191E23 3.94 1.44E8 3.71 210 !planets!Mercury Mercurius Merkurius 水星 87.96935 47.8725 0.20563069 7.00487 0 3.302E23 5.43 7.5E7 3.70 440 Venus Venus 金星 224.70096 35.0214 0.00677323 3.39471 0 4.869E24 5.24 4.60E8 8.87 737 Jupiter Jupiter 木星 4335.3545 13.0697 0.04839266 1.30530 63 1.899E27 1.33 6.41E10 23.12 152 Saturn Saturnus Saturnus 土星 10757.7365 9.6724 0.05415060 2.48446 33 5.688E26 0.69 4.38E10 8.96 143 Neptune Neptunus Neptunus 海王星 60224.9036 5.4778 0.00858587 1.76917 13 1.024E26 1.64 7.65E9 11.0 53 Pluto Pluto 冥王星 90613.3058 4.7490 0.24880766 17.14175 1 1.290E22 2.05 1.7E7 0.6 44 Uranus Uranus 天王星 30708.1600 6.8352 0.04716771 0.76986 27 8.686E25 1.29 8.13E9 8.69 68 libqalculate-0.9.7/data/units.xml.in0000644000175100017510000023722111320653617014331 00000000000000 <_title>!units!Length SI <_title>Meter <_names>ar:m,meter,p:meters,metre,p:metres <_title>Kilometer r:km_c m 3 1 <_title>Decimeter r:dm_c m -1 1 <_title>Centimeter r:cm_c m -2 1 <_title>Millimeter r:mm_c m -3 1 <_title>Nautical Mile <_names>r:nautical_mile,p:nautical_miles m 1852 1 <_title>Ångström <_names>aru:Å,u:ångström,angstrom m 1E-10 1 <_title>U.S. Survey Inch <_names>ar:US_in,US_inch,p:US_inches m 100/3937 1 <_title>Inch <_names>ar:in,inch,p:inches m 0.0254 1 <_title>Hand <_names>r:hand,p:hands in 4 1 <_title>Foot <_names>ar:ft,foot,p:feet hand 3 1 <_title>U.S. Survey Foot <_names>ar:US_ft,US_foot,p:US_feet US_in 12 1 <_title>Link <_names>ar:li,link,p:links ft 66/100 1 <_title>Yard <_names>ar:yd,yard,p:yards ft 3 1 <_title>Rod (pole/perch) <_names>ar:rd,rod,p:rods US_ft 16.5 1 <_title>Fathom <_names>r:fathom,p:fathoms yd 2 1 <_title>Chain <_names>ar:ch,chain,p:chains li 100 1 <_title>Furlong <_names>ar:fur,furlong,p:furlongs yd 220 1 <_title>Mile <_names>ar:mi,mile,p:miles ch 80 1 <_title>U.S. Survey Mile <_names>ar:US_mi,US_mile,p:US_miles US_ft 5280 1 <_title>Mil (1/1000 in) <_names>r:mil,p:mils in 0.001 1 <_title>Astronomical Unit <_names>ar:AU,astronomical_unit,p:astronomical_units m 149578706600 1 <_title>Light Year <_names>ar:ly,lightyear,p:lightyears m 9460730472580800 1 <_title>Parsec <_names>ar:pc,parsec,p:parsecs AU 648000/pi 1 <_title>Pied du roi (French Royal Foot) <_names>r:pied_du_roi m 9000/27706 1 <_title>Pouce (French Royal Inch) <_names>r:pouce pied_du_roi 1/12 1 <_title>Ligne <_names>r:ligne pouce 1/12 1 <_title>Toise <_names>r:toise pied_du_roi 6 1 <_title>!units!Angle <_title>Plane Angle true <_title>Meter per Meter r:m_p_m m 0 1 m 0 -1 SI <_title>Radian <_names>ar:rad,radian,p:radians m_p_m 1 1 <_title>Degree <_names>ar:deg,au:°,degree,p:degrees rad pi/180 1 <_title>Gradian (Gon) <_names>ar:gra,gradian,p:gradians,gon,p:gons rad pi/200 1 <_title>Arcminute <_names>r:arcminute,p:arcminutes deg 1/60 1 <_title>Arcsecond <_names>r:arcsecond,p:arcseconds arcminute 1/60 1 <_title>Turn <_names>r:turn,p:turns deg 360 1 <_title>Solid Angle true <_title>Square Meter per Square Meter r:sqm_p_sqm m 0 2 m 0 -2 SI <_title>Steradian <_names>ar:sr,steradian,p:steradians m_p_m 1 1 <_title>Angular Acceleration SI <_title>Radians per Second Squared r:rad_p_sqs rad 0 1 s 0 -2 <_title>Angular Velocity SI <_title>Radians per Second r:rad_p_s rad 0 1 s 0 -1 <_title>!units!Mass SI <_title>Gram <_names>ar:g,gram,p:grams <_title>Kilogram r:kg_c g 3 1 <_title>Hektogram r:hg_c g 2 1 <_title>Metric Ton (Tonne) <_names>ar:t,tonne,p:tonnes,ton,p:tons g 1000000 1 <_title>Grain <_names>ar:gr,grain,p:grains g 0.06479891 1 <_title>Pennyweight <_names>ar:pwt,pennyweight,p:pennyweights gr 24 1 <_title>Ounce (troy) <_names>ar:oz_t,troy_ounce,p:troy_ounces pwt 20 1 <_title>Pound (troy) <_names>ar:lb_t,troy_pound,p:troy_pounds oz_t 12 1 <_title>Dram <_names>ar:dr,dram,p:drams g 1.7718451953125 1 <_title>Ounce <_names>ar:oz,ounce,p:ounces dr 16 1 <_title>Pound <_names>ar:lb,pound,p:pounds oz 16 1 <_title>Short Hundredweight <_names>ar:cwt,hundredweight,p:hundredweights lb 100 1 <_title>Long Hundredweight <_names>ar:l_cwt,long_hundredweight,p:long_hundredweights lb 112 1 <_title>Short Ton <_names>ar:s_ton,short_ton,p:short_tons lb 2000 1 <_title>Long Ton <_names>ar:l_ton,long_ton,p:long_tons lb 2240 1 <_title>Stone <_names>r:stone,p:stones lb 14 1 <_title>Cental <_names>r:cental,p:centals lb 100 1 <_title>Carat <_names>r:carat,p:carats g 0.2 1 <_title>Pfund <_names>r:pfund g 500 1 <_title>Zentner <_names>r:zentner pfund 100 1 <_title>Density SI <_title>Kilogram per Cubic Meter r:kg_p_cum g 3 1 m 0 -3 <_title>Gram per Cubic Decimeter r:g_p_cudm g 0 1 m -1 -3 <_title>Gram per Cubic Centimeter r:g_p_cucm g 0 1 m -2 -3 <_title>Gram per Mole r:g_p_mol g 0 1 mol 0 -1 <_title>Atomic Mass Unit <_names>ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units g_p_mol 1 1 <_title>Mass Fraction SI <_title>Kilogram per Kilogram r:kg_p_kg g 3 1 g 3 -1 <_title>Time SI <_title>Second <_names>ar:s,second,p:seconds <_title>Minute <_names>ar:min,minute,p:minutes s 60 1 <_title>Hour <_names>ar:h,hour,p:hours min 60 1 <_title>Day <_names>ar:d,day,p:days h 24 1 <_title>Week <_names>r:week,p:weeks day 7 1 <_title>Fortnight <_names>r:fortnight,p:fortnights week 2 1 <_title>Julian Year <_names>r:year,p:years d 365.25 1 <_title>!units!Frequency SI <_title>Hertz <_names>ar:Hz,hertz s 1 -1 <_title>Electricity <_title>Electric Current SI <_title>Ampere <_names>ar:A,ampere,p:amperes CGS <_title>Abampere <_names>r:abampere,a:abA,a:aA,p:abamperes A 10 1 <_title>Current Density SI <_title>Ampere per Meter Squared r:A_p_sqm A 0 1 m 0 -2 <_title>Electric Charge <_title>Second Ampere r:s_A s 0 1 A 0 1 SI <_title>Coulomb <_names>ar:C,coulomb,p:coulombs s_A 1 1 CGS <_title>Abcoulomb <_names>r:abcoulomb,p:abcoulombs,a:abC,a:aC C 10 1 CGS <_title>Statcoloumb (Franklin) <_names>r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins C 3.3356410E-10 1 <_title>Electric Charge Density SI <_title>Coulomb per Cubic Meter r:C_p_cum C 0 1 m 0 -3 <_title>Electric Flux Density SI <_title>Coulomb per Meter Squared r:C_p_sqm C 0 1 m 0 -2 <_title>Electric Potential <_title>Watt per Ampere r:W_p_A W 0 1 A 0 -1 SI <_title>Volt <_names>ar:V,volt,p:volts W_p_A 1 1 CGS <_title>Statvolt <_names>r:statvolt,p:statvolts,a:statV V 299.792458 1 CGS <_title>Abvolt <_names>r:abvolt,p:abvolts,a:abV V 1E-8 1 <_title>Capacitance <_title>Coulomb per Volt r:C_p_V C 0 1 V 0 -1 SI <_title>Farad <_names>ar:F,farad,p:farads C_p_V 1 1 <_title>Electric Resistance SI <_title>Volt per Ampere r:V_p_A V 0 1 A 0 -1 SI <_title>Ohm <_names>au:Ω,r:ohm,p:ohms V_p_A 1 1 CGS <_title>Abohm <_names>r:abohm,p:abohms,au:abΩ ohm 1E-9 1 CGS <_title>Statohm <_names>r:statohm,p:statohms,au:statΩ ohm 8.9875517874E11 1 <_title>Electric Conductance <_title>Ampere per Volt r:A_p_V A 0 1 V 0 -1 SI <_title>Siemens <_names>ar:S,siemens A_p_V 1 1 <_title>Electric Field Strength SI <_title>Volt per Meter r:V_p_m V 0 1 m 0 -1 <_title>Permittivity SI <_title>Farad per Meter r:F_p_m F 0 1 m 0 -1 <_title>Inductance <_title>Weber per Ampere r:Wb_p_A Wb 0 1 A 0 -1 SI <_title>Henry <_names>ar:H,henry,p:henrys Wb_p_A 1 1 <_title>Permeability SI <_title>Henry per Meter r:H_p_m H 0 1 m 0 -1 <_title>Temperature SI <_title>Kelvin <_names>ar:K,kelvin,p:kelvins SI <_title>Degree Celcius <_names>ar:oC,au:°C,r:celcius K \x + 273.15 \x - 273.15 1 <_title>Degrees Rankine <_names>ar:oR,au:°R,r:rankine K 5\x/9 9\x/5 1 <_title>Degrees Fahrenheit <_names>ar:oF,au:°F,r:fahrenheit K (2298.35+5\x)/9 (9\x-2298.35)/5 1 <_title>Substance SI <_title>Mole <_names>ar:mol,mole,p:moles <_title>Einstein <_names>r:einstein,p:einsteins <_title>Substance Concentration SI <_title>Mole per Cubic Meter r:mol_p_cum mol 0 1 m 0 -3 <_title>Catalytic Activity <_title>Reciprocal Seconds Mole r:recs_mol mol 0 1 s 0 -1 SI <_title>Katal <_names>ar:kat,katal,p:katals recs_mol 1 1 <_title>Catalytic Concentration SI <_title>Katal per Cubic Meter r:kat_p_cum kat 0 1 m 0 -3 <_title>Light <_title>Luminous Intensity SI <_title>Candela <_names>ar:cd,candela,p:candelas <_title>Luminance SI <_title>Candela per Meter Squared r:cd_p_sqm cd 0 1 m 0 -2 CGS <_title>Stilb <_names>ar:sb,stilb,p:stilbs cd_p_sqm 10000 1 <_title>Luminous Flux <_title>Candela Steradian r:cd_sr cd 0 1 sr 0 1 SI <_title>Lumen <_names>ar:lm,lumen,p:lumens cd_sr 1 1 <_title>Illuminance <_title>Lumen per Meter Squared r:lm_p_sqm lm 0 1 m 0 -2 true <_title>Lumen per Foot Squared r:lm_p_sqft lm 0 1 ft 0 -2 SI <_title>Lux <_names>ar:lx,lux lm_p_sqm 1 1 <_title>Foot-Candle <_names>ar:fc,footcandle,p:footcandles lm_p_sqft 1 1 CGS <_title>Phot <_names>ar:ph,phot,p:phots lx 10000 1 <_title>Radiant Intensity <_title>Watt per Steradian r:W_p_sr W 0 1 sr 0 -1 <_title>Irradiance SI <_title>Watt per Meter Squared r:W_p_sqm W 0 1 m 0 -2 <_title>Einstein per Meter Squared per Second r:einstein_p_sqm_p_s einstein 0 1 m 0 -2 s 0 -1 <_title>Microeinstein per Meter Squared per Second r:microeinstein_p_sqm_p_s einstein -6 1 m 0 -2 s 0 -1 <_title>Radiance SI <_title>Watt per Square Meter Steradian r:W_p_sqm_sr W 0 1 sr 0 -1 m 0 -2 <_title>Area SI <_title>Square Meter r:sqm m 0 2 <_title>Square Kilometer r:sqkm m 3 2 <_title>Are <_names>ar:a,are,p:ares m 100 2 <_title>Hectare r:ha a 2 1 <_title>Barn <_names>ar:b,barn,p:barns m 1E-28 2 <_title>Rood <_names>r:rood,p:roods yd 1210 2 <_title>Acre <_names>r:acre,p:acres ch 10 2 <_title>Section <_names>r:section,p:sections mi 1 2 <_title>Township <_names>r:township,p:townships section 36 1 <_title>Square Foot r:sqft ft 0 2 <_title>Square Inch r:sqin in 0 2 <_title>Square Mile r:sqmi mi 0 2 <_title>Volume SI <_title>Cubic Meter r:cum m 0 3 <_title>Liter <_names>ar:L,a:l,liter,p:liters,litre,p:litres m 0.001 3 <_title>Milliliter r:ml_c l -3 1 <_title>Centiliter r:cl_c l -2 1 <_title>Deciliter r:dl_c l -1 1 <_title>Cubic Inch r:cuin in 0 3 <_title>Fuel Economy <_title>Liter per Kilometer r:l_p_km l 0 1 m 3 -1 <_title>Kilometer per Liter r:km_p_l m 3 1 l 0 -1 true <_title>Miles per Gallon r:mile_p_gal mi 0 1 gal 0 -1 <_title>Miles per Gallon <_names>a-cr:mpg mile_p_gal 1 1 <_title>Cooking <_title>Teaspoon <_names>r:teaspoon,p:teaspoons L 0.005 1 <_title>Dessertspoon <_names>r:dessertspoon,p:dessertspoons teaspoon 2 1 <_title>Tablespoon <_names>r:tablespoon,p:tablespoons teaspoon 3 1 <_title>Cup <_names>r:cup,p:cups L 0.250 1 <_title>Imperial Capacity <_title>Imperial Fluid Ounce <_names>ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces L 0.0284130625 1 <_title>Imperial Gill <_names>ar:UK_gi,imperial_gill,p:imperial_gills UK_fl_oz 5 1 <_title>Imperial Pint <_names>ar:UK_pt,imperial_pint,p:imperial_pints UK_gi 4 1 <_title>Imperial Quart <_names>ar:UK_qt,imperial_quart,p:imperial_quarts UK_pt 2 1 <_title>Imperial Gallon <_names>ar:UK_gal,imperial_gallon,p:imperial_gallons UK_qt 4 1 <_title>Imperial Minim <_names>r:imperial_minim,p:imperial_minims UK_fl_oz 1/480 1 <_title>Imperial Fluid Scuple <_names>r:imperial_fluid_scuple,p:imperial_fluid_scuples imperial_minim 20 1 <_title>Imperial Fluid Drachm <_names>ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms imperial_fluid_scuple 3 1 <_title>Imperial Bushel <_names>ar:UK_bu,imperial_bushel,p:imperial_bushels UK_gal 8 1 <_title>U.S. Capacity <_title>U.S. Fluid Ounce <_names>ar:fl_oz,fluid_ounce,p:fluid_ounces in 231/128 3 <_title>U.S. Gill <_names>ar:gi,gill,p:gills fl_oz 4 1 <_title>U.S. Liquid Pints <_names>ar:liq_pt,liquid_pint,p:liquid_pints gi 4 1 <_title>U.S. Liquid Quarts <_names>ar:liq_qt,liquid_quart,p:liquid_quarts liq_pt 2 1 <_title>U.S. Minim <_names>r:minim,p:minims fl_oz 1/480 1 <_title>U.S. Fluid Drachm <_names>ar:fl_dr,fluid_drachm,p:fluid_drachms minim 60 1 <_title>U.S. Dry Pint <_names>ar:dry_pt,dry_pint,p:dry_pints in 33.6003125 3 <_title>U.S. Dry Quart <_names>ar:dry_qt,dry_quart,p:dry_quarts dry_pt 2 1 <_title>U.S. Peck <_names>ar:pk,peck,p:pecks dry_qt 8 1 <_title>U.S. Bushel <_names>ar:bu,bushel,p:bushels pk 4 1 <_title>U.S. Gallon <_names>ar:gal,gallon,p:gallons liq_qt 4 1 <_title>U.S. Barrell (oil) <_names>ar:bbl,barrell,p:barrells gal 42 1 <_title>Specific Volume SI <_title>Cubic Meter per Kilogram r:cum_p_kg m 0 3 g 3 -1 <_title>Speed SI <_title>Meter per Second r:m_p_s m 0 1 s 0 -1 <_title>Kilometer per Hour r:km_p_h m 3 1 h 0 -1 <_title>Nautical Mile per Hour r:nautical_mile_p_h nautical_mile 0 1 h 0 -1 <_title>Knot <_names>r:knot,p:knots nautical_mile_p_h 1 1 true <_title>Miles per Hour r:mile_p_h mi 0 1 h 0 -1 <_title>Miles per Hour <_names>a-cr:mph mile_p_h 1 1 <_title>Acceleration SI <_title>Meter per Second Squared r:m_p_sqs m 0 1 s 0 -2 <_title>Galileo <_names>ar:Gal,galileo,p:galileos m_p_sqs 1/100 1 <_title>Gee <_names>r:gee,p:gees m_p_sqs 9.80665 1 <_title>Magnetism <_title>Wave Number SI <_title>Reciprocal Meter r:recm m 0 -1 <_title>Magnetic Field Strength SI <_title>Ampere per Meter r:A_p_m A 0 1 m 0 -1 CGS <_title>Oersted <_names>ar:Oe,oersted,p:oersteds A_p_m 1000/(4*pi) 1 <_title>Magnetic Flux <_title>Volt Seconds r:V_s V 0 1 s 0 1 SI <_title>Weber <_names>ar:Wb,weber,p:webers V_s 1 1 CGS <_title>Maxwell <_names>ar:Mx,maxwell,p:maxwells Wb 1E-8 1 <_title>Magnetic Flux Density <_title>Weber per Meter Squared r:Wb_p_sqm Wb 0 1 m 0 -2 SI <_title>Tesla <_names>ar:T,tesla,p:teslas Wb_p_sqm 1 1 CGS <_title>Gauss <_names>r:gauss T 0.0001 1 <_title>Force <_title>Meter Kilogram per Second Squared r:m_kg_p_sqs m 0 1 g 3 1 s 0 -2 SI <_title>Newton <_names>ar:N,newton,p:newtons m_kg_p_sqs 1 1 CGS <_title>Dyne <_names>ar:dyn,dyne,p:dynes N 1E-5 1 Imperial <_title>Pound-force <_names>ar:lbf,pound_force N 4.4482216152605 1 true <_title>Pound Foot per Second Squared r:lb_ft_p_sqs lb 0 1 ft 0 1 s 0 -2 Imperial <_title>Poundal <_names>r:poundal,p:poundals,a:pdl lb_ft_p_sqs 1 1 <_title>Pond (Gram-Force) <_names>r:pond,p:ponds,a:gf N 0.00980665 1 <_title>Kilopond (Kilogram-Force) r:kpond_c pond 3 1 <_title>Moment of Force SI <_title>Newton Meter r:N_m N 0 1 m 0 1 <_title>Pressure <_title>Newton per Meter Squared r:N_p_sqm N 0 1 m 0 -2 <_title>Pound-force per Square Inch true r:lbf_p_sqin lbf 0 1 in 0 -2 SI <_title>Pascal <_names>ar:Pa,pascal,p:pascals N_p_sqm 1 1 <_title>Pound-force per Square Inch (psi) <_names>a-cr:psi lbf_p_sqin 1 1 <_title>Bar <_names>r:bar,p:bars Pa 100000 1 <_title>Atmosphere <_names>ar:atm,atmosphere,p:atmospheres Pa 101325 1 <_title>Torr <_names>r:torr,p:torrs atm 1/760 1 <_title>Millimeter of Mercury <_names>ar:mmHg atm 1/760 1 <_title>Inch of Mercury <_names>ar:inHg mmHg 25.4 1 <_title>Dynamic Viscosity SI <_title>Pascal Second r:Pa_s Pa 0 1 s 0 1 CGS <_title>Poise <_names>ar:P,poise,p:poises Pa_s 0.1 1 <_title>Kinematic Viscosity <_title>Square Meter per Second r:sqm_p_s m 0 2 s 0 -1 CGS <_title>Stokes <_names>ar:St,stokes sqm_p_s 0.0001 1 <_title>Surface Tension SI <_title>Newton per Meter r:N_p_m N 0 1 m 0 -1 <_title>Energy SI <_title>Joule <_names>ar:J,joule,p:joules N_m 1 1 <_title>Watt Hour r:W_h W 0 1 h 0 1 <_title>Kilowatt Hour r:W_h W 3 1 h 0 1 <_title>Calorie (international table) <_names>ais:cal_IT,ar:cal,c:calorie,cp:calories J 4.1868 1 <_title>Calorie (capital C) <_names>cr:Calorie,cp:Calories cal 1000 1 <_title>Calorie (thermochemical) <_names>ars:cal_th J 4.184 1 <_title>Gram of TNT <_names>a-cr:gTNT,gramTNT cal_th 1000 1 <_title>Ton of TNT <_names>a-cr:tTNT,tonTNT gTNT 1000000 1 <_title>Calorie (15 degrees Celcius) <_names>ars:cal_fifteen J 4.185880 1 <_title>Calorie (mean) <_names>ars:cal_mean J 4.19002 1 <_title>British Thermal Unit (IT) <_names>ar:Btu J 1055.056 1 <_title>Electron Volt <_names>ar:eV,electron_volt,p:electron_volts J 1.602177E-19 1 CGS <_title>Erg <_names>r:erg,p:ergs J 1E-7 1 <_title>Foe <_names>r:foe,p:foes erg 1E51 1 Imperial <_title>Foot-Pound Force r:ft_lbf ft 0 1 lbf 0 1 <_title>Specific Energy SI <_title>Joule per Kilogram r:J_p_kg J 0 1 g 3 -1 <_title>Power <_title>Joule per Second r:J_p_s J 0 1 s 0 -1 SI <_title>Watt <_names>ar:W,watt,p:watts J_p_s 1 1 <_title>Horse Power <_names>ar:hp,horsepower,p:horsepowers W 745.699987158227022 1 <_title>Pferdestärke <_names>ar:PS,u:pferdestärke W 735.49875 1 <_title>Entropy SI <_title>Joule per Kelvin r:J_p_K J 0 1 K 0 -1 <_title>Specific Entropy SI <_title>Joule per Kilogram Kelvin r:J_p_kg_K J 0 1 g 3 -1 K 0 -1 <_title>Thermal Conductivity SI <_title>Watt per Meter Kelvin r:W_p_m_K W 0 1 m 0 -1 K 0 -1 <_title>Energy Density SI <_title>Joule per Cubic Meter r:J_p_cum J 0 1 m 0 -3 <_title>Molar Energy SI <_title>Joule per Mole r:J_p_mol J 0 1 mol 0 -1 <_title>Molar Entropy SI <_title>Joule per Mole Kelvin r:J_p_mol_K J 0 1 mol 0 -1 K 0 -1 <_title>Radioactivity SI <_title>Becquerel <_names>ar:Bq,becquerel,p:becquerels s 1 -1 <_title>Curie <_names>ar:Ci,curie,p:curies Bq 3.7E10 1 <_title>Absorbed Dose SI <_title>Gray <_names>ar:Gy,gray,p:grays J_p_kg 1 1 <_title>Rad <_names>r:rad_radioactivity Gy 1/100 1 <_title>Dose Equivalent SI <_title>Sievert <_names>ar:Sv,sievert,p:sieverts J_p_kg 1 1 <_title>Rem <_names>r:rem_radioactivity Sv 1/100 1 <_title>Exposure SI <_title>Coulomb per Kilogram r:C_p_kg C 0 1 g 3 -1 <_title>Roentgen <_names>ar:R,roentgen,p:roentgens C_p_kg 0.000258 1 <_title>Absorbed Dose Rate SI <_title>Gray per Second r:Gy_p_s Gy 0 1 s 0 -1 <_title>Ratio <_title>Neper <_names>ar:Np,neper,p:nepers <_title>Bel <_names>ar:B,bel,p:bels Np 0.5*ln(10) 1 <_title>Decibel r:dB_c B -1 1 <_title>Information <_title>Bit <_names>r:bit,p:bits <_title>Byte (8-bit) <_names>r:byte,p:bytes,octet,p:octets bit 8 1 <_title>Nibble <_names>r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets bit 4 1 <_title>Tribble <_names>r:tribble,p:tribbles nibble 3 1 <_title>Word (16-bit) <_names>r:word,p:words bit 16 1 <_title>Kilobyte r:kbyte_c byte 3 1 <_title>Kibibyte r:Kibyte_c byte 10 1 <_title>Mebibyte r:Mibyte_c byte 20 1 <_title>Gibibyte r:Gibyte_c byte 30 1 <_title>Megabyte r:Mbyte_c byte 6 1 <_title>Gigabyte r:Gbyte_c byte 9 1 <_title>Terabyte r:Tbyte_c byte 12 1 <_title>Kilobit r:kbit_c bit 3 1 <_title>Kibibit r:Kibit_c bit 10 1 <_title>Mebibit r:Mibit_c bit 20 1 <_title>Gibibit r:Gibit_c bit 30 1 <_title>Megabit r:Mbit_c bit 6 1 <_title>Gigabit r:Gbit_c bit 9 1 <_title>Terabit r:Tbit_c bit 12 1 <_title>Typography <_title>PostScript Point <_names>ar:pt,a:pts,point,p:points in 1/72 1 <_title>PostScript Pica <_names>r:pica,p:picas pt 12 1 <_title>ATA Pica <_names>r:ata_pica,p:ata_picas in 0.166 1 <_title>ATA Point <_names>r:ata_point,a:ata_pt,p:ata_points ata_pica 1/12 1 <_title>New Didot Point <_names>r:new_didot m 0.000375 1 <_title>Didot Point <_names>r:didot,a:dd pouce 1/72 1 <_title>Cicero <_names>r:cicero didot 12 1 libqalculate-0.9.7/data/prefixes.xml0000644000175100017510000000636411320655051014403 00000000000000 yocto y -24 zepto z -21 atto a -18 femto f -15 pico p -12 nano n -9 micro u µ -6 milli m -3 centi c -2 deci d -1 deka da 1 hekto h 2 kilo k 3 mega M 6 giga G 9 tera T 12 peta P 15 exa E 18 zetta Z 21 yotta Y 24 kibi Ki 10 mebi Mi 20 gibi Gi 30 tebi Ti 40 pebi Pi 50 exbi Ei 60 libqalculate-0.9.7/data/functions.xml.in0000644000175100017510000034145111320653617015200 00000000000000 <_title>Matrices & Vectors <_title>Construct Vector <_names>r:vector <_description>Returns a vector with listed elements. <_title>Elements <_title>Generate Vector <_names>r:genvector <_description>Returns a vector generated from a function with a variable (default x) running from min to max. The fourth argument is either the requested number of elements if the sixth argument is false (default) or the step between each value of the variable. <_title>Function <_title>Min <_title>Max <_title>Dimension / Step size <_title>Variable <_title>Use step size <_title>Sort <_names>r:sort <_description>Returns a sorted vector. ex. sort([6, 1, 4])=[1, 4, 6] <_title>Vector <_title>Ascending <_title>Rank <_names>r:rank <_description>Returns a vector with values of elements replaced with their mutual ranks. ex. rank([6, 1, 4]) = [3, 1, 2] <_title>Vector <_title>Ascending <_title>Vector Limits <_names>r:limits <_description>Returns a part of a vector between two positions. <_title>Vector <_title>Lower limit <_title>Upper limit <_title>Dimension <_names>r:dimension <_description>Returns the number of elements in a vector. <_title>Vector <_title>Merge Vectors <_names>r:mergevectors <_description>Returns a vector with the elements from two vectors. <_title>Vector 1 <_title>Vector 2 <_title>Construct Matrix <_names>r:matrix <_description>Returns a matrix with specified dimensions and listed elements. Omitted elements are set to zero. <_title>Rows <_title>Columns <_title>Elements <_title>Convert Matrix to Vector <_names>r:matrix2vector <_description>Puts each element of a matrix in vertical order in a vector. <_title>Matrix <_title>Matrix Area <_names>r:area <_description>Returns a part of a matrix. <_title>Matrix <_title>Start row <_title>Start column <_title>End row <_title>End column <_title>Rows <_names>r:rows <_description>Returns the number of rows in a matrix. <_title>Matrix <_title>Columns <_names>r:columns <_description>Returns the number of columns in a matrix. <_title>Matrix <_title>Extract row as vector <_names>r:row <_description>Returns a row in a matrix as a vector. <_title>Matrix <_title>Row <_title>Extract Column as Vector <_names>r:column <_description>Returns a column in a matrix as a vector. <_title>Matrix <_title>Column <_title>Elements <_names>r:elements <_description>Returns the number of elements in a matrix or vector. <_title>Matrix or vector <_title>Element <_names>r:element <_description>Returns the element at specified position in a matrix (row and column) or vector (index). <_title>Matrix/vector <_title>Row/index <_title>Column <_title>Transpose <_names>r:transpose <_description>Returns the transpose of a matrix. <_title>Matrix <_title>Identity <_names>r:identity <_description>Returns the identity matrix of a matrix or with specified number of rows/columns. <_title>Matrix or rows/columns <_title>Determinant <_names>r:det <_description>Calculates the determinant of a matrix. <_title>Matrix <_title>Permanent <_names>r:permanent <_description>Calculates the permanent of a matrix. The permanent differs from a determinant in that all signs in the expansion by minors are taken as positive. <_title>Matrix <_title>Adjugate (Adjoint) <_names>r:adj <_description>Calculates the adjugate or adjoint of a matrix. <_title>Matrix <_title>Cofactor <_names>r:cofactor <_description>Calculates the cofactor of the element at specified position. <_title>Matrix <_title>Row <_title>Column <_title>Matrix Inverse <_names>r:inverse <_description>Calculates the inverse of a matrix. The inverse is the matrix that multiplied by the original matrix equals the identity matrix (AB = BA = I). <_title>Matrix <_title>Load CSV File <_names>r:load <_description>Returns a matrix imported from a CSV data file. <_title>Filename <_title>First data row <_title>Separator <_title>Export To CSV File <_names>r:export <_description>Exports a matrix to a CSV data file. <_title>Matrix/vector <_title>Filename <_title>Separator <_title>Norm (length) <_names>r:norm <_description>Calculates the norm/length of a vector. abs((\x*\x)^(1/2)) <_title>Vector false <_title>Cross Product <_names>r:cross <_description>Calculates the cross product of two 3-dimensional vectors. [(element(\x,2)*element(\y,3))-(element(\x,3)*element(\y,2)),(element(\x,3)*element(\y,1))-(element(\x,1)*element(\y,3)),(element(\x,1)*element(\y,2))-(element(\x,2)*element(\y,1))] <_title>Vector 1 dimension(\x)==3 <_title>Vector 2 dimension(\x)==3 <_title>Combinatorics <_title>Factorial <_description>Calculates the factorial of an integer. Mulitplies the argument with every lesser positive integer (n(n-1)(n-2)...2*1). Can also be entered as a number followed by one exclamation mark. ex. factorial(5) = 5! = 5 * 4 * 3 * 2 * 1 = 120 <_names>r:factorial <_title>Value <_title>Double Factorial <_names>r:factorial2 <_description>Calculates the doublefactorial of an integer. Mulitplies the argument with every second lesser positive integer (n(n-2)(n-4)...). Can also be entered as a number followed by two exclamation marks. ex. factorial2(5) = 5!! = 5 * 3 * 1 = 15 <_title>Value <_title>Multifactorial <_names>r:multifactorial <_description>Calculates the multifactorial of an integer. Mulitplies the argument with every x lesser positive integer (n(n-x)(n-2x)...). Can also be entered as a number followed by three or more exclamation marks. ex. multifactorial(18, 4) = 18!!!! = 18 * 14 * 10 * 6 * 2 = 30 240 <_title>Value <_title>Factorial <_title>Binomial Coefficient <_names>r:binomial <_title>Exponent <_title>Index <_title>Hyperfactorial <_names>r:hyperfactorial product(x^x,1,\x,x) <_description>Calculates the hyperfactorial of an integer. Mulitplies the argument raised by itself with every lesser positive integer raised by themselves (1^1 * 2^2 ... n^n). ex. hyperfactorial(3) = (3^3) * (2^2) * (1^1) = 108 <_title>Value 1 <_title>Superfactorial <_names>r:superfactorial product(factorial(x),0,\x,x) <_description>Calculates the superfactorial of an integer. Mulitplies the factorial of the argument with the factorial of every lesser positive integer (1! * 2! ... n!). ex. superfactorial(5) = 5! * 4! * 3! * 2! * 1! = 34 560 <_title>Value 0 <_title>Permutations (Variations) <_names>r:perm,variations \x!/(\x-\y)! <_description>Returns the number of possible arrangements of an ordered list with a number of objects to choose from and a list size. If there are three objects (1, 2 and 3) that is put in a list with two positions, the alternatives are [1, 2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2], and thus the number of permutations is 6. <_title>Objects <_title>Size <_title>Combinations <_names>r:comb \x!/(\y!*(\x-\y)!) <_description>Returns the number of possible arrangements of an unordered list with a number of objects to choose from and a list size. If there are three objects (1, 2 and 3) that is put in a list with place for two, the alternatives are [1, 2], [1, 3], and [2, 3], and thus the number of combinations is 3. <_title>Objects <_title>Size <_title>Derangements <_names>r:derangements <_description>Returns the number of possible rearrangements of an ordered list, of a certain size, where none of the objects are on their original position. If the original list is [1, 2, 3], the possible derangements is [2, 3, 1] and [3, 1, 2], and thus the number of derangements is 2. factorial(\x)*sum(((-1)^"i")/factorial("i"),0,\x,"i") <_title>Number of elements 1 <_title>Number Theory <_title>Absolute Value <_names>r:abs <_title>Value <_title>Arithmetics <_title>Signum <_names>r:sgn <_title>Number <_title>Numerator <_names>r:numerator <_title>Number <_title>Denominator <_names>r:denominator <_title>Number <_title>Remainder <_names>r:rem <_title>Numerator <_title>Denominator <_title>Modulus <_names>r:mod <_title>Numerator <_title>Denominator <_title>Negate <_names>r:neg -\x <_title>Value <_title>Reciprocal <_names>r:inv \x^(-1) <_title>Value <_title>Multiply <_names>r:multiply product(element(\x,"x"),1,dimension(\x),"x") <_title>Factors <_title>Add <_names>r:add total(\x) <_title>Terms <_title>Subtract <_names>r:subtract csum(2,-1,element(\x,1),"y"-"x","x","y",\x) <_title>Terms <_title>Divide <_names>r:divide \x/\y <_title>Numerator <_title>Denominator <_title>Raise <_names>r:raise \x^\y <_title>Base <_title>Exponent <_title>Polynomials <_title>Coefficient <_names>r:coeff <_title>Polynomial <_title>Number <_title>Variable <_title>Leading Coefficient <_names>r:lcoeff <_title>Polynomial <_title>Variable <_title>Trailing Coefficient <_names>r:tcoeff <_title>Polynomial <_title>Variable <_title>Polynomial Degree <_names>r:degree <_title>Polynomial <_title>Variable <_title>Lowest Degree (Valuation) <_names>r:ldegree <_title>Polynomial <_title>Variable <_title>Content Part <_names>r:pcontent <_title>Polynomial <_title>Variable <_title>Primitive Part <_names>r:primpart <_title>Polynomial <_title>Variable <_title>Unit Part <_names>r:punit <_title>Polynomial <_title>Variable <_title>Greatest Common Divisor <_names>r:gcd <_title>1st value <_title>2nd value <_title>Least Common Multiplier <_names>r:lcm <_title>1st value <_title>2nd value <_title>Rounding <_title>Round <_names>r:round <_title>Value <_title>Round Downwards <_names>r:floor <_title>Value <_title>Round Upwards <_names>r:ceil <_title>Value <_title>Round Towards Zero <_names>r:trunc <_title>Value <_title>Extract Integer Part <_names>r:int <_title>Value <_title>Extract Fractional Part <_names>r:frac <_title>Value <_title>Number Bases <_title>Number Base <_names>r:base <_description>Returns an integer from a number of specified base between 2 and 36 <_title>Number <_title>Base <_title>Binary <_names>r:bin <_description>Returns an integer from a binary number <_title>Binary number <_title>Octal <_names>r:oct <_description>Returns an integer from an octal number <_title>Octal number <_title>Hexadecimal <_names>r:hex <_description>Returns a value from a hexadecimal number <_title>Hexadecimal number <_title>Integers <_title>Even <_names>r:even <_title>Number <_title>Odd <_names>r:odd <_title>Number <_title>Step Functions <_title>Heaviside Step Function <_names>r:heaviside <_description>Discontinuous function also known as "unit step function". Returns 0 if x < 0, 1 if x > 0, and 1/2 if x = 0. (1/2)*(1+sgn(\x)) <_title>Value false false <_title>Ramp Function <_names>r:ramp (\x+abs(\x))/2 <_title>Value false false <_title>Rectangular Function <_names>r:rectangular heaviside(\x+(1/2))-heaviside(\x-(1/2)) <_title>Value false false <_title>Sigmoid Function <_names>r:sigmoid 1/(1+e^(-\x)) <_title>Value false <_title>Logit Transformation <_names>r:logit ln(\x/(1-\x)) <_title>Value <_title>Triangular Function <_names>r:triangular if(abs(\x)<1,1-abs(\x),0) <_title>Value false false <_title>Analysis <_title>Real Part <_names>r:re <_title>Complex number <_title>Imaginary Part <_names>r:im <_title>Complex number <_title>Gamma Function <_names>r:gamma <_title>Beta Function <_names>r:beta <_title>Exponents & Logarithms <_title>Square Root <_names>au:√,r:sqrt <_title>Value <_title>Square <_names>r:sq <_title>Value <_title>Exponential (e^x) <_names>r:exp <_title>Exponent <_title>Natural Logarithm <_names>r:ln <_title>Value <_title>Base-N Logarithm <_names>r:log <_title>Value <_title>Base <_title>Lambert W Function (Omega Function, Product Log) <_names>r:lambertw,productlog <_description>Returns the inverse function for mx*e^x as ln() does for e^x. <_title>Value <_title>Base-2 Logrithm <_names>rs:log2 <_description>Returns the base n logarithm. log(\x,2) <_title>Value false 0 <_title>Base-10 Logrithm <_names>rs:log10 <_description>Returns the base n logarithm. log(\x,10) <_title>Value false 0 <_title>Complex Exponential (Cis) <_names>r:cis e^(\x*i) <_title>Exponent <_title>2 raised the to power X <_names>rs:exp2 2^\x <_title>Exponent <_title>10 raised the to power X <_names>rs:exp10 10^\x <_title>Exponent <_title>Cube Root <_names>r:cbrt \x^(1/3) <_title>Value <_title>Nth root <_names>r:root \x^(1/\y) <_title>Base <_title>Exponent <_title>X raised to the power Y <_names>r:pow \x^\y <_title>Base <_title>Exponent <_title>Square root (x * pi) <_names>r:sqrtpi <_description>Returns the non-negative square root of x * pi abs((\x*pi)^(1/2)) <_title>Non-negative value 0 <_title>Trigonometry <_title>Sine <_names>r:sin <_title>Angle <_title>Cosine <_names>r:cos <_title>Angle <_title>Tangent <_names>r:tan <_title>Angle <_title>Inverse Sine <_names>r:asin <_title>Inverse Cosine <_names>r:acos <_title>Inverse Tangent <_names>r:atan <_title>Hyperbolic Sine <_names>r:sinh <_title>Hyperbolic Cosine <_names>r:cosh <_title>Hyperbolic Tangent <_names>r:tanh <_title>Inverse Hyperbolic Sine <_names>r:asinh <_title>Inverse Hyperbolic Cosine <_names>r:acosh <_title>Inverse Hyperbolic Tangent <_names>r:atanh <_title>Radians to Default Angle Unit <_names>r:radtodef <_title>Radians <_title>Secant <_names>r:sec 1/cos(\x) <_title>Angle false <_title>Cosecant <_names>r:csc 1/sin(\x) <_title>Angle false <_title>Cotangent <_names>r:cot cos(\x)/sin(\x) <_title>Angle false <_title>Hyperbolic Secant <_names>r:sech 1/cosh(\x) <_title>Hyperbolic Cosecant <_names>r:csch 1/sinh(\x) <_title>Hyperbolic Cotangent <_names>r:coth cosh(\x)/sinh(\x) <_title>Inverse Secant <_names>r:asec radtodef(0.5pi+i*ln(sqrt(1-1\x^2)+i/\x)) <_title>Inverse Cosecant <_names>r:acsc radtodef(-i*ln(sqrt(1-1\x^2)+i/\x)) <_title>Inverse Cotangent <_names>r:acot radtodef(i/2*(ln((\x-i)/\x)-ln((\x+i)/\x))) <_title>Inverse Hyperbolic Secant <_names>r:asech ln(sqrt(1/\x-1)*sqrt(1/\x+1)+1/\x) <_title>Inverse Hyperbolic Cosecant <_names>r:acsch ln(sqrt(1+1/\x^2)+1/\x) <_title>Inverse Hyperbolic Cotangent <_names>r:acoth (ln(1+1/\x)-ln(1-1/\x))/2 <_title>Miscellaneous <_title>Body Mass Index (BMI) <_names>-r:bmi <_description>Calculates the Body Mass Index. The resulting BMI-value is sometimes interpreted as follows (although varies with age, sex, etc.): Underweight < 18.5 Normal weight 18.5-25 Overweight 25-30 Obesity > 30 Note that you must use units for weight (ex. 59kg) and length (ex. 174cm). (\x/(1000g))/(\y/m)^2 <_title>Weight <_title>Length <_title>Riemann Zeta <_names>r:zeta <_title>Integral point <_title>Roman Number <_names>r:roman <_description>Returns the value of a roman number. <_title>Roman number <_title>Kronecker Delta <_names>r:kronecker <_description>Returns 0 if i != j and 1 if i = j. \x=\Y{0} <_title>Value 1 (i) false false <_title>Value 2 (j) false false <_title>Statistics <_title>Descriptive Statistics <_title>Sum (total) <_names>r:total <_title>Data <_title>Percentile <_names>r:percentile <_title>Vector <_title>Percentile (%) <_title>Min <_names>r:min <_description>Returns the lowest value. <_title>Vector <_title>Max <_names>r:max <_description>Returns the highest value. <_title>Vector <_title>Mode <_names>r:mode <_description>Returns the most frequently occuring value. <_title>Vector <_title>Range <_names>r:range <_description>Calculates the difference between the min and max value. max(\x)-min(\x) <_title>Data <_title>Median <_names>r:median percentile(\x,50) <_title>Data <_title>Quartile <_names>r:quartile percentile(\x,25*\y) <_title>Data <_title>Quartile 1 3 <_title>Decile <_names>r:decile percentile(\x,10*\y) <_title>Data <_title>Decile 0 100 <_title>Interquartile Range <_names>r:iqr <_description>Calculates the difference between the first and third quartile. quartile(\x,3)-quartile(\x,1) <_title>Data <_title>Number of Samples <_names>r:number <_description>Returns the number of samples. dimension(\x) <_title>Data <_title>Random Number <_names>r:rand <_description>Generates a pseudo-random number. Returns a real number between 0 and 1, if ceil is zero (default), or an integer between 1 and (including) ceil. <_title>Ceil <_title>Random Number Between Limits <_names>r:randbetween <_description>Returns an integer between (including) bottom and top. rand(\y-\x+1)+\x-1 \x<=\y <_title>Bottom <_title>Top <_title>Means <_title>Mean <_names>r:mean,average total(\x)/dimension(\x) <_title>Data <_title>Harmonic Mean <_names>r:harmmean dimension(\x)/csum(1,-1,0,"y"+1/"x","x","y",\x) <_title>Data <_title>Geometric Mean <_names>r:geomean abs(csum(1,-1,1,"y"*"x","x","y",\x)^(1/dimension(\x))) <_title>Data <_title>Trimmed Mean <_names>r:trimmean mean(limits(sort(\x),round(dimension(\x)/100*\y)+1,round(dimension(\x)/100*(100-\y)))) <_title>Data <_title>Trimmed percentage (at each end) <_title>Winsorized Mean <_names>r:winsormean sort(\x) dimension(\x) round(dimension(\x)/100*\y) (element(\1,\2-\3)*\3+element(\1,\3+1)*\3+total(limits(\1,\3+1,\2-\3)))/\2 <_title>Data <_title>Winsorized percentage (at each end) <_title>Weighted Mean <_names>r:weighmean dimension(\x) min(dimension(\x),dimension(\y)) csum(1,\2,0,"y"+"x"*element("v","i"+\1),"x","y",mergevectors(\x,\y),"i","v")/total(limits(\y,1,\2)) <_title>Data <_title>Weights <_title>Quadratic Mean (RMS) <_names>r:rms abs((csum(1,-1,0,"y"+"x"^2,"x","y",\x)/dimension(\x))^(1/2)) <_title>Data <_title>Moments <_title>Standard Deviation (entire population) <_names>r:stdevp abs(varp(\x)^(1/2)) <_title>Data <_title>Standard Deviation (random sampling) <_names>r:stdev abs(var(\x)^(1/2)) <_title>Data <_title>Variance (entire population) <_names>r:varp mean(\x) csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)/dimension(\x) <_title>Data <_title>Variance (random sampling) <_names>r:var mean(\x) csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)/(dimension(\x)-1) <_title>Data <_title>Standard Error <_names>r:stderr abs((var(\x)/dimension(\x))^(1/2)) <_title>Data <_title>Mean Deviation <_names>r:meandev mean(\x) csum(1,-1,0,"y"+abs("x"-\1),"x","y",\x)/dimension(\x) <_title>Data <_title>Covariance <_names>r:cov,r:covar mean(\x) mean(\y) dimension(\x) min(dimension(\x),dimension(\y)) csum(1,\4,0,"y"+("x"-\1)*(element("v","i"+\3)-\2),"x","y",mergevectors(\x,\y),"i","v")/(\4) <_title>Data 1 <_title>Data 2 <_title>Pooled Variance <_names>r:poolvar mean(\x) mean(\y)^2 (csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)+csum(1,-1,0,"y"+("x"-\2)^2,"x","y",\y))/(dimension(\x)+dimension(\y)-2) <_title>Data 1 <_title>Data 2 <_title>Regression <_title>Statistical Correlation <_names>r:cor covar(\x,\y)/(stdev(\x)*stdev(\y)) <_title>Data 1 <_title>Data 2 <_title>Pearson's Correlation Coefficient <_names>r:pearson,r:correl dimension(\x)=dimension(\y) total(\x) total(\y) dimension(\x) dimension(\y) (\x*\y-\1*\2/\3)/abs(((\x^2-(\1^2)/\3)*(\y^2-(\2^2)/\4))^(1/2)) <_title>Data 1 <_title>Data 2 <_title>Spearman's Rho <_names>r:spearman dimension(\x)=dimension(\y) pearson(rank(\x),rank(\y)) <_title>Data 1 <_title>Data 2 <_title>Durbin-Watson <_names>r:durbinwatson csum(2,-1,0,"y"+("x"-element("v","i"-1))^2,"x","y",mergevectors([0],\x),"i","v")/csum(1,-1,0,"y"+"x"^2,"x","y",\x) <_title>Data <_title>Statistical Tests <_title>Unpaired T-Test <_names>r:ttest poolvar(\x,\y)^2 (mean(\x)-mean(\y))/abs(((\1)/dimension(\x)+(\1)/dimension(\y))^(1/2)) <_title>Data 1 <_title>Data 2 <_title>Paired T-Test <_names>r:pttest mean(\x-\y)/stderr(\x-\y) <_title>Data 1 <_title>Data 2 <_title>Distribution <_title>Rayleigh Distribution <_names>r:rayleigh <_description>Returns the probability density p(x) at x for a Rayleigh distribution with scale parameter sigma. (from Gnumeric) if(\x < 0,0,(\x/\y)/\y*exp(-(\x/\y)*(\x/\y)/2)) <_title>X <_title>Sigma 0 <_title>Rayleigh Tail Distribution <_names>r:rayleightail <_description>Returns the probability density p(x) at x for a Rayleigh tail distribution with scale parameter sigma and a lower limit. (from Gnumeric) if(\x < \y,0,(\x/\z)/\z*exp(((\y/\z)+(\x/\z))*((\y/\z)-(\x/\z))/2)) <_title>X <_title>Lower limit <_title>Sigma 0 <_title>Pareto Distribution <_names>r:pareto <_description>Returns the probability density p(x) at x for a Pareto distribution with exponent and scale. (from Gnumeric) if(\x < \z,0,(\y/\z)/(\x/\z)^(\y+1)) <_title>X <_title>Exponent 0 <_title>Scale 0 <_title>Logistic Distribution <_names>r:logistic <_description>Returns the probability density p(x) at x for a logistic distribution with scale parameter. (from Gnumeric) exp(-abs(\x)/\y)/(abs(\y)*(1+exp(-abs(\x)/\y))^2) <_title>X <_title>Scale 0 <_title>Date & Time <_title>Days between two dates <_names>r:days <_description>Returns the number of days between two dates. Basis is the type of day counting you want to use: 0: US 30/360, 1: real days (default), 2: real days/360, 3: real days/365 or 4: European 30/360. <_title>First date <_title>Second date <_title>Day counting basis <_title>Financial function mode <_title>Years between two dates <_names>r:yearfrac <_description>Returns the number of years (fractional) between two dates. Basis is the type of day counting you want to use: 0: US 30/360, 1: real days (default), 2: real days/360, 3: real days/365 or 4: European 30/360. <_title>First date <_title>Second date <_title>Day counting basis <_title>Financial function mode <_title>Week of Year <_names>r:week <_title>Date <_title>Week begins on Sunday <_title>Day of Week <_names>r:weekday <_title>Date <_title>Week begins on Sunday <_title>Month <_names>r:month <_title>Date <_title>Day of Month <_names>r:day <_title>Date <_title>Year <_names>r:year <_title>Date <_title>Day of Year <_names>r:yearday <_title>Date <_title>Current Time <_names>r:time <_title>Standard Date Format <_names>r:isodate <_title>Date <_title>Local Date Format <_names>r:localdate <_title>Date <_title>Date to Unix Timestamp <_names>r:timestamp <_title>Date <_title>Unix Timestamp to Date <_names>r:stamptodate <_title>Timestamp <_title>Add Days <_names>r:addDays <_title>Date <_title>Days <_title>Add Months <_names>r:addMonths <_title>Date <_title>Months <_title>Add Years <_names>r:addYears <_title>Date <_title>Years <_title>Add Time <_names>r:addTime <_description>Adds a time value to a date. The value can be positive or negative, but must use a unit based on seconds (such as day and year). Fractions of days are truncated. addDays(\x,trunc(\y/day)) <_title>Date <_title>Time isNumber(\x/day) <_title>Utilities <_title>ASCII Value <_names>r:code <_title>Character <_title>ASCII Char <_names>r:char <_title>Value <_title>Length of string <_names>r:len <_title>Text <_title>Concatenate Strings <_names>r:concatenate <_title>Text string 1 <_title>Text string 2 <_title>Replace <_names>r:replace <_description>Replaces a certain value in an expression with a new value. The expression is calculated before the replacement if the fourth argument is true. <_title>Expression <_title>Original value <_title>New value <_title>Precalculate expression <_title>Strip Units <_names>r:nounit,strip_units <_description>Removes all units from an expression. The expression is calculated before the removal. <_title>Expression <_title>Process Vector Elements <_names>r:process <_title>Function <_title>Element variable <_title>Vector <_title>Index variable <_title>Vector variable <_title>Process Matrix Elements <_names>r:processm <_title>Function <_title>Element variable <_title>Matrix <_title>Row variable <_title>Column variable <_title>Matrix variable <_title>Custom Sum of Elements <_names>r:csum <_title>First element <_title>Last element <_title>Initial value <_title>Function <_title>Value variable <_title>Element variable <_title>Vector <_title>Index variable <_title>Vector variable <_title>Select Vector Elements <_names>r:select <_title>Vector <_title>Condition <_title>Element variable <_title>Select first match <_title>Function <_names>r:function <_title>Expression <_title>Arguments <_title>Title <_names>r:title <_title>Name <_title>Display Error <_names>r:error <_title>Message <_title>Display Warning <_names>r:warning <_title>Message <_title>Display Message <_names>r:message <_title>Message <_title>Save as Variable <_names>r:save <_title>Value <_title>Name <_title>Category <_title>Title <_title>RPN Stack Register <_names>r:register <_description>Returns the value of a RPN stack register. <_title>Index <_title>RPN Stack Vector <_names>r:stack <_description>Returns the RPN stack as a vector. <_title>Is Number <_names>r:isNumber <_title>Value <_title>Is Real <_names>r:isReal <_title>Value <_title>Is Rational <_names>r:isRational <_title>Value <_title>Is Integer <_names>r:isInteger <_title>Value <_title>Represents Number <_names>r:representsNumber <_title>Value <_title>Represents Real <_names>r:representsReal <_title>Value <_title>Represents Rational <_names>r:representsRational <_title>Value <_title>Represents Integer <_names>r:representsInteger <_title>Value <_title>Logical <_title>For...Do <_names>r:for <_title>Initial value of counter <_title>Counter variable <_title>For condition <_title>Counter update function <_title>Initial value <_title>Do function <_title>Value variable <_title>If...Then...Else <_names>r:if <_description>Tests a condition and returns a value depending on the result. <_title>Condition <_title>Expression if condition is met <_title>Expression if condition is NOT met <_title>Logical Exclusive OR <_names>r:xor <_title>Value 1 <_title>Value 2 <_title>Bitwise Exclusive OR <_names>r:bitxor <_title>Value 1 <_title>Value 2 <_title>Bitwise Shift <_names>r:shift <_title>Number <_title>Bits <_title>Algebra <_title>Sum <_names>au:Σ,r:sum <_description>Corresponds to the sum symbol. Adds terms for each x ranging from the lower to the upper limit. <_title>Term expression <_title>Lower limit (i) <_title>Upper limit (n) <_title>Index variable <_title>Product <_names>au:Π,r:product <_description>Corresponds to the product symbol. Multiplies factors for each x ranging from the lower to the upper limit. <_title>Factor expression <_title>Lower limit (i) <_title>Upper limit (n) <_title>Index variable <_title>Solve for multiple variables <_names>r:multisolve <_title>Equation vector <_title>Variable vector <_title>Solve equation <_names>r:solve <_title>Equation <_title>With respect to <_title>Solve for two variables <_names>r:solve2 <_description>Solves two equations with two unknown variables. Returns the value of the first variable. solve(replace(\x,\A{y},solve(\y,\A)),\Z{x}) <_title>Equation 1 <_title>Equation 2 <_title>Variable 1 <_title>Variable 2 <_title>Find Linear Function <_names>r:linearfunction <_description>Finds the linear function for the straight line between two distinct points. (\a-\y)/(\z-\x)*("x"-\x)+\y <_title>x1 <_title>y1 <_title>x2 <_title>y2 <_title>Calculus <_title>Derive <_names>r:diff <_title>Function <_title>With respect to <_title>Order <_title>Integrate <_names>r:integrate <_title>Function <_title>Variable of integration <_title>Lower limit <_title>Upper limit <_title>Extreme Values <_names>r:extremum solve(diff(\x, \Y{x})=0, \Y) <_title>Function <_title>With respect to <_title>Geometry <_title>Triangle <_title>Hypotenuse <_names>r:hypot sqrt(\x^2+\y^2) <_title>Side A <_title>Side B <_title>Triangle Area <_names>r:triangle (\x*\y)/2 <_title>Base <_title>Height <_title>Triangle Perimeter <_names>r:triangle_perimeter \x+\y+hypot(\x,\y) <_title>Side A <_title>Side B <_title>Circle <_title>Circle Area <_names>r:circle <_description>Calculates the area of a circle using the radius \x^2*pi <_title>Radius <_title>Circle Circumference <_names>r:circumference <_description>Calculates the area of a circle using the radius \x*2*pi <_title>Radius <_title>Cylinder <_title>Cylinder Volume <_names>r:cylinder \x^2*pi*\y <_title>Radius <_title>Height <_title>Surface Area of Cylinder <_names>r:cylinder_sa 2*(\x^2*pi)+2*pi*\x*\y <_title>Radius <_title>Height <_title>Cone <_title>Cone Volume <_names>r:cone \x^2*pi*\y/3 <_title>Radius <_title>Height <_title>Surface Area of Cone <_names>r:cone_sa \x^2*pi+pi*\x*abs((\y^2+\x^2)^(1/2)) <_title>Radius <_title>Height <_title>Sphere <_title>Sphere Volume <_names>r:sphere \x^3*pi*4/3 <_title>Radius <_title>Surface Area of Sphere <_names>r:sphere_sa \x^2*pi*4 <_title>Radius <_title>Square <_title>Square Area <_names>r:square \x^2 <_title>Length of side <_title>Square Perimeter <_names>r:square_perimeter \x*4 <_title>Length of side <_title>Cube <_title>Cube Volume <_names>r:cube \x^3 <_title>Length of side <_title>Surface Area of Cube <_names>r:cube_sa (\x^2)*6 <_title>Length of side <_title>Rectangle <_title>Rectangle Area <_names>r:rect \x*\y <_title>Length <_title>Width <_title>Rectangle Perimeter <_names>r:rect_perimeter (\x+\y)*2 <_title>Length <_title>Width <_title>Prism <_title>Volume of Rectangular Prism <_names>r:rectprism <_description>Calculates the volume of a prism with rectangular base. \x*\y*\z <_title>Length <_title>Width <_title>Height <_title>Surface Area of Rectangular Prism <_names>r:rectprism_sa <_description>Calculates the surface area of a prism with rectangular base. (\x*\y)*2+(\x*\z)*2+(\y*\z)*2 <_title>Length <_title>Width <_title>Height <_title>Volume of Triangular Prism <_names>r:triangleprism <_description>Calculates the volume of a prism with triangular base. \x*\y*\z/2 <_title>Length <_title>Width <_title>Height <_title>Pyramid <_title>Pyramid Volume <_names>r:pyramid <_description>Calculates the volume of a 3-dimensional shape standing on a rectangular base and terminating in a point at the top. \x*\y*\z/3 <_title>Length of base <_title>Width of base <_title>Height <_title>Volume of Regular Tetrahedron <_names>r:tetrahedron sqrt(2)/12*\x^3 <_title>Length of side <_title>Surface Area of Regular Tetrahedron <_names>r:tetrahedron_sa sqrt(3)*\x^2 <_title>Length of side <_title>Height of Regular Tetrahedron <_names>r:tetrahedron_height sqrt(6)/3*\x <_title>Length of side <_title>Volume of Square Pyramid <_names>r:sqpyramid sqrt(2)/6*\x^3 <_title>Length of side <_title>Surface Area of Square Pyramid <_names>r:sqpyramid_sa (1+sqrt(3))*\x^2 <_title>Length of side <_title>Height of Square Pyramid <_names>r:sqpyramid_height sqrt(2)/2*\x <_title>Length of side <_title>Parallelogram <_title>Parallelogram Area <_names>r:parallelogram <_description>Calculates the area of a four-sided figure whose opposite sides are both parallel and equal in length. \x*\y <_title>Base <_title>Height <_title>Parallelogram Perimeter <_names>r:parallelogram_perimeter <_description>Calculates the perimeter of a four-sided figure whose opposite sides are both parallel and equal in length. (\x+\y)*2 <_title>Side A <_title>Side B <_title>Trapezoid <_title>Trapezoid Area <_names>r:trapezoid <_description>Calculates the area of a four-sided figure with two parallel sides. (\x+\y)/2*\z <_title>Side A <_title>Side B <_title>Height <_title>Economics <_title>Microeconomics <_title>Elasticity <_names>r:elasticity <_description>Calculates the demand elasticity. Also works for supply elasticity, income elasticity, cross-price elasticity, etc. Just replace demand, with supply, or price with income... Ex. elasticity(100-x^2, 3) calculates the demand elasticity when the price is 3 for the function "Q = 100 - x^2" where x is the default price variable. replace(diff(\x,\Z{x}),\Z,\y,1)*\y/replace(\x,\Z,\y) <_title>Demand function <_title>Price <_title>Price variable <_title>Consumer Surplus <_names>r:csurplus select(solve(\x=\y,\z),x>=0,x,1) replace(integrate(\x-replace(\y,\Z{x},\1),\Z),\Z,\1,1) <_title>Demand function <_title>Supply function or price <_title>Quantity variabel <_title>Producer Surplus <_names>r:psurplus select(solve(\x=\y,\z),x>=0,x,1) replace(integrate(replace(\y,\Z{x},\1)-\x,\Z),\Z,\1,1) <_title>Supply function <_title>Demand function or price <_title>Quantity variabel <_title>Finance <_title>Sum-of-Years Digits Depreciation <_names>r:syd <_description>Calculates the sum-of-years digits depreciation for an asset based on its cost, salvage value, anticipated life, and a particular period. This method accelerates the rate of the depreciation, so that more depreciation expense occurs in earlier periods than in later ones. The depreciable cost is the actual cost minus the salvage value. The useful life is the number of periods (typically years) over which the asset is depreciated. ((\x-\y)*(\z-\a+1)*2)/(\z*(\z+1)) <_title>Cost <_title>Salvage value <_title>Life <_title>Period <_title>Straight Line Depreciation <_names>r:sln <_description>Determines the straight line depreciation of an asset for a single period. Cost is the amount you paid for the asset. Salvage is the value of the asset at the end of the period. Life is the number of periods over which the asset is depreciated. SLN divides the cost evenly over the life of an asset. (\x-\y)/\z <_title>Cost <_title>Salvage value <_title>Life <_title>Present Value <_names>r:pv <_description>Returns the present value of an investment. If type = 1 then the payment is made at the beginning of the period, If type = 0 (or omitted) it is made at the end of each period. (-\A{0}-\z*(1+\x*\B{0})*(((1+\x)^\y-1)/\x))/((1+\x)^\y) <_title>Interest rate <_title>Number of periods <_title>Payment made each period <_title>Future value <_title>Type <_title>Nominal Interest Rate <_names>r:nominal <_description>Calculates the nominal interest rate from a given effective interest rate compounded at given intervals. \y*(abs((\x+1)^(1/\y))-1) <_title>Effective interest rate <_title>Periods <_title>Zero Coupon <_names>r:zero_coupon <_description>Calculates the value of a zero-coupon (pure discount) bond. \x/((1+\y)^\z) <_title>Face value <_title>Interest rate <_title>Years <_title>Treasury Bill Yield <_names>r:tbillyield <_description>Returns the yield for a treasury bill. (100-\z)/\z*(360/days(\x,\y,1,1)) <_title>Settlement date <_title>Maturity date <_title>Price per $100 face value <_title>Treasury Bill Price <_names>r:tbillprice <_description>Returns the price per $100 value for a treasury bill. 100*(1-(\z*days(\x,\y,1,1))/360) <_title>Settlement date <_title>Maturity date <_title>Discount rate <_title>Treasury Bill Equivalent <_names>r:tbilleq <_description>Returns the bond equivalent for a treasury bill. 365*\z/(360-\z*days(\x,\y,1,1)) <_title>Settlement date <_title>Maturity date <_title>Discount rate <_title>Interest paid on a given period of an investment (ISPMT) <_names>r:ispmt <_description>Calculates the interest paid on a given period of an investment. (-\a*\x)-((-\a*\x)/\z*\y) <_title>Periodic interest rate <_title>Amortizement period 1 <_title>Number of periods 1 <_title>Present value <_title>Payment for a loan <_names>r:pmt <_description>Returns the amount of payment for a loan based on a constant interest rate and constant payments (each payment is equal amount). If type = 1 then the payment is made at the beginning of the period, If type = 0 (or omitted) it is made at the end of each period. (-\z*((1+\x)^\y)-\A{0})/((1+\x*\B{0})*(((1+\x)^\y-1)/\x)) <_title>Rate <_title>Number of periods <_title>Present value <_title>Future value <_title>Type <_title>Periods of an investment <_names>r:nper <_description>Calculates number of periods of an investment based on periodic constant payments and a constant interest rate. Type defines the due date. 1 for payment at the beginning of a period and 0 (default) for payment at the end of a period. ln((\y*(1+\x*\B{0})-\A{0}*\x)/(\z*\x+\y*(1+\x*\B)))/ln(1+\x) <_title>Interest rate <_title>Payment made each period <_title>Present value <_title>Future value <_title>Type <_title>Duration <_names>r:duration <_description>Calculates the duration of a security. <_title>Settlement date <_title>Maturity date <_title>Annual coupon rate (%) <_title>Annualized yield (%) <_title>Frequency <_title>Day counting basis 0 4 <_title>Periods for investment to attain desired value <_names>r:g_duration <_description>Returns the number of periods needed for an investment to attain a desired value. ln(\z/\y)/ln(1+\x) <_title>Rate <_title>Present value <_title>Future value <_title>Payment of an annuity going towards principal (PPMT) <_names>r:ppmt <_description>Calculates the amount of a payment of an annuity going towards principal. Type defines the due date. 1 for payment at the beginning of a period and 0 (default) for payment at the end of a period. ((-\a*(pow(1+\x,\z))-\B{0})/((1+\x*\C{0})*((pow(1+\x,\z)-1)/\x)))+(\a*pow(1+\x,(\y-1))+((-\a*(pow(1+\x,\z))-\B)/((1+\x*\C)*((pow(1+\x,\z)-1)/\x)))*((pow(1+\x,(\y-1))-1)/\x))*\x <_title>Periodic interest rate <_title>Amortizement period 1 <_title>Number of periods 1 <_title>Present value <_title>Desired future value <_title>Type <_title>Effective Interest Rate <_names>r:effect <_description>Calculates the effective interest for a given nominal rate. (1+\x/\y)^\y-1 <_title>Nominal interest rate <_title>Periods <_title>Future Value <_names>r:fv <_description>Computes the future value of an investment. This is based on periodic, constant payments and a constant interest rate. If type = 1 then the payment is made at the beginning of the period, If type = 0 (or omitted) it is made at the end of each period. -(\A{0}*((1+\x)^\y)+\z*(1+\x*\B{0})*(((1+\x)^\y-1)/\x)) <_title>Interest rate <_title>Number of periods <_title>Payment made each period <_title>Present value <_title>Type <_title>Return on continuously compounded interest <_names>r:continuous <_description>Calculates the return on continuously compounded interest, given the principal, nominal rate and time in years. \x*exp(\y*\z) <_title>Principal <_title>Interest rate <_title>Years <_title>Compound <_names>r:compound <_description>Returns the value of an investment, given the principal, nominal interest rate, compounding frequency and time. \x*(1+\y/\z)^(\z*\a) <_title>Principal <_title>Nominal interest rate <_title>Periods per year <_title>Years <_title>Payment of an annuity going towards interest (IPMT) <_names>r:ipmt <_description>Calculates the amount of a payment of an annuity going towards interest. Type defines the due date. 1 for payment at the beginning of a period and 0 (default) for payment at the end of a period. -(\a*pow(1+\x,(\y-1))+((-\a*(pow(1+\x,\z))-\B)/((1+\x*\C)*((pow(1+\x,\z)-1)/\x)))*((pow(1+\x,(\y-1))-1)/\x))*\x <_title>Periodic interest rate <_title>Period 1 <_title>Number of periods 1 <_title>Present value <_title>Future value <_title>Type <_title>Interest rate for a fully invested security <_names>r:intrate <_description>Returns the interest rate for a fully invested security. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. (\a-\z)/\z/yearfrac(\x,\y,\B{0},1) <_title>Settlement date <_title>Maturity date <_title>Investment <_title>Redemption <_title>Day counting basis 0 4 <_title>Dollar Fraction <_names>r:dollarfr <_description>Converts a decimal dollar price into a dollar price expressed as a fraction. int(\x)+frac(\x)*\y/10^ceil(log(\y)) <_title>Decimal dollar <_title>Denominator of fraction 1 <_title>Dollar Decimal <_names>r:dollarde <_description>Converts a dollar price expressed as a fraction into a dollar price expressed as a decimal number. int(\x)+frac(\x)*10^ceil(log(\y))/\y <_title>Fractional dollar <_title>Denominator of fraction 1 <_title>Amount received at maturity for a security bond <_names>r:received <_description>Returns the amount received at the maturity date for an invested security. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. The settlement date must be before maturity date. \z/(1-\a*yearfrac(\x,\y,\B{0},1)) <_title>Settlement date <_title>Maturity date <_title>Investment <_title>Discount rate <_title>Day counting basis 0 4 <_title>Discount rate for a security <_names>r:disc <_description>Returns the discount rate for a security. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. (\a-\z)/\a/yearfrac(\x,\y,\B{0},1)) <_title>Settlement date <_title>Maturity date <_title>Price per $100 face value <_title>Redemption <_title>Day counting basis 0 4 <_title>Accrued interest of security paying at maturity <_names>r:accrintm <_description>Returns the accrued interest for a security which pays interest at maturity date. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. \A{1000}*\z*yearfrac(\x,\y,\B{0},1) <_title>Issue date <_title>Settlement date <_title>Annual rate of security <_title>Par value <_title>Day counting basis 0 4 <_title>Accrued interest of security with periodic interest payments <_names>r:accrint <_description>Returns accrued interest for a security which pays periodic interest. Allowed frequencies are 1 - annual, 2 - semi-annual or 4 - quarterly. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. \b*\a/\c*\c*yearfrac(\x,\z,\D{0},1)+\y*0 <_title>Issue date <_title>First interest <_title>Settlement date <_title>Annual rate of security <_title>Par value <_title>Frequency 1 4 <_title>Day counting basis 0 4 <_title>Number of coupons to be paid <_names>r:coupnum <_description>Returns the number of coupons to be paid between the settlement and the maturity. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. trunc(yearfrac(\x,\y,\A{0},1)*\z) <_title>Settlement date <_title>Maturity date <_title>Frequency 1 12 <_title>Day counting basis 0 4 <_title>Price per $100 face value of a security bond <_names>r:pricedisc <_description>Calculates and returns the price per $100 face value of a security bond. The security does not pay interest at maturity. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. \a-\z*\a*yearfrac(\x,\y,\B{0},1) <_title>Settlement date <_title>Maturity date <_title>Discount <_title>Redemption <_title>Day counting basis 0 4 <_title>Price per $100 face value of a security <_names>r:pricemat <_description>Calculates and returns the price per $100 face value of a security. The security pays interest at maturity. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. (100+yearfrac(\z,\y,\C{0},1)*\a*100)/(1+yearfrac(\x,\y,\C,1)*\b)-yearfrac(\z,\x,\C,1)*\a*100 <_title>Settlement date <_title>Maturity date <_title>Issue date <_title>Discount rate <_title>Annual yield <_title>Day counting basis 0 4 <_title>Level-Coupon Bond <_names>r:level_coupon <_description>Calculates the value of a level-coupon bond. (\y*\x/\z)*((1-1/(((1+(\b/\z))^(\a*\z))))/(\b/\z))+(\x/((1+(\b/\z))^(\a*\z))) <_title>Face value <_title>Coupon rate <_title>Coupons per year <_title>Years <_title>Market interest rate libqalculate-0.9.7/data/currencies.xml0000644000175100017510000004371211320655050014715 00000000000000 Currency Valuta Valuta 货币 European Euros Europese euro Euro 欧元 ar:EUR,au:€,euro,p:euros a:EUR,au:€,euro ar:EUR,au:€,欧元 U.S. Dollars U.S. dollar Amerikanska dollar 美元 a:$,ar:USD,dollar,p:dollars a:$,a:USD,dollar a:$,ar:USD,美元 Japanese Yen Japanse yen Japanska yen 日元 ar:JPY,au:¥,yen ar:JPY,au:¥,日元 Danish Kroner Deense kroon Danska kronor 丹麦Kroner ar:DKK ar:DKK British Pounds Britse Pond Brittiska pund 英镑 ar:GBP,au:£ ar:GBP,au:£ Thai Bat Thailandse bat Thailändska bat 泰国Bat ar:THB ar:THB Swedish Krona Zweedse kroon Svenska kronor 瑞典克郎 ar:SEK a:kr,a:SEK,krona,p:kronor ar:SEK Swiss Francs Zwitserse franc Schweizerfranc 瑞士法郎 ar:CHF ar:CHF Icelandic Krona IJslandse kroon Isländska kronor 冰岛克朗 ar:ISK ar:ISK Norwegian Kroner Noorse kroon Norska kronor 挪威Kroner ar:NOK ar:NOK Bulgarian Lev Bulgaarse Lev Bulgariska lev 保加利亚列弗 lev,ar:BGN lev,ar:BGN Russian Ruble Russische roebel Ryska rubel 俄罗斯卢布 ar:RUB,ruble RUB,roebel a:RUB,rubel ar:RUB,卢布 Phillipine Peso Filippijnse peso Fillipinska peso 菲律宾比索 ar:PHP ar:PHP Malaysian Ringgit Maleisische ringgit Malaysiska ringgit 马来西亚林吉特 ar:MYR ar:MYR Croatian Kuna Kroatische kuna Kroatiska kuna 克罗地亚 ar:HRK ar:HRK Yuan Renmimbi (PR China) Yuan Renmimbi (PR China) 人民币元 ar:CNY ar:CNY Indonesian Rupiah Indonesische roepiah Indonesiska rupiah 印尼卢比 ar:IDR ar:IDR Cypriot Pound Cypriotische pond Cypriotiska pund 塞浦路斯镑 ar:CYP ar:CYP Czech Koruna Tsjechische kroon Tjeckiska koruna 捷克克朗 ar:CZK ar:CZK Estonian Kroon Estlandse kroon Estoniska kroon 爱沙尼亚克鲁恩 ar:EEK ar:EEK Hungarian Forint Hongaarse forint Ungerska forint 匈牙利福林 forint,ar:HUF forint,ar:HUF Lithuanian Lit Litouwse lit Litauiska lit 立陶宛Lit lit,ar:LTL lit,ar:LTL Latvian Lat Letlandse lat Lettiska lat 拉脱维亚 Lat lat,ar:LVL lat,ar:LVL Maltese Lira Maltese Lira Maltesiska lire 马耳他里拉 ar:MTL ar:MTL Polish Zloty Poolse zloty Polska zloty 波兰兹罗提 zloty,ar:PLN zloty,ar:PLN Romanian New Leu Nieuwe Roemeense leu Rumänska nya leu 罗马尼亚新Leu leu,ar:RON leu,ar:RON Slovenian Tolar Sloveense tolar Slovenska tolar 斯洛文尼亚Tolar tolar,ar:SIT tolar,ar:SIT Slovakian Koruna Slowaakse kroon Slovakiska koruna 斯洛伐克Koruna ar:SKK ar:SKK Turkish New Lira Nieuwe Turkse lire Turkiska nya lira 土耳其新里拉 ar:TRY ar:TRY Australian Dollars Australische dollar Australiensiska dollar 澳大利亚元 ar:AUD ar:AUD Canadian Dollars Canadese dollar Kanadensiska dollar 加拿大元 ar:CAD ar:CAD Hong Kong Dollars Hongkong dollar Hong Kong dollar 港币 ar:HKD ar:HKD New Zealand Dollars Nieuwzeelandse dollar Nya Zeeländska dollar 新西兰元 ar:NZD ar:NZD Singapore Dollars Singapore dollar Singaporedollar 新加坡元 ar:SGD ar:SGD South Korean Won Zuid-Koreaanse won Sydkoreanska won 韩元 ar:KRW ar:KRW South African Rand Zuid-Afrikaanse rand Sydafrikanska rand 南非兰特 ar:ZAR ar:ZAR Euro Cent Eurocent Eurocent 欧元分 r:eurocent,p:eurocents eurocent,eurocenten eurocent r:欧元分 EUR 1/100 1 Cent (USD) Cent (USD) Cent (USD) 美分 au:¢,r:cent,p:cents ¢,cent,centen au:¢,cent au:¢,r:美分 USD 1/100 1 Belgian Franc Belgische frank Belgiska franc 比利时法郎 ar:BEF ar:BEF EUR 1/40.3399 1 Greek Drachma Griekse drachme Grekiska drachmer 希腊德拉马克 ar:GRD ar:GRD EUR 1/340.750 1 French Franc Franse franc Franska franc 法国法郎 ar:FRF,franc ar:FRF,法郎 EUR 1/6.55957 1 Italian Lira Italiaanse lire Italienska lire 意大利里拉 ar:ITL,lira ITL,lire ar:ITL,lire ar:ITL,里拉 EUR 1/1936.27 1 Dutch Guilder Nederlandse gulden Nederländska gulden 荷兰盾 ar:NLG,guilder NLG,gulden a:NLG,gulden ar:NLG,guilder EUR 1/2.20371 1 Portuguese Escudo Portugese escudo Portugisiska escudos 葡萄牙埃斯库多 ar:PTE,escudo ar:PTE,escudo EUR 1/200.482 1 Deutche Mark Duitse mark Tyska mark ar:DEM,mark ar:DEM,马克 EUR 1/1.95583 1 Spanish Peseta Spaanse peseta Spanska pesetas 西班牙比塞塔 ar:ESP,peseta,p:pesetas ar:ESP,peseta,p:pesetas EUR 1/166.386 1 Irish Pound Ierse pond Irländska pund 爱尔兰镑 ar:IEP ar:IEP EUR 1/0.787564 1 Luxembourg Franc Luxemburgse frank Luxemburgfranc 卢森堡法郎 ar:LUF ar:LUF EUR 1/40.3399 1 Austrian Schilling Oostenrijkse schilling Österrikiska schilling 奥地利先令 ar:ATS,schilling ar:ATS,先令 EUR 1/13.7603 1 Finnish Markka Finse mark Finska mark 芬兰马克 ar:FIM,markka ar:FIM,markka EUR 1/5.94573 1 libqalculate-0.9.7/data/prefixes.xml.in0000644000175100017510000000634411305546371015015 00000000000000 yocto y -24 zepto z -21 atto a -18 femto f -15 pico p -12 nano n -9 micro u µ -6 milli m -3 centi c -2 deci d -1 deka da 1 hekto h 2 kilo k 3 mega M 6 giga G 9 tera T 12 peta P 15 exa E 18 zetta Z 21 yotta Y 24 kibi Ki 10 mebi Mi 20 gibi Gi 30 tebi Ti 40 pebi Pi 50 exbi Ei 60 libqalculate-0.9.7/data/units.xml0000644000175100017510000041570711320655052013726 00000000000000 !units!Length Lengte Längd 长度 SI Meter Meter ar:m,meter,p:meters,metre,p:metres m,meter,meters a:m,meter ar:m,meter,p:meters,metre,p:metres Kilometer Kilometer 千米 r:km_c m 3 1 Decimeter Decimeter 分米 r:dm_c m -1 1 Centimeter Centimeter Centimeter 厘米 r:cm_c m -2 1 Millimeter Milimeter 毫米 r:mm_c m -3 1 Nautical Mile Nautische mijl Sjömil 海里 r:nautical_mile,p:nautical_miles nautische_mijl,nautische_mijlen sjömil r:nautical_mile,p:nautical_miles m 1852 1 Ångström Ångström Ångström aru:Å,u:ångström,angstrom aru:Å,u:ångström,angstrom m 1E-10 1 U.S. Survey Inch U.S. Survey Inch ar:US_in,US_inch,p:US_inches ar:US_in,US_inch,p:US_inches m 100/3937 1 Inch Inch Tum 英寸 ar:in,inch,p:inches tum,a:in,inch ar:in,inch,p:inches m 0.0254 1 Hand Hand r:hand,p:hands r:hand,p:hands in 4 1 Foot Voet Engelsk Fot 英尺 ar:ft,foot,p:feet ar:ft,foot,p:feet hand 3 1 U.S. Survey Foot U.S. Survey Foot ar:US_ft,US_foot,p:US_feet ar:US_ft,US_foot,p:US_feet US_in 12 1 Link Link Länk ar:li,link,p:links ar:li,link,p:links ft 66/100 1 Yard Yard ar:yd,yard,p:yards ar:yd,yard,p:yards ft 3 1 Rod (pole/perch) Rod (pole/perch) ar:rd,rod,p:rods ar:rd,rod,p:rods US_ft 16.5 1 Fathom Vadem Famn 英寻 r:fathom,p:fathoms vadem,vadems r:fathom,p:fathoms yd 2 1 Chain Chain ar:ch,chain,p:chains ar:ch,chain,p:chains li 100 1 Furlong Furlong 弗隆 ar:fur,furlong,p:furlongs ar:fur,furlong,p:furlongs yd 220 1 Mile Mijl 英里 ar:mi,mile,p:miles mi,mijl,mijlen ar:mi,mile,p:miles ch 80 1 U.S. Survey Mile U.S. Survey Mile ar:US_mi,US_mile,p:US_miles ar:US_mi,US_mile,p:US_miles US_ft 5280 1 Mil (1/1000 in) Mil (1/1000 in) 毫英寸(1/1000英寸) r:mil,p:mils r:mil,p:mils in 0.001 1 Astronomical Unit Astronomische eenheid Astronomisk enhet 天文单位 ar:AU,astronomical_unit,p:astronomical_units AU,astronomische_eenheid,astronomische_eenheden a:AU,astronomisk_enhet,p:astronomiska_enheter ar:AU,astronomical_unit,p:astronomical_units m 149578706600 1 Light Year Lichtjaar Ljusår 光年 ar:ly,lightyear,p:lightyears lj,lichtjaar,lichtjaren a:ly,ljusår ar:ly,lightyear,p:lightyears m 9460730472580800 1 Parsec Parsec 秒差距 ar:pc,parsec,p:parsecs a:pc,parsek,p:parseks ar:pc,parsec,p:parsecs AU 648000/pi 1 Pied du roi (French Royal Foot) Pied du roi (Franse koninklijke voet) r:pied_du_roi r:pied_du_roi m 9000/27706 1 Pouce (French Royal Inch) Pouce (Franse koninklijke duim) r:pouce r:pouce pied_du_roi 1/12 1 Ligne Ligne (1/40 inch) r:ligne r:ligne pouce 1/12 1 Toise Toise r:toise r:toise pied_du_roi 6 1 !units!Angle Hoek Vinkel 角度 Plane Angle Vlakke hoek Planvinkel 平面角 true Meter per Meter Meter per meter Meter per meter 米每米 r:m_p_m m 0 1 m 0 -1 SI Radian Radiaal Radian 弧度 ar:rad,radian,p:radians rad,radiaal,radialen ar:rad,radian,p:radians m_p_m 1 1 Degree Graad Grad ar:deg,au:°,degree,p:degrees grd,°,graad,graden a:deg,au:°,grad,p:grader ar:deg,au:°,degree,p:degrees rad pi/180 1 Gradian (Gon) Grad (Gon) Gradient (Gon) ar:gra,gradian,p:gradians,gon,p:gons gra,grad,grads,gon,gons ar:gra,gradian,p:gradians,gon,p:gons rad pi/200 1 Arcminute Boogminuut 弧分 r:arcminute,p:arcminutes boogminuut,boogminuten r:arcminute,p:arcminutes deg 1/60 1 Arcsecond Boogseconde 弧秒 r:arcsecond,p:arcseconds boogseconde,boogseconden r:arcsecond,p:arcseconds arcminute 1/60 1 Turn Slag r:turn,p:turns slag,slagen r:turn,p:turns deg 360 1 Solid Angle Ruimtehoek Rymdvinkel 立体角 true Square Meter per Square Meter Vierkante meter per vierkante meter Kvadratmeter per kvadratmeter 平方米每平方米 r:sqm_p_sqm m 0 2 m 0 -2 SI Steradian Steradiaal Steradian 球面度 ar:sr,steradian,p:steradians sr,steradiaal,steradialen ar:sr,steradian,p:steradians m_p_m 1 1 Angular Acceleration Hoekversnelling Vinkelacceleration 角加速度 SI Radians per Second Squared Radialen per seconde kwadraat Radianter per kvadratsekund 弧度每平方秒 r:rad_p_sqs rad 0 1 s 0 -2 Angular Velocity Hoeksnelheid Vinkelhastighet 角速度 SI Radians per Second Radialen per seconde Radianter per sekund 弧度每秒 r:rad_p_s rad 0 1 s 0 -1 !units!Mass Massa Massa 质量 SI Gram Gram ar:g,gram,p:grams g,gram,grammen a:g,gram ar:g,gram,p:grams Kilogram Kilogram 千克 r:kg_c g 3 1 Hektogram Hectogram r:hg_c g 2 1 Metric Ton (Tonne) Metrische ton (Ton) Ton 公吨 ar:t,tonne,p:tonnes,ton,p:tons t,ton,tonnen a:t,ton ar:t,tonne,p:tonnes,ton,p:tons g 1000000 1 Grain Grain 格令 ar:gr,grain,p:grains ar:gr,grain,p:grains g 0.06479891 1 Pennyweight Pennyweight 本尼威特 ar:pwt,pennyweight,p:pennyweights ar:pwt,pennyweight,p:pennyweights gr 24 1 Ounce (troy) Ounce (troy) 金衡制盎司 ar:oz_t,troy_ounce,p:troy_ounces ar:oz_t,troy_ounce,p:troy_ounces pwt 20 1 Pound (troy) Pound (troy) Pund (troy) 金衡制磅 ar:lb_t,troy_pound,p:troy_pounds ar:lb_t,troy_pound,p:troy_pounds oz_t 12 1 Dram Dram 英钱 ar:dr,dram,p:drams ar:dr,dram,p:drams g 1.7718451953125 1 Ounce Ounce 盎司 ar:oz,ounce,p:ounces ar:oz,ounce,p:ounces dr 16 1 Pound Pound Pund ar:lb,pound,p:pounds ar:lb,pound,p:pounds oz 16 1 Short Hundredweight Short hundredweight 短英担 ar:cwt,hundredweight,p:hundredweights ar:cwt,hundredweight,p:hundredweights lb 100 1 Long Hundredweight Long hundredweight 长担 ar:l_cwt,long_hundredweight,p:long_hundredweights ar:l_cwt,long_hundredweight,p:long_hundredweights lb 112 1 Short Ton Short ton 短吨 ar:s_ton,short_ton,p:short_tons ar:s_ton,short_ton,p:short_tons lb 2000 1 Long Ton Long ton 长吨 ar:l_ton,long_ton,p:long_tons ar:l_ton,long_ton,p:long_tons lb 2240 1 Stone Stone r:stone,p:stones r:stone,p:stones lb 14 1 Cental Cental 百磅 r:cental,p:centals r:cental,p:centals lb 100 1 Carat Karaat Karat 克拉 r:carat,p:carats karaat karat r:carat,p:carats g 0.2 1 Pfund Pond r:pfund r:pfund g 500 1 Zentner Zentner r:zentner r:zentner pfund 100 1 Density Dichtheid Densitet 密度 SI Kilogram per Cubic Meter Kilogram per kubieke meter Kilogram per kubikmeter 千克每立方米 r:kg_p_cum g 3 1 m 0 -3 Gram per Cubic Decimeter Gram per kubieke decimeter Gram per kubikdecimeter 克每立方分米 r:g_p_cudm g 0 1 m -1 -3 Gram per Cubic Centimeter Gram per kubieke centimeter Gram per kubikcentimeter 克每立方厘米 r:g_p_cucm g 0 1 m -2 -3 Gram per Mole Gram per mol Gram per mol 克每摩尔 r:g_p_mol g 0 1 mol 0 -1 Atomic Mass Unit Atomaire massa-eenheid Atomisk massenhet 原子质量单位 ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units AMU,atomaire_massa_eenheid,atomaire_massa_eenheden a:u,a:AMU,atomisk_mass_enhet,p:atomiska_mass_enheter ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units g_p_mol 1 1 Mass Fraction Massafractie 质量分数 SI Kilogram per Kilogram Kilogram per kilogram Kilogram per kilogram 千克每千克 r:kg_p_kg g 3 1 g 3 -1 Time Tijd Tid 时间 SI Second Seconde Sekund ar:s,second,p:seconds s,seconde,seconden a:s,sekund,p:sekunder ar:s,second,p:seconds Minute Minuut Minut ar:min,minute,p:minutes min,minuut,minuten a:min,minut,p:minuter ar:min,minute,p:minutes s 60 1 Hour Uur Timme 小时 ar:h,hour,p:hours u,uur,uren a:h,timme,p:timmar ar:h,hour,p:hours min 60 1 Day Dag Dag ar:d,day,p:days d,dag,dagen a:d,dag,p:dagar ar:d,day,p:days h 24 1 Week Week Vecka r:week,p:weeks week,weken vecka,p:veckor r:week,p:weeks day 7 1 Fortnight Fortnight 两星期 r:fortnight,p:fortnights r:fortnight,p:fortnights week 2 1 Julian Year Juliaans jaar Julianskt år 儒略年 r:year,p:years jaar,jaren år r:year,p:years d 365.25 1 !units!Frequency Frequentie Frekvens 频率 SI Hertz Hertz 赫兹 ar:Hz,hertz ar:Hz,hertz s 1 -1 Electricity Elektriciteit Elektricitet 电学 Electric Current Elektrische stroom Elektrisk ström 电流 SI Ampere Ampere Ampere 安培 ar:A,ampere,p:amperes a:A,ampere ar:A,ampere,p:amperes CGS Abampere Abampere Abampere 绝对安培 r:abampere,a:abA,a:aA,p:abamperes r:abampere,a:abA,a:aA,p:abamperes A 10 1 Current Density Stroomdichtheid Strömtäthet 电流密度 SI Ampere per Meter Squared Ampere per meter kwadraat Ampere per kvadratmeter 安培每平方米 r:A_p_sqm A 0 1 m 0 -2 Electric Charge Elektrische lading Elektrisk laddning 电荷 Second Ampere Seconde ampere Sekundampere 秒安培 r:s_A s 0 1 A 0 1 SI Coulomb Coulomb Coulomb 库仑 ar:C,coulomb,p:coulombs a:C,coulomb ar:C,coulomb,p:coulombs s_A 1 1 CGS Abcoulomb Abcoulomb Abcoulomb 绝对库伦 r:abcoulomb,p:abcoulombs,a:abC,a:aC r:abcoulomb,p:abcoulombs,a:abC,a:aC C 10 1 CGS Statcoloumb (Franklin) Statcoloumb (Franklin) r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins C 3.3356410E-10 1 Electric Charge Density Elektrische ladingsdichtheid Laddningstäthet 电荷密度 SI Coulomb per Cubic Meter Coulomb per kubieke meter Coulomb per kubikmeter 库仑每立方米 r:C_p_cum C 0 1 m 0 -3 Electric Flux Density Elektrische fluxdichtheid Elektrisk flödestäthet 电通密度 SI Coulomb per Meter Squared Coulomb per vierkante meter Coulomb per kvadratmeter 库仑每平米 r:C_p_sqm C 0 1 m 0 -2 Electric Potential Elektrische potentiaal Elektrisk potential 电势 Watt per Ampere Watt per ampere Watt per ampere 瓦每安培 r:W_p_A W 0 1 A 0 -1 SI Volt Volt 伏特 ar:V,volt,p:volts a:V,volt ar:V,volt,p:volts W_p_A 1 1 CGS Statvolt Statvolt 静伏特 r:statvolt,p:statvolts,a:statV r:statvolt,p:statvolts,a:statV V 299.792458 1 CGS Abvolt Abvolt Abvolt 绝对伏特 r:abvolt,p:abvolts,a:abV r:abvolt,p:abvolts,a:abV V 1E-8 1 Capacitance Capaciteit Kapasitans 电容 Coulomb per Volt Coulomb per volt Coloumb per volt 库仑每伏特 r:C_p_V C 0 1 V 0 -1 SI Farad Farad 法拉 ar:F,farad,p:farads a:F,farad ar:F,farad,p:farads C_p_V 1 1 Electric Resistance Elektrische weerstand Resistans 电阻 SI Volt per Ampere Volt per ampere Volt per ampere 伏特每安培 r:V_p_A V 0 1 A 0 -1 SI Ohm Ohm 欧姆 au:Ω,r:ohm,p:ohms Ω,ohm au:Ω,ohm au:Ω,r:ohm,p:ohms V_p_A 1 1 CGS Abohm Abohm Abohm 绝对单位欧姆 r:abohm,p:abohms,au:abΩ abohm, abohms,abΩ r:abohm,p:abohms,au:abΩ ohm 1E-9 1 CGS Statohm Statohm 静欧姆 r:statohm,p:statohms,au:statΩ r:statohm,p:statohms,au:statΩ ohm 8.9875517874E11 1 Electric Conductance Elektrisch geleidingsvermogen Induktion 电导 Ampere per Volt Ampere per volt Ampere per volt 安培每伏特 r:A_p_V A 0 1 V 0 -1 SI Siemens Siemens ar:S,siemens ar:S,siemens A_p_V 1 1 Electric Field Strength Elektrische veldsterkte Elektrisk fältstyrka 电场强度 SI Volt per Meter Volt per meter Volt per meter 伏特每米 r:V_p_m V 0 1 m 0 -1 Permittivity Permittiviteit Permitivitet 电容率 SI Farad per Meter Farad per meter Farad per meter 法拉每米 r:F_p_m F 0 1 m 0 -1 Inductance Zelfinductie Induktans 电感 Weber per Ampere Weber per ampere Weber per ampere 韦伯每安培 r:Wb_p_A Wb 0 1 A 0 -1 SI Henry Henry 亨利 ar:H,henry,p:henrys a:H,henry ar:H,henry,p:henrys Wb_p_A 1 1 Permeability Permeabiliteit Permeabilitet 磁导率 SI Henry per Meter Henry per meter Henry per meter 亨利每米 r:H_p_m H 0 1 m 0 -1 Temperature Temperatuur Temperatur 温度 SI Kelvin Kelvin 开尔文 ar:K,kelvin,p:kelvins a:K,kelvin ar:K,kelvin,p:kelvins SI Degree Celcius Graden Celsius Grader Celcius 摄氏度 ar:oC,au:°C,r:celcius ar:oC,au:°C,r:celcius K \x + 273.15 \x - 273.15 1 Degrees Rankine Graden Rankine Grader Rankine ar:oR,au:°R,r:rankine ar:oR,au:°R,r:rankine K 5\x/9 9\x/5 1 Degrees Fahrenheit Graden Fahrenheit Grader Fahrenheit 华氏度 ar:oF,au:°F,r:fahrenheit ar:oF,au:°F,r:fahrenheit K (2298.35+5\x)/9 (9\x-2298.35)/5 1 Substance Stofhoeveelheid Substans 物质 SI Mole Mol Mol 摩尔 ar:mol,mole,p:moles mol,mol,molen mol ar:mol,mole,p:moles Einstein Einstein 爱因斯坦 r:einstein,p:einsteins einstein r:einstein,p:einsteins Substance Concentration Concentratie van stof Substanskoncentration 物质浓度 SI Mole per Cubic Meter Mol per kubieke meter Mol per kubikmeter 摩尔每平米 r:mol_p_cum mol 0 1 m 0 -3 Catalytic Activity Katalitische activiteit Katalytisk aktivitet 催化活性 Reciprocal Seconds Mole Omgekeerde seconden mol Reciproka sekundmol r:recs_mol mol 0 1 s 0 -1 SI Katal Katal 卡塔尔 ar:kat,katal,p:katals a:kat,katal ar:kat,katal,p:katals recs_mol 1 1 Catalytic Concentration Catalitische concentratie Katalytisk koncentration 催化浓度 SI Katal per Cubic Meter Katal per kubieke meter Katal per kubikmeter 卡塔尔每立方米 r:kat_p_cum kat 0 1 m 0 -3 Light Licht Ljus 光学 Luminous Intensity Lichtsterkte Luminansintensitet 发光强度 SI Candela Candela Candela ar:cd,candela,p:candelas a:cd,candela ar:cd,candela,p:candelas Luminance Luminantie Luminans 亮度 SI Candela per Meter Squared Candela per vierkante meter Candela per kvadratmeter r:cd_p_sqm cd 0 1 m 0 -2 CGS Stilb Stilb 熙提 ar:sb,stilb,p:stilbs ar:sb,stilb,p:stilbs cd_p_sqm 10000 1 Luminous Flux Lichtstroom Luminansflöde 光通量 Candela Steradian Candela-steradiaal Candelasteradian r:cd_sr cd 0 1 sr 0 1 SI Lumen Lumen 流明 ar:lm,lumen,p:lumens lm,lumen a:lm,lumen ar:lm,lumen,p:lumens cd_sr 1 1 Illuminance Verlichtingssterkte Illuminans 照度 Lumen per Meter Squared Lumen per vierkante meter Lumen per kvadratmeter 流明每平米 r:lm_p_sqm lm 0 1 m 0 -2 true Lumen per Foot Squared Lumen per vierkante voet Lumen per kvadratfor 流明每平方英尺 r:lm_p_sqft lm 0 1 ft 0 -2 SI Lux Lux 勒克斯 ar:lx,lux ar:lx,lux lm_p_sqm 1 1 Foot-Candle Foot-Candle ar:fc,footcandle,p:footcandles ar:fc,footcandle,p:footcandles lm_p_sqft 1 1 CGS Phot Phot 幅透 ar:ph,phot,p:phots ar:ph,phot,p:phots lx 10000 1 Radiant Intensity Stralingsintensiteit Strålningsstyrka 辐射强度 Watt per Steradian Watt per steradiaal Watt per steradian 瓦每球面度 r:W_p_sr W 0 1 sr 0 -1 Irradiance Irradiantie Irradians 辐照度 SI Watt per Meter Squared Watt per meter kwadraat Watt per kvadratmeter 瓦每平米 r:W_p_sqm W 0 1 m 0 -2 Einstein per Meter Squared per Second Einstein per vierkante meter per seconde Einsteins per kvadratmeter per sekund 爱因斯坦每平方米每秒 r:einstein_p_sqm_p_s einstein 0 1 m 0 -2 s 0 -1 Microeinstein per Meter Squared per Second Micro-einstein per vierkante meter per seconde Kikroeinstein per kvadratmeter per sekund r:microeinstein_p_sqm_p_s einstein -6 1 m 0 -2 s 0 -1 Radiance Radiantie Radians 辐射率 SI Watt per Square Meter Steradian Watt per vierkante meter per steradiaal Watt per steradiankvadratmeter 瓦每平米球面度 r:W_p_sqm_sr W 0 1 sr 0 -1 m 0 -2 Area Oppervlak 面积 SI Square Meter Vierkante meter Kvadratmeter 平方米 r:sqm m 0 2 Square Kilometer Vierkante kilometer Kvadratkilometer 平方千米 r:sqkm m 3 2 Are Are ar:a,are,p:ares ar:a,are,p:ares m 100 2 Hectare Hectare Hektar 公顷 r:ha a 2 1 Barn Barn ar:b,barn,p:barns ar:b,barn,p:barns m 1E-28 2 Rood Rood r:rood,p:roods r:rood,p:roods yd 1210 2 Acre Acre 英亩 r:acre,p:acres r:acre,p:acres ch 10 2 Section Sectie r:section,p:sections sectie,secties r:section,p:sections mi 1 2 Township Township r:township,p:townships r:township,p:townships section 36 1 Square Foot Vierkante voet Kvadratfot 平方英尺 r:sqft ft 0 2 Square Inch Vierkante inch Kvadrattum 平方英寸 r:sqin in 0 2 Square Mile Vierkante mijl Kvadratmile 平方英里 r:sqmi mi 0 2 Volume Volume Volym 体积 SI Cubic Meter Kubieke meter Kubikmeter 立方米 r:cum m 0 3 Liter Liter ar:L,a:l,liter,p:liters,litre,p:litres L,l,liter,liters,liter,liters a:L,a:l,liter ar:L,a:l,liter,p:liters,litre,p:litres m 0.001 3 Milliliter Mililiter 毫升 r:ml_c l -3 1 Centiliter Centiliter Centiliter 厘升 r:cl_c l -2 1 Deciliter Deciliter 分升 r:dl_c l -1 1 Cubic Inch Kubieke inch Kubiktum 立方英寸 r:cuin in 0 3 Fuel Economy Brandstofgebruik Bränsleförbrukning 燃料经济 Liter per Kilometer Liter per kilometer Liter per kilometer 升每千米 r:l_p_km l 0 1 m 3 -1 Kilometer per Liter Kilometer per liter Kilometer per liter 千米每升 r:km_p_l m 3 1 l 0 -1 true Miles per Gallon Miles per Gallon 英里每加仑 r:mile_p_gal mi 0 1 gal 0 -1 Miles per Gallon Miles per Gallon 英里每加仑 a-cr:mpg a-cr:mpg mile_p_gal 1 1 Cooking Koken Matlagning 烹饪 Teaspoon Theelepel 茶匙 r:teaspoon,p:teaspoons theelepel,theelepels tesked,p:teskedar r:teaspoon,p:teaspoons L 0.005 1 Dessertspoon Dessertlepel Dessertsked 点心匙 r:dessertspoon,p:dessertspoons dessertlepel,dessertlepels dessertsked,p:dessertskedar r:dessertspoon,p:dessertspoons teaspoon 2 1 Tablespoon Eetlepel 汤匙 r:tablespoon,p:tablespoons eetlepel,eetlepels matsked,p:matskedar r:tablespoon,p:tablespoons teaspoon 3 1 Cup Kop r:cup,p:cups kop,p:koppen kopp,p:koppar r:cup,p:cups L 0.250 1 Imperial Capacity Imperial Capacity Imperial Fluid Ounce Imperial Fluid Ounce ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces L 0.0284130625 1 Imperial Gill Imperial Gill ar:UK_gi,imperial_gill,p:imperial_gills ar:UK_gi,imperial_gill,p:imperial_gills UK_fl_oz 5 1 Imperial Pint Imperial Pint ar:UK_pt,imperial_pint,p:imperial_pints ar:UK_pt,imperial_pint,p:imperial_pints UK_gi 4 1 Imperial Quart Imperial Quart ar:UK_qt,imperial_quart,p:imperial_quarts ar:UK_qt,imperial_quart,p:imperial_quarts UK_pt 2 1 Imperial Gallon Imperial Gallon ar:UK_gal,imperial_gallon,p:imperial_gallons ar:UK_gal,imperial_gallon,p:imperial_gallons UK_qt 4 1 Imperial Minim Imperial Minim r:imperial_minim,p:imperial_minims r:imperial_minim,p:imperial_minims UK_fl_oz 1/480 1 Imperial Fluid Scuple Imperial Fluid Scuple r:imperial_fluid_scuple,p:imperial_fluid_scuples r:imperial_fluid_scuple,p:imperial_fluid_scuples imperial_minim 20 1 Imperial Fluid Drachm Imperial Fluid Drachm ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms imperial_fluid_scuple 3 1 Imperial Bushel Imperial Bushel ar:UK_bu,imperial_bushel,p:imperial_bushels ar:UK_bu,imperial_bushel,p:imperial_bushels UK_gal 8 1 U.S. Capacity U.S. Capacity U.S. Fluid Ounce U.S. Fluid Ounce ar:fl_oz,fluid_ounce,p:fluid_ounces ar:fl_oz,fluid_ounce,p:fluid_ounces in 231/128 3 U.S. Gill U.S. Gill ar:gi,gill,p:gills ar:gi,gill,p:gills fl_oz 4 1 U.S. Liquid Pints U.S. Liquid Pints ar:liq_pt,liquid_pint,p:liquid_pints ar:liq_pt,liquid_pint,p:liquid_pints gi 4 1 U.S. Liquid Quarts U.S. Liquid Quarts ar:liq_qt,liquid_quart,p:liquid_quarts ar:liq_qt,liquid_quart,p:liquid_quarts liq_pt 2 1 U.S. Minim U.S. Minim r:minim,p:minims r:minim,p:minims fl_oz 1/480 1 U.S. Fluid Drachm U.S. Fluid Drachm ar:fl_dr,fluid_drachm,p:fluid_drachms ar:fl_dr,fluid_drachm,p:fluid_drachms minim 60 1 U.S. Dry Pint U.S. Dry Pint ar:dry_pt,dry_pint,p:dry_pints ar:dry_pt,dry_pint,p:dry_pints in 33.6003125 3 U.S. Dry Quart U.S. Dry Quart ar:dry_qt,dry_quart,p:dry_quarts ar:dry_qt,dry_quart,p:dry_quarts dry_pt 2 1 U.S. Peck U.S. Peck ar:pk,peck,p:pecks ar:pk,peck,p:pecks dry_qt 8 1 U.S. Bushel U.S. Bushel ar:bu,bushel,p:bushels ar:bu,bushel,p:bushels pk 4 1 U.S. Gallon U.S. Gallon ar:gal,gallon,p:gallons ar:gal,gallon,p:gallons liq_qt 4 1 U.S. Barrell (oil) U.S. Barrell (olie) ar:bbl,barrell,p:barrells ar:bbl,barrell,p:barrells gal 42 1 Specific Volume Soortelijk volume Specifik volym SI Cubic Meter per Kilogram Kubieke meter per kilogram Kubikmeter per kilogram 立方米每公斤 r:cum_p_kg m 0 3 g 3 -1 Speed Snelheid Hastighet 速度 SI Meter per Second Meter per seconde Meter per sekund 米每秒 r:m_p_s m 0 1 s 0 -1 Kilometer per Hour Kilometer per uur Kilometer per timme 千米每小时 r:km_p_h m 3 1 h 0 -1 Nautical Mile per Hour Nautische mijl per uur Sjömil per timme 海里每小时 r:nautical_mile_p_h nautical_mile 0 1 h 0 -1 Knot Knoop Knop r:knot,p:knots knoop,knopen knop r:knot,p:knots nautical_mile_p_h 1 1 true Miles per Hour Miles per Hour Miles per timme 英里每小时 r:mile_p_h mi 0 1 h 0 -1 Miles per Hour Miles per Hour Miles per timme 英里每小时 a-cr:mph a-cr:mph mile_p_h 1 1 Acceleration Versnelling Acceleration 加速度 SI Meter per Second Squared Meter per seconde kwadraat Meter per kvadratsekund 米每平方秒 r:m_p_sqs m 0 1 s 0 -2 Galileo Galileo 伽利略 ar:Gal,galileo,p:galileos a:Gal,galileo ar:Gal,galileo,p:galileos m_p_sqs 1/100 1 Gee Gee r:gee,p:gees r:gee,p:gees m_p_sqs 9.80665 1 Magnetism Magnetisme Magnetism 磁学 Wave Number Golfgetal Vågtal 波数 SI Reciprocal Meter Omgekeerde meter Reciproka meter r:recm m 0 -1 Magnetic Field Strength Magnetische veldsterkte Magnetisk fältstyrka 磁场强度 SI Ampere per Meter Ampere per meter Ampere per meter 安培每米 r:A_p_m A 0 1 m 0 -1 CGS Oersted Oersted 奥斯特 ar:Oe,oersted,p:oersteds Oe,oersted,oersteds a:Oe,oersted ar:Oe,oersted,p:oersteds A_p_m 1000/(4*pi) 1 Magnetic Flux Magnetische flux Magnetiskt flöde 磁通量 Volt Seconds Volt seconden Voltsekund 伏特秒 r:V_s V 0 1 s 0 1 SI Weber Weber 韦伯 ar:Wb,weber,p:webers a:Wb,weber ar:Wb,weber,p:webers V_s 1 1 CGS Maxwell Maxwell 麦克斯韦 ar:Mx,maxwell,p:maxwells a:Mx,maxwell ar:Mx,maxwell,p:maxwells Wb 1E-8 1 Magnetic Flux Density Magnetische fluxdichtheid Magnetisk flödestäthet 磁通密度 Weber per Meter Squared Weber per meter kwadraat Weber per kvadratmeter 韦伯每平米 r:Wb_p_sqm Wb 0 1 m 0 -2 SI Tesla Tesla 特斯拉 ar:T,tesla,p:teslas a:T,tesla ar:T,tesla,p:teslas Wb_p_sqm 1 1 CGS Gauss Gauss 高斯 r:gauss r:gauss T 0.0001 1 Force Kracht Kraft 力学 Meter Kilogram per Second Squared Meter kilogram per seconde kwadraat Meterkilogram per kvadratsekund 米千克每平方秒 r:m_kg_p_sqs m 0 1 g 3 1 s 0 -2 SI Newton Newton 牛顿 ar:N,newton,p:newtons a:N,newton ar:N,newton,p:newtons m_kg_p_sqs 1 1 CGS Dyne Dyne 达因 ar:dyn,dyne,p:dynes ar:dyn,dyne,p:dynes N 1E-5 1 Imperial Pound-force Pound-force 磅力 ar:lbf,pound_force ar:lbf,pound_force N 4.4482216152605 1 true Pound Foot per Second Squared Pound Foot per seconde kwadraat Pundfot per kvadratsekund 磅英尺每平方秒 r:lb_ft_p_sqs lb 0 1 ft 0 1 s 0 -2 Imperial Poundal Poundal 磅达 r:poundal,p:poundals,a:pdl r:poundal,p:poundals,a:pdl lb_ft_p_sqs 1 1 Pond (Gram-Force) Pond (gram-kracht) 克力 r:pond,p:ponds,a:gf pond,ponden,gf r:pond,p:ponds,a:gf N 0.00980665 1 Kilopond (Kilogram-Force) Kilopond (Kilogram-kracht) 千克力 r:kpond_c pond 3 1 Moment of Force Krachtmoment Kraftmoment 力矩 SI Newton Meter Newtonmeter Newtonmeter 牛顿米 r:N_m N 0 1 m 0 1 Pressure Druk Tryck 压强 Newton per Meter Squared Newton per vierkante meter Newton per kvadratmeter 牛顿每平米 r:N_p_sqm N 0 1 m 0 -2 Pound-force per Square Inch Pound-force per inch kwadraat Pound-force per kvadrattum 磅力每平方英寸 true r:lbf_p_sqin lbf 0 1 in 0 -2 SI Pascal Pascal 帕斯卡 ar:Pa,pascal,p:pascals a:Pa,pascal ar:Pa,pascal,p:pascals N_p_sqm 1 1 Pound-force per Square Inch (psi) Pound-force per inch kwadraat (psi) Pound-force per kvadrattum (psi) 磅力每平方英寸(psi) a-cr:psi a-cr:psi lbf_p_sqin 1 1 Bar Bar Bar r:bar,p:bars bar r:bar,p:bars Pa 100000 1 Atmosphere Atmosfeer Atmosfär 大气压 ar:atm,atmosphere,p:atmospheres atm,atmosfeer,atmosfeer a:atm,atmosfär,p:atmosfärer ar:atm,atmosphere,p:atmospheres Pa 101325 1 Torr Torr r:torr,p:torrs r:torr,p:torrs atm 1/760 1 Millimeter of Mercury Milimeter kwik Millimeter kvicksilver 毫米汞柱 ar:mmHg ar:mmHg atm 1/760 1 Inch of Mercury Inches kwik Fot kvicksilver 英寸汞柱 ar:inHg ar:inHg mmHg 25.4 1 Dynamic Viscosity Dynamische viscositeit Dynamisk viskositet 动态粘度 SI Pascal Second Pascal seconde Pascalsekund 帕斯卡秒 r:Pa_s Pa 0 1 s 0 1 CGS Poise Poise ar:P,poise,p:poises a:P,poise ar:P,poise,p:poises Pa_s 0.1 1 Kinematic Viscosity Kinematische viscositeit Kinematisk viskositet 运动粘度 Square Meter per Second Vierkante meter per seconde Kvadratmeter per sekund 平方米每秒 r:sqm_p_s m 0 2 s 0 -1 CGS Stokes Stokes ar:St,stokes ar:St,stokes sqm_p_s 0.0001 1 Surface Tension Oppervlaktespanning Ytspänning 表面张力 SI Newton per Meter Newton per meter Newton per meter 牛顿每米 r:N_p_m N 0 1 m 0 -1 Energy Energie Energi 能量 SI Joule Joule 焦耳 ar:J,joule,p:joules a:J,joule ar:J,joule,p:joules N_m 1 1 Watt Hour Wattuur Watttimme 瓦小时 r:W_h W 0 1 h 0 1 Kilowatt Hour Kilowattuur Kilowatttimme 度(千瓦时) r:W_h W 3 1 h 0 1 Calorie (international table) Calorie (internationale tabel) Kalorier (international table) ais:cal_IT,ar:cal,c:calorie,cp:calories cal_IT,cal,calorie,calorieën ais:cal_IT,a:cal,c:kalori,cp:kalorier ais:cal_IT,ar:cal,c:calorie,cp:calories J 4.1868 1 Calorie (capital C) Calorie (hoofdletter C) Kalorier (med stort K) cr:Calorie,cp:Calories Calorie,Calorieën cr:Calorie,cp:Calories cal 1000 1 Calorie (thermochemical) Calorie (thermochemisch) Kalorier (termokemiska) ars:cal_th cal_th ars:cal_th J 4.184 1 Gram of TNT Gram TNT Gram TNT 克TNT当量 a-cr:gTNT,gramTNT a-cr:gTNT,gramTNT cal_th 1000 1 Ton of TNT Ton TNT Ton TNT 吨TNT当量 a-cr:tTNT,tonTNT a-cr:tTNT,tonTNT gTNT 1000000 1 Calorie (15 degrees Celcius) Calorie (15 graden Celcius) Kalorier (15 grader Celcius) Calorie(15摄氏度) ars:cal_fifteen cal_fifteen as:cal_femton ars:cal_fifteen J 4.185880 1 Calorie (mean) Calorie (gemiddeld) Kalorier (medel) ars:cal_mean cal_gemiddeld as:cal_medel ars:cal_mean J 4.19002 1 British Thermal Unit (IT) British Thermal Unit (IT) 英制热量单位(IT) ar:Btu ar:Btu J 1055.056 1 Electron Volt Elektronvolt Elektronvolt 电子伏特 ar:eV,electron_volt,p:electron_volts a:eV,elektronvolt ar:eV,electron_volt,p:electron_volts J 1.602177E-19 1 CGS Erg Erg r:erg,p:ergs r:erg,p:ergs J 1E-7 1 Foe Foe r:foe,p:foes r:foe,p:foes erg 1E51 1 Imperial Foot-Pound Force Foot-Pound Force r:ft_lbf ft 0 1 lbf 0 1 Specific Energy Soortelijke energie Specifik energi SI Joule per Kilogram Joule per kilogram Joule per kilogram 焦耳每千克 r:J_p_kg J 0 1 g 3 -1 Power Vermogen Effekt 功率 Joule per Second Joule per seconde Joule per sekund 焦耳每秒 r:J_p_s J 0 1 s 0 -1 SI Watt Watt ar:W,watt,p:watts a:W,watt ar:W,watt,p:watts J_p_s 1 1 Horse Power Paardekracht (Engels) Hästkraft ar:hp,horsepower,p:horsepowers a:hp,hästkraft,p:hästkrafter ar:hp,horsepower,p:horsepowers W 745.699987158227022 1 Pferdestärke Paardekracht (metrisch) ar:PS,u:pferdestärke pk,paardekracht,paardekrachten ar:PS,u:pferdestärke W 735.49875 1 Entropy Entropie Entropi SI Joule per Kelvin Joule per Kelvin Joule per Kelvin 焦耳每开尔文 r:J_p_K J 0 1 K 0 -1 Specific Entropy Soortelijke entropie Specifik entropi SI Joule per Kilogram Kelvin Joule per kilogram Kelvin Joule per kilogram kelvin 焦耳每千克开尔文 r:J_p_kg_K J 0 1 g 3 -1 K 0 -1 Thermal Conductivity Thermisch geleidingsvermogen Termisk konduktivitet 导热系数 SI Watt per Meter Kelvin Watt per meter Kelvin Watt per meter kelvin 瓦每米开尔文 r:W_p_m_K W 0 1 m 0 -1 K 0 -1 Energy Density Energiedichtheid Energitäthet 能量密度 SI Joule per Cubic Meter Joule per kubieke meter Joule per kubikmeter 焦耳每立方米 r:J_p_cum J 0 1 m 0 -3 Molar Energy Molaire energie Molarenergi SI Joule per Mole Joule per mol Joule per mol 焦耳每摩尔 r:J_p_mol J 0 1 mol 0 -1 Molar Entropy Molaire entropy Molarentropi 摩尔熵 SI Joule per Mole Kelvin Joule per mol Kelvin Joule per mol kelvin 焦耳每摩尔开尔文 r:J_p_mol_K J 0 1 mol 0 -1 K 0 -1 Radioactivity Radioactiviteit Radioaktivitet 放射性 SI Becquerel Becquerel Becquerel 贝可 ar:Bq,becquerel,p:becquerels a:Bq,becquerel ar:Bq,becquerel,p:becquerels s 1 -1 Curie Curie 居里 ar:Ci,curie,p:curies a:Ci,curie ar:Ci,curie,p:curies Bq 3.7E10 1 Absorbed Dose Absorptiedosis Absorberad dos 吸收剂量 SI Gray Gray 戈瑞 ar:Gy,gray,p:grays a:Gy,gray ar:Gy,gray,p:grays J_p_kg 1 1 Rad Rad Rad r:rad_radioactivity rad_radioaktivitet r:rad_radioactivity Gy 1/100 1 Dose Equivalent Dosisequivalent Dosekvivalent 剂量当量 SI Sievert Sievert ar:Sv,sievert,p:sieverts a:Sv,sievert ar:Sv,sievert,p:sieverts J_p_kg 1 1 Rem Rem 人体伦琴当量 r:rem_radioactivity rem_radioaktivitet r:rem_radioactivity Sv 1/100 1 Exposure Belichting Exponering 照射量 SI Coulomb per Kilogram Coulomb per kilogram Coloumb per kilogram 库仑每千克 r:C_p_kg C 0 1 g 3 -1 Roentgen Roentgen Röntgen 伦琴 ar:R,roentgen,p:roentgens a:R,roentgen ar:R,roentgen,p:roentgens C_p_kg 0.000258 1 Absorbed Dose Rate Absorptiesnelheid Absorberad dosrat 剂量吸收率 SI Gray per Second Gray per seconde Gray per sekund 戈瑞每秒 r:Gy_p_s Gy 0 1 s 0 -1 Ratio Verhouding 比值 Neper Neper 奈培 ar:Np,neper,p:nepers a:Np,neper ar:Np,neper,p:nepers Bel Bel ar:B,bel,p:bels a:B,bel ar:B,bel,p:bels Np 0.5*ln(10) 1 Decibel Decibel 分贝 r:dB_c B -1 1 Information Informatie 信息 Bit Bit Bit 比特 r:bit,p:bits bit,p:bitar r:bit,p:bits Byte (8-bit) Byte (8-bit) Byte (8-bit) 字节(8比特) r:byte,p:bytes,octet,p:octets byte,oktet r:byte,p:bytes,octet,p:octets bit 8 1 Nibble Nibble 半字节 r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets bit 4 1 Tribble Tribble r:tribble,p:tribbles r:tribble,p:tribbles nibble 3 1 Word (16-bit) Word (16-bit) 字(16比特) r:word,p:words woord,woorden r:word,p:words bit 16 1 Kilobyte Kilobyte 千字节 r:kbyte_c byte 3 1 Kibibyte Kibibyte r:Kibyte_c byte 10 1 Mebibyte Mebibyte r:Mibyte_c byte 20 1 Gibibyte Gibibyte r:Gibyte_c byte 30 1 Megabyte Megabyte 兆字节 r:Mbyte_c byte 6 1 Gigabyte Gigabyte 千兆比特 r:Gbyte_c byte 9 1 Terabyte Terabyte 万亿字节 r:Tbyte_c byte 12 1 Kilobit Kilobit 千比特 r:kbit_c bit 3 1 Kibibit Kibibit r:Kibit_c bit 10 1 Mebibit Mebibit r:Mibit_c bit 20 1 Gibibit Gibibit r:Gibit_c bit 30 1 Megabit Megabit 兆比特 r:Mbit_c bit 6 1 Gigabit Gigabit 千兆比特 r:Gbit_c bit 9 1 Terabit Terabit 万亿比特 r:Tbit_c bit 12 1 Typography Typografie Typografi 印刷 PostScript Point PostScript Point ar:pt,a:pts,point,p:points punkt,point,p:punkter,p:points ar:pt,a:pts,point,p:points in 1/72 1 PostScript Pica PostScript Pica r:pica,p:picas r:pica,p:picas pt 12 1 ATA Pica ATA Pica r:ata_pica,p:ata_picas r:ata_pica,p:ata_picas in 0.166 1 ATA Point ATA Point r:ata_point,a:ata_pt,p:ata_points r:ata_point,a:ata_pt,p:ata_points ata_pica 1/12 1 New Didot Point Nieuwe Didot Point r:new_didot nieuwe_didot r:new_didot m 0.000375 1 Didot Point Didot Point r:didot,a:dd r:didot,a:dd pouce 1/72 1 Cicero Cicero r:cicero r:cicero didot 12 1 libqalculate-0.9.7/data/Makefile.in0000644000175100017510000002745111320655032014100 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ # # data/Makefile.am for qalculate # VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = data DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = 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)$(xmldir)" xmlDATA_INSTALL = $(INSTALL_DATA) DATA = $(xml_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_CPPFLAGS = @CLN_CPPFLAGS@ CLN_LIBS = @CLN_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@ INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@ INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@ INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@ INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@ INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@ INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@ INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@ INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@ INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@ INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@ INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@ INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NMEDIT = @NMEDIT@ 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@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ xmldir = $(datadir)/qalculate xml_in_files = currencies.xml.in datasets.xml.in elements.xml.in functions.xml.in planets.xml.in prefixes.xml.in units.xml.in variables.xml.in xml_DATA = $(xml_in_files:.xml.in=.xml) EXTRA_DIST = \ $(xml_in_files) $(xml_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 data/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu data/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-xmlDATA: $(xml_DATA) @$(NORMAL_INSTALL) test -z "$(xmldir)" || $(MKDIR_P) "$(DESTDIR)$(xmldir)" @list='$(xml_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(xmlDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(xmldir)/$$f'"; \ $(xmlDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(xmldir)/$$f"; \ done uninstall-xmlDATA: @$(NORMAL_UNINSTALL) @list='$(xml_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(xmldir)/$$f'"; \ rm -f "$(DESTDIR)$(xmldir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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 $(DATA) installdirs: for dir in "$(DESTDIR)$(xmldir)"; 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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-xmlDATA install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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-xmlDATA .MAKE: install-am install-strip .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-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ install-xmlDATA installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-xmlDATA @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ # 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: libqalculate-0.9.7/data/functions.xml0000644000175100017510000115510311320655051014563 00000000000000 Matrices & Vectors Matrices & vectoren Matriser & Vektorer 矩阵与向量 Construct Vector Vector construeren Skapa vektor 构造向量 r:vector vektor r:vector Returns a vector with listed elements. Retourneert een vector met de opgegeven elementen. Returnerar en vektor med listade element. 使用列出的元素生成一个向量并返回。 Elements Elementen Element 多个元素 Generate Vector Vector aanmaken Skapa vektor 生成向量 r:genvector r:genvector Returns a vector generated from a function with a variable (default x) running from min to max. The fourth argument is either the requested number of elements if the sixth argument is false (default) or the step between each value of the variable. Berekent een vector met behulp van een functie waarvan de variabele (standaard x) waarden krijgt tussen min en max. Het vierde argument is of het vereiste aantal elementen indien het zesde argument onwaar is (standaard) of de stapgrootte tussen elke waarde van de variabele. Returnerar en vektor skapad från en funktion med en variabel (förvald: x) som går från min till max. Den fjärde parametern är antingen det efterfrågade antalet element, om det sjätte argumentet är falskt (förvalt), eller steget mellan varje värde för variabeln. 根据指定的自变量(缺省为x)和数据范围,用指定函数的值生成一个向量并返回。如果第六个参数是假(缺省值),则第四个参数表示需要的元素个数;否则,第四个 参数表示变量每个值之间的步长。 Function Functie Funktion 函数 Min Min Min 最小值 Max Max Max 最大值 Dimension / Step size Dimensie / stapgrootte Dimension / stegstorlek 维数/步长 Variable Variabele Variabel 变量 Use step size Stapgrootte gebruiken Använd stegstorlek 使用步长 Sort Sorteren Sortera 排序 r:sort sorteren sortera r:sort Returns a sorted vector. ex. sort([6, 1, 4])=[1, 4, 6] Retourneert een gesorteerde vector. bv. sort([6, 1, 4])=[1, 4, 6] Returnerar en sorterad vektor. t ex sort([6, 1, 4])=[1, 4, 6] 对向量排序后返回。 例如, sort([6, 1, 4])=[1, 4, 6] Vector Vector Vektor 向量 Ascending Oplopend Stigande 升序 Rank Rangorde Rangordna r:rank rangorde rangordna r:rank Returns a vector with values of elements replaced with their mutual ranks. ex. rank([6, 1, 4]) = [3, 1, 2] Retourneert een vector waarin de elementen zijn vervangen door hun onderlinge rangorde. bv. rank([6, 1, 4]) = [3, 1, 2] (6 staat op de 3de plaats in de gesorteerde vector, 1 op de 1ste en 4 op de 2de plaats) Returnerar en vektor med elementens värden ersatta av deras inbördes rangordning. t ex rank([6, 1, 4]) = [3, 1, 2] Vector Vector Vektor 向量 Ascending Oplopend Stigande 升序 Vector Limits Vectorgrenzen Vektorgränser 向量限 r:limits grenzen gränser r:limits Returns a part of a vector between two positions. Retourneert een deel van een vector tussen twee posities. Returnerar en del av en vektor mellan två positioner. 返回一个向量两个位置之间的一部分。 Vector Vector Vektor 向量 Lower limit Ondergrens Undre gräns 下限 Upper limit Bovengrens Övre gräns 上限 Dimension Dimensie Dimension 维数 r:dimension dimensie r:dimension Returns the number of elements in a vector. Retourneert het aantal elementen in een vector. Returnerar antalet element i en vektor. 返回一个向量内的元素数量。 Vector Vector Vektor 向量 Merge Vectors Vectoren samenvoegen Sammanslå vektorer 合并向量 r:mergevectors vectorensamenvoegen r:mergevectors Returns a vector with the elements from two vectors. Retourneert een vector met de elementen van twee vectoren. Returnerar en vektor med element från två vektorer. 将两个向量合成一个并返回。 Vector 1 Vector 1 Vektor 1 向量1 Vector 2 Vector 2 Vektor 2 向量2 Construct Matrix Matrix construeren Skapa matris 构造矩阵 r:matrix matris r:matrix Returns a matrix with specified dimensions and listed elements. Omitted elements are set to zero. Retourneert een matrix met opgegeven dimensies en gegeven elementen. Weggelaten elementen worden op nul gesteld. Returnerar en matris med specifierat antal rader och kolumner, och angivna element. Utelämnade element sätts till noll. 根据指定的维数和列出的元素返回一个矩阵。省略被设为零的元素。 Rows Rijen Rader Columns Kolommen Kolumner Elements Elementen Element 多个元素 Convert Matrix to Vector Matrix naar vector converteren Omvandla matris till vektor 将矩阵转换为向量 r:matrix2vector r:matrix2vector Puts each element of a matrix in vertical order in a vector. Ieder element van een matrix wordt in verticale volgorde in een vector geplaatst. Placerar varje element i en matris i vertikal ordning i en vektor. 将按照垂直顺序将矩阵中的每个元素放到向量中。 Matrix Matrix Matris 矩阵 Matrix Area Matrixbereik Matrisarea 子矩阵 r:area oppervlak r:area Returns a part of a matrix. Retourneert een deel van een matrix. Returnerar en del av en matris. 返回矩阵的一部分。 Matrix Matrix Matris 矩阵 Start row Startrij Startrad 起始行 Start column Startkolom Startkolumn 起始列 End row Einde rij Slutrad 结束行 End column Einde kolom Slutkolumn 结束列 Rows Rijen Rader r:rows rijen rader r:rows Returns the number of rows in a matrix. Retourneert het aantal rijen in een matrix. Returnerar antalet rader i en matris. 返回矩阵中的行数。 Matrix Matrix Matris 矩阵 Columns Kolommen Kolumner r:columns kolommen kolumner r:columns Returns the number of columns in a matrix. Retourneert het aantal kolommen in een matrix. Returner antalet kolumner i en matris. 返回矩阵的列数。 Matrix Matrix Matris 矩阵 Extract row as vector Rij als vector uit (matrix) halen Skapa vektor från rad 将行提取为向量 r:row rij rad r:row Returns a row in a matrix as a vector. Retourneert een rij in een matrix als een vector. Returnerar en rad i en matris som en vektor. 将矩阵的一行作为向量返回。 Matrix Matrix Matris 矩阵 Row Rij Rad Extract Column as Vector Kolom als vector uit (matrix) halen Extrahera kolumn som vektor 将列提取为向量 r:column kolom kolumn r:column Returns a column in a matrix as a vector. Retourneert een kolom van een matrix als een vector. Returnerar en kolumn i en matris som en vektor. 将矩阵的一列作为向量返回。 Matrix Matrix Matris 矩阵 Column Kolom Kolumn Elements Elementen Element 多个元素 r:elements elementen r:elements Returns the number of elements in a matrix or vector. Retourneert het aantal elementen in een matrix of vector. Returnerar antalet element i en matris eller vektor. 返回一个矩阵或向量内的元素数目。 Matrix or vector Matrix of vector Matris eller vektor 矩阵或向量 Element Element Element 一个元素 r:element r:element Returns the element at specified position in a matrix (row and column) or vector (index). Retourneert het element op de opgegeven positie in een matrix (rij en kolom) of vector (index). Returnerar elementet på angiven position i en matris (rad och kolumn) eller en vektor (index). 返回矩阵(行和列)或向量(下标)指定位置上的元素。 Matrix/vector Matrix/vector Matris/vektor 矩阵/向量 Row/index Rij/Index Rad/index 行/下标 Column Kolom Kolumn Transpose Transponeren Transponera 转置 r:transpose transponeren transponera r:transpose Returns the transpose of a matrix. Retourneert de getransponeerde van een matrix. Returnerar transponeringen av en matris. 返回矩阵的转置。 Matrix Matrix Matris 矩阵 Identity Identiteit Identitetsmatris 单位矩阵 r:identity identiteit identitetsmatris r:identity Returns the identity matrix of a matrix or with specified number of rows/columns. Retourneert de eenheidsmatrix bij een matrix of met een opgegeven aantal rijen/kolommen. Returnerar identitetsmatrisen för en matris eller med angivet antal rader/kolumner. 返回指定行/列数或与指定矩阵同阶的单位矩阵。 Matrix or rows/columns Matrix of rijen/kolommen Matris eller rader/kolumner 矩阵或行/列 Determinant Determinant Determinanten 行列式 r:det r:det Calculates the determinant of a matrix. Berekent de determinant van een matrix. Beräknar determinanten för en matris. 计算矩阵的行列式。 Matrix Matrix Matris 矩阵 Permanent Permanent Permanent 积和式 r:permanent r:permanent Calculates the permanent of a matrix. The permanent differs from a determinant in that all signs in the expansion by minors are taken as positive. Berekent de permanent van een matrix. Het verschil met de determinant is dat alle subdeterminanten met +1 worden vermenigvuldigd, en bij de determinant om en om met +1 en met -1. Beräknar permanenten av en matris. Permanenten skiljer sig från en determinant genom att alla tecken i expansionen sätts som positiva. 计算矩阵的积和式。积和式与行列式的不同之处在于,在展开时,所有展开式前面的符号都为正。 Matrix Matrix Matris 矩阵 Adjugate (Adjoint) Aangrenzend 伴随矩阵 r:adj r:adj Calculates the adjugate or adjoint of a matrix. Berekent de geadjungeerde matrix. 计算矩阵的伴随矩阵 Matrix Matrix Matris 矩阵 Cofactor Cofactor Kofaktor 余因子 r:cofactor kofaktor r:cofactor Calculates the cofactor of the element at specified position. Berekent de cofactor van het element op de opgegeven positie. Beräknar kofaktorn för elementet på angiven position 计算指定位置元素的余因子。 Matrix Matrix Matris 矩阵 Row Rij Rad Column Kolom Kolumn Matrix Inverse Inverse matrix Matrisinvers 求逆矩阵 r:inverse invers r:inverse Calculates the inverse of a matrix. The inverse is the matrix that multiplied by the original matrix equals the identity matrix (AB = BA = I). Retourneert de inverse van een matrix. De inverse matrix is de matrix die, vermenigvuldigd met de originele matrix, de eenheidsmatrix geeft (AB = BA = E). Beräknar inversen av en matris. Inversen är den matrix som multiplicerad med den ursprungliga matrisen är lika med identitetsmatrisen (AB = BA = I). 计算矩阵的逆。矩阵的逆是一个与原矩阵相乘等于单位矩阵的矩阵。(AB = BA = I)。 Matrix Matrix Matris 矩阵 Load CSV File Inlezen CSV-bestand Ladda CSV-fil 载入CSV文件 r:load lees ladda r:load Returns a matrix imported from a CSV data file. Retourneert een matrix, geïmporteerd uit een CSV-gegevensbestand. Returnerar en matris importerad från en CSV-datafil. 返回从CSV数据文件导入的矩阵 Filename Bestandsnaam Filnamn 文件名 First data row Eerste gegevensrij Första raden med data 第一行数据 Separator Scheidingsteken Avskiljare 分隔符 Export To CSV File Exporteren naar CSV-bestand Exportera till CSV-fil 导出到CSV文件 r:export exporteren exportera r:export Exports a matrix to a CSV data file. Exporteert een matrix naar een CSV-gegevensbestand. Exporterar en matris till en CSV-datafil 将矩阵导出到CSV数据文件 Matrix/vector Matrix/vector Matris/vektor 矩阵/向量 Filename Bestandsnaam Filnamn 文件名 Separator Scheidingsteken Avskiljare 分隔符 Norm (length) Norm (lengte) Normal 范数(长度) r:norm r:norm Calculates the norm/length of a vector. Berekent de norm/lengte van een vector. Beräknar normalen för en vektor. 计算向量的范数/长度。 abs((\x*\x)^(1/2)) Vector Vector Vektor 向量 false Cross Product Uitproduct Vektoriell produkt 向量积 r:cross uitproduct vektoriell r:cross Calculates the cross product of two 3-dimensional vectors. Berekent het uitproduct van twee 3-dimensionale vectoren. Beräknar den vektoriella produkten för två 3-dimensionella vektorer. 计算两个三维向量的向量积 [(element(\x,2)*element(\y,3))-(element(\x,3)*element(\y,2)),(element(\x,3)*element(\y,1))-(element(\x,1)*element(\y,3)),(element(\x,1)*element(\y,2))-(element(\x,2)*element(\y,1))] Vector 1 Vector 1 Vektor 1 向量1 dimension(\x)==3 Vector 2 Vector 2 Vektor 2 向量2 dimension(\x)==3 Combinatorics Combinatoriek Kombinatorik 组合学 Factorial Faculteit Fakultet 阶乘 Calculates the factorial of an integer. Mulitplies the argument with every lesser positive integer (n(n-1)(n-2)...2*1). Can also be entered as a number followed by one exclamation mark. ex. factorial(5) = 5! = 5 * 4 * 3 * 2 * 1 = 120 Berekent de faculteit van een positief geheel getal n: (n(n-1)(n-2)... *2*1. Kan ook worden ingevoerd als een positief geheel getal, gevolgd door een uitroepteken. bv. factorial(5) = 5! = 5 * 4 * 3 * 2 * 1 = 120 Beräknar fakulteten för ett heltal. Multiplicerar parametern med varje mindre positivt heltal (n(n-1)(n-2)...2*1). Kan också skrivas som ett nummer följt av ett utropstecken. t ex factorial(5) = 5! = 5 * 4 * 3 * 2 * 1 = 120 计算整数的阶乘,即n(n-1)(n-2)...2*1。也可以用整数后面跟一个"!"来 表示。 例如,factorial(5) = 5! = 5 * 4 * 3 * 2 * 1 = 120 r:factorial faculteit fakultet r:factorial Value Waarde Värde Double Factorial Dubbele faculteit Dubbelfakultet 双阶乘 r:factorial2 faculteit2 fakultet2 r:factorial2 Calculates the doublefactorial of an integer. Mulitplies the argument with every second lesser positive integer (n(n-2)(n-4)...). Can also be entered as a number followed by two exclamation marks. ex. factorial2(5) = 5!! = 5 * 3 * 1 = 15 Berekent de dubbelfaculteit van een positief geheel getal n: (n(n-2)(n-4)... Kan ook worden ingevoerd als een positief geheel getal, gevolgd door twee uitroeptekens. bv. factorial2(5) = 5!! = 5 * 3 * 1 = 15 Beräknar dubbelfakulteten för ett heltal. Multiplicerar parametern med varannan mindre positivt heltal (n(n-2)(n-4)...). Kan också skrivas som ett nummer följt av två utropstecken. t ex factorial2(5) = 5!! = 5 * 3 * 1 = 15 计算整数的双阶乘。即n(n-2)(n-4)....。也可以用整数后面连输两个"!"来 表示。 例如,factorial2(5) = 5!! = 5 * 3 * 1 = 15 Value Waarde Värde Multifactorial Multifaculteit Multifakultet 多阶乘 r:multifactorial multifaculteit multifakultet r:multifactorial Calculates the multifactorial of an integer. Mulitplies the argument with every x lesser positive integer (n(n-x)(n-2x)...). Can also be entered as a number followed by three or more exclamation marks. ex. multifactorial(18, 4) = 18!!!! = 18 * 14 * 10 * 6 * 2 = 30 240 Berekent de multifaculteit van een positief geheel getal n: (n(n-x)(n-2x)...). Kan ook worden ingevoerd als een positief geheel getal gevolgd door drie of meer uitroeptekens. bv. multifactorial(18, 4) = 18!!!! = 18 * 14 * 10 * 6 * 2 = 30 240 Beräknar multifakulteten för ett heltal. Multiplicerar parametern med varje x mindre positivt heltal (n(n-x)(n-2x)...). Kan också skrivas som ett nummer följt av tre eller fler utropstecken. t ex multifactorial(18, 4) = 18!!!! = 18 * 14 * 10 * 6 * 2 = 30 240 计算整数的多阶乘,即n(n-x)(n-2x)...。也可以用在整数后面跟三个或多个"!"来表示。 例如,multifactorial(18, 4) = 18!!!! = 18 * 14 * 10 * 6 * 2 = 30240 Value Waarde Värde Factorial Faculteit Fakultet 阶乘 Binomial Coefficient Binomiaalcoëfficiënt Binomial koefficient 二项式系数 r:binomial binomiaal r:binomial Exponent Exponent Exponent 指数 Index Index Index 下标 Hyperfactorial Hyperfaculteit Hyperfakultet hyper阶乘 r:hyperfactorial hyperfaculteit hyperfakultet r:hyperfactorial product(x^x,1,\x,x) Calculates the hyperfactorial of an integer. Mulitplies the argument raised by itself with every lesser positive integer raised by themselves (1^1 * 2^2 ... n^n). ex. hyperfactorial(3) = (3^3) * (2^2) * (1^1) = 108 Berekent de hyperfaculteit van een positief geheel getal n: (n^n*(n-1)^(n-1)...*2^2*1^1. bv. hyperfactorial(3) = (3^3) * (2^2) * (1^1) = 27*4*1 = 108 Beräknar hyperfakulteten för ett heltal. Multiplicerar parametern upphöjt med varje mindre positivt heltal upphöjt dem själva(1^1 * 2^2 ... n^n). t ex hyperfactorial(3) = (3^3) * (2^2) * (1^1) = 108 计算整数的hyper阶乘,即(1^1 * 2^2 ... n^n)。 例如,hyperfactorial(3) = (3^3) * (2^2) * (1^1) = 108 Value Waarde Värde 1 Superfactorial Superfaculteit Superfakultet 超级阶乘 r:superfactorial superfaculteit superfakultet r:superfactorial product(factorial(x),0,\x,x) Calculates the superfactorial of an integer. Mulitplies the factorial of the argument with the factorial of every lesser positive integer (1! * 2! ... n!). ex. superfactorial(5) = 5! * 4! * 3! * 2! * 1! = 34 560 Berekent de superfaculteit van een positief geheel getal n: (n!*(n-1)!...*2!*1! bv. superfactorial(5) = 5! * 4! * 3! * 2! * 1! = 120 * 24 * 6 * 2 * 1 =34 560 Beräknar superfakulteten för ett heltal. Mulitplicerar fakulteten av parametern med fakulteten för varje mindre positivt heltal (1! * 2! ... n!). t ex superfactorial(5) = 5! * 4! * 3! * 2! * 1! = 34 560 计算整数的超级阶乘,即1! * 2! ... n!。 例如, superfactorial(5) = 5! * 4! * 3! * 2! * 1! = 34560 Value Waarde Värde 0 Permutations (Variations) Permutaties (Variaties) Permutationer (Variationer) 排列 r:perm,variations perm,variaties variationer r:perm,variations \x!/(\x-\y)! Returns the number of possible arrangements of an ordered list with a number of objects to choose from and a list size. If there are three objects (1, 2 and 3) that is put in a list with two positions, the alternatives are [1, 2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2], and thus the number of permutations is 6. Retourneert op hoeveel manieren een bepaald aantal objecten op een geordende manier kunnen worden gekozen uit een verzameling van (verschillende) objecten. Stel er zijn drie objecten (1, 2, en 3) waarvan er twee moeten worden gekozen in een geordende lijst, dan zijn de mogelijkheden [1, 2], [2, 1], [1, 3], [3, 1], [2, 3] en [3, 2], en is het aantal permutaties dus 6. Returnerar antalet möjliga arrangemang av en ordnad lista med ett antal objekt att välja mellan och en liststorlek. Om det finns tre olika objekt (1, 2 och 3) som sätts i en lista med två positioner, då är möjliga alternativ [1, 2], [2, 1], [1, 3], [3, 1], [2, 3] och [3, 2], och därmed är antalet permutationer 6. 返回排列数,即从包含指定数量对象的集合中选择指定数量个元素生成有序列表,所能生成 的所有不同有序列表的个数。例如,如果集合中有三个元素(1,2和3),从中任选两个元素生成 有序列表,可能的列表为[1, 2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2],因此排列数为6。 Objects Objecten Objekt 对象个数 Size Grootte Storlek 大小 Combinations Combinaties Kombinationer 组合 r:comb kam kombinationer r:comb \x!/(\y!*(\x-\y)!) Returns the number of possible arrangements of an unordered list with a number of objects to choose from and a list size. If there are three objects (1, 2 and 3) that is put in a list with place for two, the alternatives are [1, 2], [1, 3], and [2, 3], and thus the number of combinations is 3. Retourneert op hoeveel manieren een bepaald aantal objecten op een niet geordende manier kunnen worden gekozen uit een verzameling van (verschillende) objecten. Stel er zijn drie objecten (1, 2, en 3) waarvan er twee moeten worden gekozen in een niet geordende lijst, dan zijn de mogelijkheden [1, 2], [1, 3] en [2, 3], en is het aantal combinaties dus 6. Returnerar antalet möjliga arrangemang av en oordnad lista med ett antal objekt att välja mellan och en liststorlek. Om det finns tre olika objekt (1, 2 och 3) som sätts i en lista med plats för två, då är möjliga alternativ [1, 2], [1, 3], och [2, 3], och därmed är antalet kombinationer 3. 返回组合数,即从包含指定数量对象的集合中选择指定数量个元素生成无序列表,所能生成 的所有不同无序列表的个数。例如,如果集合中有三个元素(1,2和3),从中任选两个元素生成 有序列表,可能的列表为[1, 2], [1, 3], and [2, 3],因此组合数为3。 Objects Objecten Objekt 对象个数 Size Grootte Storlek 大小 Derangements Derangementen 重排数 r:derangements derangementen r:derangements Returns the number of possible rearrangements of an ordered list, of a certain size, where none of the objects are on their original position. If the original list is [1, 2, 3], the possible derangements is [2, 3, 1] and [3, 1, 2], and thus the number of derangements is 2. Retourneert op hoeveel manieren een geordende lijst van objecten zo kan worden herschikt dat geen der objecten op zijn oorspronkelijke posite terecht komt. Indien de oorspronkelijke lijst [1, 2, 3] is, zijn de mogelijke herschikkingen [2, 3, 1] en [3, 1, 2], en is het aantal mogelijke herschikkingen dus 2. Returnerar antalet möjliga omarrangemang av en ordnad lista, med en viss storlek, där inget av objekten är på sin ursprungliga position. Om den ursprungliga listan är [1, 2, 3], då är de möjliga omarrangemangent [2, 3, 1] och [3, 1, 2], och därmed returneras 2. 返回重排数,即对给定列表中的元素重新排列,并且限定每个元素都不能在原来的位置 上,所得的列表数量。例如,如果原始列表为[1,2,3],则可能的重排列表为[2, 3, 1]和[3, 1, 2]。因此重排数为2。 factorial(\x)*sum(((-1)^"i")/factorial("i"),0,\x,"i") Number of elements Aantal elementen Antal element 元素个数 1 Number Theory Getallentheorie Nummerteori 数论 Absolute Value Absolute waarde Absolut värde 绝对值 r:abs r:abs Value Waarde Värde Arithmetics Rekenen Aritmetik 算术 Signum Signum Sigma 符号函数 r:sgn r:sgn Number Nummer Nummer 数字 Numerator Teller Täljare 分子 r:numerator noemer täljare r:numerator Number Nummer Nummer 数字 Denominator Noemer Nämnare 分母 r:denominator noemer nämnare r:denominator Number Nummer Nummer 数字 Remainder Rest Rest 余数 r:rem r:rem Numerator Teller Täljare 分子 Denominator Noemer Nämnare 分母 Modulus Modulus Modulus r:mod . r:mod Numerator Teller Täljare 分子 Denominator Noemer Nämnare 分母 Negate Ander teken Negera r:neg anderteken r:neg -\x Value Waarde Värde Reciprocal Omgekeerde waarde (x naar 1/x) Reciprok 倒数 r:inv r:inv \x^(-1) Value Waarde Värde Multiply Vermenigvuldigen Multiplicera r:multiply vermenigvuldigen multiplicera r:multiply product(element(\x,"x"),1,dimension(\x),"x") Factors Factoren Faktorer 因子 Add Optellen Addera r:add optellen addera r:add total(\x) Terms Termen Termer Subtract Aftrekken Subtrahera r:subtract aftrekken subtrahera r:subtract csum(2,-1,element(\x,1),"y"-"x","x","y",\x) Terms Termen Termer Divide Delen Dela r:divide delen dela r:divide \x/\y Numerator Teller Täljare 分子 Denominator Noemer Nämnare 分母 Raise Machtverheffen Upphöj 乘方 r:raise machtverheffen upphöj r:raise \x^\y Base Grondtal Bas 基/底 Exponent Exponent Exponent 指数 Polynomials Polynomen (veeltermen) Polynomer 多项式 Coefficient Coëfficiënt Koefficient 系数 r:coeff r:coeff Polynomial Polynoom (veelterm) Polynom 多项式 Number Nummer Nummer 数字 Variable Variabele Variabel 变量 Leading Coefficient Eerste coëfficiënt Ledande koefficient 首项系数 r:lcoeff r:lcoeff Polynomial Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Trailing Coefficient Laatste coëfficiënt Avslutande koefficient 末项系数 r:tcoeff r:tcoeff Polynomial Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Polynomial Degree Graad van polynoom (veelterm) Polynomgrad 多项式次数 r:degree graad grad r:degree Polynomial Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Lowest Degree (Valuation) Laagste graad (waardebepaling) Lägsta grad (valuering) 末项次数(估计) r:ldegree lgraad r:ldegree Polynomial Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Content Part Inhoudgedeelte Innehållsdel 常数公因子 r:pcontent pinhoud r:pcontent Polynomial Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Primitive Part Primitieve deel Primitiv del 原始部分 r:primpart r:primpart Polynomial Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Unit Part Eenheidsgedeelte Enhetsdel 单位部分 r:punit peenheid r:punit Polynomial Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Greatest Common Divisor Grootste gemene deler Största gemensamma divisor 最大公约数 r:gcd ggd r:gcd 1st value 1e waarde 1:a värdet 值1 2nd value 2de waarde 2:a värdet 值2 Least Common Multiplier Kleinste gemene veelvoud Minsta gemensamma multiplikator 最小公倍数 r:lcm kgv r:lcm 1st value 1e waarde 1:a värdet 值1 2nd value 2de waarde 2:a värdet 值2 Rounding Afronding Avrundning 取整 Round Afronden Avrunda 取整 r:round afronden avrunda r:round Value Waarde Värde Round Downwards Naar beneden afronden Avrunda neråt 向下取整 r:floor golv r:floor Value Waarde Värde Round Upwards Naar boven afronden Avrunda uppåt 向上取整 r:ceil tak r:ceil Value Waarde Värde Round Towards Zero Afronden in de richting van nul Avrunda mot noll 向零取整 r:trunc afkap r:trunc Value Waarde Värde Extract Integer Part Gehele deel uit (getal) halen Extrahera heltal 提取整数部分 r:int r:int Value Waarde Värde Extract Fractional Part Fractionele deel uit (getal) halen Extrahera bråkdel 提取分数部分 r:frac r:frac Value Waarde Värde Number Bases Grondtallen voor talstelsels Nummerbaser 数字进制 Number Base Grondtal talstelsel Nummerbas 数字进制 r:base grondtal bas r:base Returns an integer from a number of specified base between 2 and 36 Converteert een getal in een opgegeven basis tussen 2 en 36 naar een geheel getal Returnerar ett heltal från ett tal med en angiven bas mellan 2 och 36. 返回一个指定进制(2-36之间)数字的值 Number Nummer Nummer 数字 Base Grondtal Bas 基/底 Binary Binair Binär 二进制 r:bin r:bin Returns an integer from a binary number Converteert een binair getal naar een geheel getal Returnerar ett heltal från ett binärt tal 返回一个二进制数字表示的整数值。 Binary number Binair getal Binärt nummer 二进制数 Octal Octaal Oktal 八进制 r:oct okt r:oct Returns an integer from an octal number Converteert een octaal getal naar een geheel getal Returnerar ett heltal från ett oktalt tal 返回一个八进制数字表示的整数值。 Octal number Octaal getal Oktalt nummer 八进制数 Hexadecimal Hexadecimaal Hexadecimal 十六进制 r:hex r:hex Returns a value from a hexadecimal number Converteert een hexadecimaal getal naar een getal Returnerar ett värde från ett hexadecimalt tal 返回一个十六进制数字表示的数值 Hexadecimal number Hexadecimaal getal Hexadecimalt nummer 十六进制数 Integers Gehele getallen Heltal 整数 Even Even Jämnt r:even jämn r:even Number Nummer Nummer 数字 Odd Oneven Ojämnt r:odd oneven udda r:odd Number Nummer Nummer 数字 Step Functions Stapfuncties Språngfunktioner 阶梯函数 Heaviside Step Function Heavyside stapfunctie Enhetssprångfunktion Heaviside阶梯函数 r:heaviside heavyside enhetssprång r:heaviside Discontinuous function also known as "unit step function". Returns 0 if x < 0, 1 if x > 0, and 1/2 if x = 0. Discontinue functie die ook bekend staat als de "eenheids stapfunctie". Retourneert 0 indien x < 0, 1 indien x ;gt; 0, en 1/2 indien x=0. 间断函数也被称作是" 单位阶跃函数"。当 x < 0时值为0, x > 0时值为1, x = 0时则为1/2。 (1/2)*(1+sgn(\x)) Value Waarde Värde false false Ramp Function Rampfunctie Rampfunktion 斜坡函数 r:ramp r:ramp (\x+abs(\x))/2 Value Waarde Värde false false Rectangular Function Rechthoekige functie Rektangulär funktion 矩阵函数 r:rectangular rechthoekig rektangulär r:rectangular heaviside(\x+(1/2))-heaviside(\x-(1/2)) Value Waarde Värde false false Sigmoid Function Sigmoïde functie Sigmoidfunktion sigmoid函数 r:sigmoid sigmoïde r:sigmoid 1/(1+e^(-\x)) Value Waarde Värde false Logit Transformation Logit transformatie Logit transformation Logit变换 r:logit r:logit ln(\x/(1-\x)) Value Waarde Värde Triangular Function Driehoekige functie Triangulär funktion 三角函数 r:triangular driehoekig triangulär r:triangular if(abs(\x)<1,1-abs(\x),0) Value Waarde Värde false false Analysis Analyse Analys 分析 Real Part Reële deel Reell del 实部 r:re r:re Complex number Complex getal Komplext nummer 复数 Imaginary Part Imaginaire deel Imaginär del 虚部 r:im r:im Complex number Complex getal Komplext nummer 复数 Gamma Function Gamma-functie Gammafunktion γ函数 r:gamma r:gamma Beta Function Beta-functie Betafunktion β函数 r:beta r:beta Exponents & Logarithms Exponenten & Logaritmen Exponenter & Logaritmer 指数与对数 Square Root Vierkantswortel Kvadratrot 平方根 au:√,r:sqrt au:√,r:sqrt Value Waarde Värde Square Vierkant Kvadrat 正方形 r:sq r:sq Value Waarde Värde Exponential (e^x) Exponent (e^x) Exponentialfunktion (e^x) e的乘方 r:exp r:exp Exponent Exponent Exponent 指数 Natural Logarithm Natuurlijke logaritme Naturlig logaritm 自然对数 r:ln r:ln Value Waarde Värde Base-N Logarithm Logaritme met grondtal N Bas-N-logaritm 以n为底的对数 r:log r:log Value Waarde Värde Base Grondtal Bas 基/底 Lambert W Function (Omega Function, Product Log) Lambert W Functie (Omega Functie, Product Log) Lambers W-funktion (Omegafunktionen) Lambert W函数(ω函数, Product Log) r:lambertw,productlog r:lambertw,productlog Returns the inverse function for mx*e^x as ln() does for e^x. Retourneert de inverse functie van mx*e^x (zoals ln(x) de inverse functie is van e^x). 返回函数mx*e^x的逆函数。 Value Waarde Värde Base-2 Logrithm Logaritme met grondtal 2 Bas-2-logaritm 以2为底的对数 rs:log2 rs:log2 Returns the base n logarithm. Retourneert de logaritme met grondtal n. Returnerar logaritmen för bas n. 返回以n为底的对数。 log(\x,2) Value Waarde Värde false 0 Base-10 Logrithm Logaritme met grondtal 10 Bas-10-logaritm 以10为底的对数 rs:log10 rs:log10 Returns the base n logarithm. Retourneert de logaritme met grondtal n. Returnerar logaritmen för bas n. 返回以n为底的对数。 log(\x,10) Value Waarde Värde false 0 Complex Exponential (Cis) Complex Exponentieel (Cis) Komplex exponentialfunction (Cis) 复指数(Cis) r:cis r:cis e^(\x*i) Exponent Exponent Exponent 指数 2 raised the to power X 2 tot de macht X 2 upphöjt med X 2的乘方 rs:exp2 rs:exp2 2^\x Exponent Exponent Exponent 指数 10 raised the to power X 10 tot de macht X 10 upphöjt med X 10的乘方 rs:exp10 rs:exp10 10^\x Exponent Exponent Exponent 指数 Cube Root Derdemachtswortel Kubikrot 立方根 r:cbrt r:cbrt \x^(1/3) Value Waarde Värde Nth root N-de wortel N:te roten N次方根 r:root wortel rot r:root \x^(1/\y) Base Grondtal Bas 基/底 Exponent Exponent Exponent 指数 X raised to the power Y X tot de macht Y X upphöjt med Y X的Y次方 r:pow macht upphöj r:pow \x^\y Base Grondtal Bas 基/底 Exponent Exponent Exponent 指数 Square root (x * pi) Vierkantswortel (x * pi) Kvadratrot (x * pi) 平方根(x*π) r:sqrtpi r:sqrtpi Returns the non-negative square root of x * pi Retourneert de niet-negatieve vierkantswortel van x * pi Returnerar icke-negativa kvadratroten av x * pi 返回xπ的非负平方根 abs((\x*pi)^(1/2)) Non-negative value Niet-negatieve waarde Icke-negativt nummer 非负值 0 Trigonometry Goniometrie Trigonometri 三角学 Sine Sinus Sinus 正弦 r:sin r:sin Angle Hoek Vinkel 角度 Cosine Cosinus Cosinus 余弦 r:cos r:cos Angle Hoek Vinkel 角度 Tangent Tangens Tangens 正切 r:tan r:tan Angle Hoek Vinkel 角度 Inverse Sine Inverse sinus Invers sinus 反正弦 r:asin r:asin Inverse Cosine Inverse cosinus Invers cosinus 反余弦 r:acos r:acos Inverse Tangent Inverse tangens Invers tangens 反正切 r:atan r:atan Hyperbolic Sine Hyperbolische sinus Sinus hyperbolicus 双曲正弦 r:sinh r:sinh Hyperbolic Cosine Hyperbolische cosinus Cosinus hyperbolicus 双曲余弦 r:cosh r:cosh Hyperbolic Tangent Hyperbolische tangens Tangens hyperbolicus 双曲正割 r:tanh r:tanh Inverse Hyperbolic Sine Inverse hyperbolische sinus Invers sinus hyperbolicus 反双曲正弦 r:asinh r:asinh Inverse Hyperbolic Cosine Inverse hyperbolische cosinus Invers cosinus hyperbolicus 反双曲余弦 r:acosh r:acosh Inverse Hyperbolic Tangent Inverse hyperbolische tangens Invers tangens hyperbolicus 反双曲正切 r:atanh r:atanh Radians to Default Angle Unit Radialen naar standaard hoekeenheid Radians till färvald vinkelenhet 将弧度转换到缺省角度单位 r:radtodef radnaardef r:radtodef Radians Radialen Radianer 弧度 Secant Secans Sekant 正割 r:sec r:sec 1/cos(\x) Angle Hoek Vinkel 角度 false Cosecant Cosecant Cosekant 余割 r:csc r:csc 1/sin(\x) Angle Hoek Vinkel 角度 false Cotangent Cotangens Cotangens 余切 r:cot r:cot cos(\x)/sin(\x) Angle Hoek Vinkel 角度 false Hyperbolic Secant Hyperbolische secans Sekant hyperbolicus 双曲正切 r:sech r:sech 1/cosh(\x) Hyperbolic Cosecant Hyperbolische cosecans Cosekant hyperbolicus 双曲余割 r:csch r:csch 1/sinh(\x) Hyperbolic Cotangent Hyperbolische cotangens Cotangens hyperbolicus 双曲余切 r:coth r:coth cosh(\x)/sinh(\x) Inverse Secant Inverse secans Invers sekant 反正割 r:asec r:asec radtodef(0.5pi+i*ln(sqrt(1-1\x^2)+i/\x)) Inverse Cosecant Inverse cosecans Invers cosekant 反余割 r:acsc r:acsc radtodef(-i*ln(sqrt(1-1\x^2)+i/\x)) Inverse Cotangent Inverse cotangens Invers cotangens 反余切 r:acot r:acot radtodef(i/2*(ln((\x-i)/\x)-ln((\x+i)/\x))) Inverse Hyperbolic Secant Inverse hyperbolische secans Invers sekant hyperbolicus 反双曲正割 r:asech r:asech ln(sqrt(1/\x-1)*sqrt(1/\x+1)+1/\x) Inverse Hyperbolic Cosecant Inverse hyperbolische cosecans Invers cosekant hyperbolicus 反双曲余割 r:acsch r:acsch ln(sqrt(1+1/\x^2)+1/\x) Inverse Hyperbolic Cotangent Inverse hyperbolische cotangens Invers cotangens hyperbolicus 反双曲余切 r:acoth r:acoth (ln(1+1/\x)-ln(1-1/\x))/2 Miscellaneous Diversen Diverse 杂项 Body Mass Index (BMI) Body Mass Index (BMI) (Index voor lichaamsmassa) 体质指数(BMI) -r:bmi -r:bmi Calculates the Body Mass Index. The resulting BMI-value is sometimes interpreted as follows (although varies with age, sex, etc.): Underweight < 18.5 Normal weight 18.5-25 Overweight 25-30 Obesity > 30 Note that you must use units for weight (ex. 59kg) and length (ex. 174cm). Berekent de zg. Body Mass Index (index voor de lichaamsmassa). De berekende BMI wordt als volgt beoordeeld (hoewel dit varieert met leeftijd, geslacht, enz): Te laag gewicht < 18.5 Normaal gewicht 18.5-25 Te hoog gewicht 25-30 Zwaarlijvigheid > 30 Let er opdat u eenheden gebruikt voor gewicht (bv. 59kg) en lengte (bv. 174cm). Beräknar BMI (Body Mass Index). Det resulterande BMI-värdet tolkas ibland som följer: Undervikt < 18.5 Idealvikt 18.5-25 Övervikt 25-30 Fetma > 30 Notera att du måste använda enheter för vikt (ex. 59kg) och längd (ex. 174cm). 计算体质指数(Body Mass Index, 简称BMI)。所得BMI结果的参考意义如下: 体重过轻 < 18.5 体重正常 18.5-25 体重过重 25-30 肥胖 > 30 注意您必须使用 重量和长度单位(如,59kg和174cm)。 (\x/(1000g))/(\y/m)^2 Weight Gewicht Vikt 重量 Length Lengte Längd 长度 Riemann Zeta Riemann Zeta Riemanns Zeta Riemann Zeta r:zeta r:zeta Integral point Gehele waarde Integralpunkt 积分点 Roman Number Romeins getal Romerskt tal 罗马数字 r:roman romeins r:roman Returns the value of a roman number. Retourneert de waarde van een Romeins getal. Returnerar värdet för romerska siffror. 返回罗马数字表示的值。 Roman number Romeins getal Romerskt tal 罗马数字 Kronecker Delta Kronecker Delta Kronecker Delta r:kronecker r:kronecker Returns 0 if i != j and 1 if i = j. Retourneert 0 indien i != j en 1 if i = j. Returnerar 0 om i != j och 1 if i = j. 如果i不等于j,返回0;如果i等于j,返回1。 \x=\Y{0} Value 1 (i) Waarde 1 (i) Värde 1 (i) 值1(i) false false Value 2 (j) Waarde 2 (j) Värde 2 (j) 值2(i) false false Statistics Statistiek Statistik 统计 Descriptive Statistics Beschrijvende statistiek Beskrivande statistik 描述性统计 Sum (total) Som (totaal) Summa (total) 总和 r:total totaal totalt r:total Data Gegevens Data 数据 Percentile Percentiel Percentil 百分位数 r:percentile percentiel percentil r:percentile Vector Vector Vektor 向量 Percentile (%) Percentiel (%) Percentil (%) 百分位数(%) Min Min Min 最小值 r:min r:min Returns the lowest value. Retourneert de kleinste waarde. Returnerar det lägsta värdet. 返回最小值。 Vector Vector Vektor 向量 Max Max Max 最大值 r:max r:max Returns the highest value. Retourneert de grootste waarde. Returnerar det högsta värdet. 返回最大值。 Vector Vector Vektor 向量 Mode Modus Typvärde 模式 r:mode modus typvärde r:mode Returns the most frequently occuring value. Retourneert de meest voorkomende waarde. Returnerar det mest förekommande värdet. 返回最常出现的值。 Vector Vector Vektor 向量 Range Bereik Omfång 范围 r:range bereik omfång r:range Calculates the difference between the min and max value. Berekent het verschil tussen de kleinste en de grootste waarde. Beräknar skillnaden mellan min och max värdet. 计算最大和最小值之间的差。 max(\x)-min(\x) Data Gegevens Data 数据 Median Mediaan Median 中位数 r:median mediaan r:median percentile(\x,50) Data Gegevens Data 数据 Quartile Kwartiel Kvartil 四分位数 r:quartile kwartiel kvartil r:quartile percentile(\x,25*\y) Data Gegevens Data 数据 Quartile Kwartiel Kvartil 四分位数 1 3 Decile Deciel Decil 十分位数 r:decile deciel decil r:decile percentile(\x,10*\y) Data Gegevens Data 数据 Decile Deciel Decil 十分位数 0 100 Interquartile Range Interkwartiel bereik Kvartilavstånd 四分位距 r:iqr r:iqr Calculates the difference between the first and third quartile. Berekent het verschil tussen het eerste en het derde kwartiel. Beräknar skillnaden mellan den första och tredje kvartilen. 计算第一和第三四分位数之间的差。 quartile(\x,3)-quartile(\x,1) Data Gegevens Data 数据 Number of Samples Aantal monsters Antal 样本数量 r:number getal antal r:number Returns the number of samples. Retourneert het aantal monsters. Returnerar antalet prov. 返回样本数量。 dimension(\x) Data Gegevens Data 数据 Random Number Willekeurig getal Slumptal 随机数 r:rand wilk slumptal r:rand Generates a pseudo-random number. Returns a real number between 0 and 1, if ceil is zero (default), or an integer between 1 and (including) ceil. Levert een pseudowillekeurig getal. Retourneert een reëel getal tussen 0 en 1 als ceil nul is (standaard), of een getal tussen 1 en ceil (inclusief). Generar ett pseudo-slumpmässigt nummer. Returnerar ett reealt tal mellan 0 och 1, om taket är noll (förval), eller ett heltal mellan 1 och (inklusive) taket. 产生一个伪随机数。如果顶部值为0(缺省值),返回一个在0与1之间的实数;否则返回一个 在1与顶部值之间(包含顶部值)的整数。 Ceil Ceil Tak 顶部值 Random Number Between Limits Willekeurig getal tussen twee grenswaarden Slumptal mellan gräser 在某一范围内的随机数 r:randbetween wilktussen r:randbetween Returns an integer between (including) bottom and top. Retourneert een geheel getal tussen onder- en bovengrens (inclusief). Returnerar ett heltal mellan (inklusive) nedre och övre gräns 返回在顶部和底部之间(含底部)的一个整数。 rand(\y-\x+1)+\x-1 \x<=\y Bottom Onder Nedre gräns 底部 Top Boven Övre gräns 顶部 Means Gemiddelden Medelvärde 平均 Mean Gemiddelde Medelvärde 平均 r:mean,average gemiddelde medel r:mean,average total(\x)/dimension(\x) Data Gegevens Data 数据 Harmonic Mean Harmonisch gemiddelde Harmoniskt medelvärde 调和平均 r:harmmean harmgem harmmedel r:harmmean dimension(\x)/csum(1,-1,0,"y"+1/"x","x","y",\x) Data Gegevens Data 数据 Geometric Mean Meetkundig gemiddelde Geometriskt medelvärde 几何平均 r:geomean meetkgem geomedel r:geomean abs(csum(1,-1,1,"y"*"x","x","y",\x)^(1/dimension(\x))) Data Gegevens Data 数据 Trimmed Mean Getrimd gemiddelde Trimmat medelvärde 截尾均值 r:trimmean trimgemidd r:trimmean mean(limits(sort(\x),round(dimension(\x)/100*\y)+1,round(dimension(\x)/100*(100-\y)))) Data Gegevens Data 数据 Trimmed percentage (at each end) Getrimd percentage (aan beide kanten) Trimmad procent (i båda ändarna) 截尾百分比(在每一端) Winsorized Mean Gewinsoriseerd gemiddelde Winsor-medelvärde Winsorized平均 r:winsormean winsorgemidd r:winsormean sort(\x) dimension(\x) round(dimension(\x)/100*\y) (element(\1,\2-\3)*\3+element(\1,\3+1)*\3+total(limits(\1,\3+1,\2-\3)))/\2 Data Gegevens Data 数据 Winsorized percentage (at each end) Gewinsoriseerd percentage (aan beide kanten) Winsorprocent (i båda ändarna) Winsorized百分比(在每一端) Weighted Mean Gewogen gemiddelde Viktat medelvärde 加权平均 r:weighmean gewogengemidd r:weighmean dimension(\x) min(dimension(\x),dimension(\y)) csum(1,\2,0,"y"+"x"*element("v","i"+\1),"x","y",mergevectors(\x,\y),"i","v")/total(limits(\y,1,\2)) Data Gegevens Data 数据 Weights Gewichten Vikter 权重 Quadratic Mean (RMS) Kwadratisch gemiddelde (RMS) Kvadratiskt medelvärde 均方(RMS) r:rms r:rms abs((csum(1,-1,0,"y"+"x"^2,"x","y",\x)/dimension(\x))^(1/2)) Data Gegevens Data 数据 Moments Momenten Moment 统计矩 Standard Deviation (entire population) Standaarddeviatie (gehele populatie) Standardavvikelse (komplett population) 标准差(总体) r:stdevp r:stdevp abs(varp(\x)^(1/2)) Data Gegevens Data 数据 Standard Deviation (random sampling) Standaarddeviatie (willekeurige steekproef) Standardavvikelse (slumpmässigt urval) 标准差(随机采样) r:stdev standardavvikelse r:stdev abs(var(\x)^(1/2)) Data Gegevens Data 数据 Variance (entire population) Variantie (gehele populatie) Varians (komplett population) 方差(总体) r:varp r:varp mean(\x) csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)/dimension(\x) Data Gegevens Data 数据 Variance (random sampling) Variantie (willekeurige steekproef) Varians (slumpmässigt urval) 方差(随机样本) r:var r:var mean(\x) csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)/(dimension(\x)-1) Data Gegevens Data 数据 Standard Error Standaardfout Standardfel 标准误差 r:stderr standardfel r:stderr abs((var(\x)/dimension(\x))^(1/2)) Data Gegevens Data 数据 Mean Deviation Gemiddelde afwijking Medelavvikelse 均差 r:meandev gemiddev medelavvikelse r:meandev mean(\x) csum(1,-1,0,"y"+abs("x"-\1),"x","y",\x)/dimension(\x) Data Gegevens Data 数据 Covariance Covariantie Kovarians 协方差 r:cov,r:covar r:cov,r:covar mean(\x) mean(\y) dimension(\x) min(dimension(\x),dimension(\y)) csum(1,\4,0,"y"+("x"-\1)*(element("v","i"+\3)-\2),"x","y",mergevectors(\x,\y),"i","v")/(\4) Data 1 Gegevens 1 Data 1 数据1 Data 2 Gegevens 2 Data 2 数据2 Pooled Variance Pooled variantie Gemensam varians 合并方差 r:poolvar r:poolvar mean(\x) mean(\y)^2 (csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)+csum(1,-1,0,"y"+("x"-\2)^2,"x","y",\y))/(dimension(\x)+dimension(\y)-2) Data 1 Gegevens 1 Data 1 数据1 Data 2 Gegevens 2 Data 2 数据2 Regression Regressie Regression 回归分析 Statistical Correlation Statistische correlatie Statistisk korrelation 统计相关 r:cor r:cor covar(\x,\y)/(stdev(\x)*stdev(\y)) Data 1 Gegevens 1 Data 1 数据1 Data 2 Gegevens 2 Data 2 数据2 Pearson's Correlation Coefficient Pearson's correlatiecoëfficiënt Pearsons korrelationskoefficient 个人相关系数 r:pearson,r:correl korrelation r:pearson,r:correl dimension(\x)=dimension(\y) total(\x) total(\y) dimension(\x) dimension(\y) (\x*\y-\1*\2/\3)/abs(((\x^2-(\1^2)/\3)*(\y^2-(\2^2)/\4))^(1/2)) Data 1 Gegevens 1 Data 1 数据1 Data 2 Gegevens 2 Data 2 数据2 Spearman's Rho Spearman's Rho Spearmans Rho r:spearman r:spearman dimension(\x)=dimension(\y) pearson(rank(\x),rank(\y)) Data 1 Gegevens 1 Data 1 数据1 Data 2 Gegevens 2 Data 2 数据2 Durbin-Watson Durbin-Watson Durbin-Watson Durbin-Watson r:durbinwatson r:durbinwatson csum(2,-1,0,"y"+("x"-element("v","i"-1))^2,"x","y",mergevectors([0],\x),"i","v")/csum(1,-1,0,"y"+"x"^2,"x","y",\x) Data Gegevens Data 数据 Statistical Tests Statistische testen Statistika tester 统计测试 Unpaired T-Test Ongepaarde T-proef T-test 非配对T测试 r:ttest r:ttest poolvar(\x,\y)^2 (mean(\x)-mean(\y))/abs(((\1)/dimension(\x)+(\1)/dimension(\y))^(1/2)) Data 1 Gegevens 1 Data 1 数据1 Data 2 Gegevens 2 Data 2 数据2 Paired T-Test Gepaarde t-proef Parvist t-test 配对t检验 r:pttest r:pttest mean(\x-\y)/stderr(\x-\y) Data 1 Gegevens 1 Data 1 数据1 Data 2 Gegevens 2 Data 2 数据2 Distribution Distributie Distribution 分布 Rayleigh Distribution Rayleigh-verdeling Rayleighfördelning Rayleigh分布 r:rayleigh r:rayleigh Returns the probability density p(x) at x for a Rayleigh distribution with scale parameter sigma. (from Gnumeric) Retourneert de kansdichtheid p(x) in x voor een Rayleigh-verdeling met schaalparameter sigma. (van Gnumeric) 根据指定的规模参数Sigma返回Rayleigh分布在x点的密度概率p(x)。(用Gnumeric) if(\x < 0,0,(\x/\y)/\y*exp(-(\x/\y)*(\x/\y)/2)) X X X X Sigma Sigma Sigma Sigma 0 Rayleigh Tail Distribution Rayleigh-staartverdeling Rayleighsvansfördelning Rayleigh尾分布 r:rayleightail rayleighstaart r:rayleightail Returns the probability density p(x) at x for a Rayleigh tail distribution with scale parameter sigma and a lower limit. (from Gnumeric) Retourneert de kansdichtheid p(x) in x voor een Rayleigh-staartverdeling met schaalparameter sigma en een ondergrens. (van Gnumeric) 根据指定的规模参数Sigma和下限返回Rayleigh尾分布在x点的密度概率p(x)。(用Gnumeric) if(\x < \y,0,(\x/\z)/\z*exp(((\y/\z)+(\x/\z))*((\y/\z)-(\x/\z))/2)) X X X X Lower limit Ondergrens Undre gräns 下限 Sigma Sigma Sigma Sigma 0 Pareto Distribution Paretoverdeling Paretofördelning Pareto分布 r:pareto r:pareto Returns the probability density p(x) at x for a Pareto distribution with exponent and scale. (from Gnumeric) Retourneert de kansdichtheid p(x) in x voor een Pareto-verdeling met exponent en schaal. (van Gnumeric) 根据指定的指数和规模返回Pareto分布在x点的密度概率p(x)。(用Gnumeric) if(\x < \z,0,(\y/\z)/(\x/\z)^(\y+1)) X X X X Exponent Exponent Exponent 指数 0 Scale Schaal Skala 规模 0 Logistic Distribution Logistische verdeling Logistisk distribution Logistic分布 r:logistic logistisch r:logistic Returns the probability density p(x) at x for a logistic distribution with scale parameter. (from Gnumeric) Retourneert de kansdichtheid p(x) in x voor een logistische verdeling met schaalparameter. (van Gnumeric) 根据指定的规模返回logistic分布在x点的密度概率p(x)。(用Gnumeric) exp(-abs(\x)/\y)/(abs(\y)*(1+exp(-abs(\x)/\y))^2) X X X X Scale Schaal Skala 规模 0 Date & Time Datum & Tijd Datum & Tid 日期与时间 Days between two dates Aantal dagen tussen twee data Antal dagar mellan två datum 两个日期之间的天数 r:days dagen dagar r:days Returns the number of days between two dates. Basis is the type of day counting you want to use: 0: US 30/360, 1: real days (default), 2: real days/360, 3: real days/365 or 4: European 30/360. Retourneert het aantal dagen tussen twee data. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. Returnerar antalet dagar mellan två datum. Dagsräkningssystem kan vara: 0: Amerikanskt 30/360 (förvald), 1: verkliga dagar, 2: verkliga dagar/360, 3: verkliga dagar/365, eller 4: Europeiskt 30/360 返回两个日期之间的天数。 "基准"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。 First date Eerste datum Första datumet 第一个日期 Second date Tweede datum Andra datumet 第二个日期 Day counting basis Basis dagtelling Dagsräkningssystem 天数计算基准 Financial function mode Financiële functiemodus Läge för financiella funktioner 金融函数模式 Years between two dates Jaren tussen twee data Antal är mellan två datum 两个日期之间相隔的年数 r:yearfrac jaarfrac r:yearfrac Returns the number of years (fractional) between two dates. Basis is the type of day counting you want to use: 0: US 30/360, 1: real days (default), 2: real days/360, 3: real days/365 or 4: European 30/360. Retourneert het aantal jaren (niet noodzakelijk geheel) tussen twee data. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. Returnerar antalet år (decimala) mellan två datum. Dagsräkningssystem kan vara: 0: Amerikanskt 30/360, 1: verkliga dagar (förvald), 2: verkliga dagar/360, 3: verkliga dagar/365, eller 4: Europeiskt 30/360 返回两个日期之间的年数(分数值)。 "基准"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。 First date Eerste datum Första datumet 第一个日期 Second date Tweede datum Andra datumet 第二个日期 Day counting basis Basis dagtelling Dagsräkningssystem 天数计算基准 Financial function mode Financiële functiemodus Läge för financiella funktioner 金融函数模式 Week of Year Week van het jaar Vecka på året 一年中的第几周 r:week vecka r:week Date Datum Datum 日期 Week begins on Sunday Week begint op zondag Veckor börjar på söndag 每周从星期天开始 Day of Week Dag van de week Veckodag 星期中的第几天 r:weekday weekdag veckodag r:weekday Date Datum Datum 日期 Week begins on Sunday Week begint op zondag Veckor börjar på söndag 每周从星期天开始 Month Maand Månad 月份 r:month maand månad r:month Date Datum Datum 日期 Day of Month Dag van de maand Månadsdag 月份中的第几天 r:day dag dag r:day Date Datum Datum 日期 Year Jaar År r:year jaar år r:year Date Datum Datum 日期 Day of Year Dag van het jaar Dag på året 一年中的第几天 r:yearday jaardag årsdag r:yearday Date Datum Datum 日期 Current Time Huidige tijd Nuvarande tid 当前时间 r:time tijd tid r:time Standard Date Format Standaardnotatie voor datum Standard-datumformat 标准日期格式 r:isodate isodatum r:isodate Date Datum Datum 日期 Local Date Format Lokale datumnotatie Lokalt datumformat 本地日期格式 r:localdate lokaledatum lokalt_datum r:localdate Date Datum Datum 日期 Date to Unix Timestamp Datum naar Unix-timestamp 将时间转换为Unix时间戳 r:timestamp r:timestamp Date Datum Datum 日期 Unix Timestamp to Date Unix Timestamp naar datum Unit Timestamp till datum Unix时间戳转换为日期 r:stamptodate stampnaardatum r:stamptodate Timestamp Timestamp 时间戳 Add Days Dagen bijtellen Addera dagar 加日 r:addDays dagen bijtellen adderaDagar r:addDays Date Datum Datum 日期 Days Dagen Dagar Add Months Maanden bijtellen Addera månader 加月份 r:addMonths maanden bijtellen adderaMånader r:addMonths Date Datum Datum 日期 Months Maanden Månader 月份 Add Years Jaren bijtellen Addera år 加年 r:addYears jaren bijtellen adderaÅr r:addYears Date Datum Datum 日期 Years Jaren Antal år Add Time Tijd optellen Addera tid 加时间 r:addTime tijd bijtellen adderaTid r:addTime Adds a time value to a date. The value can be positive or negative, but must use a unit based on seconds (such as day and year). Fractions of days are truncated. Telt een tijdswaarde op bij een datum. Deze waarde kan zowel positief zijn als negatief, maar moet in een eenheid zijn uitgedrukt die op seconden is gebaseerd (zoals dag of jaar). Fracties van dagen worden afgekapt tot hele dagen. Adderar ett tidsvärde till ett datum. Värdet kan vara positivt eller negativt, men måste använda en enhet baserad på sekunder (såsom dag och år). Delar av dagar avrundas mot noll. 将一个时间间隔值加到日期中。该值可正可负,但其单位必须基于秒(如日或者年)。日期的分数部分会被截取掉。 addDays(\x,trunc(\y/day)) Date Datum Datum 日期 Time Tijd Tid 时间 isNumber(\x/day) Utilities Hulpmiddelen Verktyg 工具 ASCII Value ASCII-waarde ASCII värde ASCII值 r:code kod r:code Character Karakter Tecken 字符 ASCII Char ASCII-kar ASCII tecken ASCII字符 r:char tecken r:char Value Waarde Värde Length of string Lengte van karakterrij Textsträngslängd 字符串长度 r:len längd r:len Text Tekst Text 文字 Concatenate Strings Karakterrijen samenvoegen Sammanfoga textsträngar 连接字符串 r:concatenate samenvoegen sammanfoga r:concatenate Text string 1 Tekstrij 1 Textsträng 1 文字1 Text string 2 Tekstrij 2 Textsträng 2 文字2 Replace Vervangen Ersätt 替换 r:replace vervangen ersätt r:replace Replaces a certain value in an expression with a new value. The expression is calculated before the replacement if the fourth argument is true. Vervangt een waarde in een expressie door een nieuwe waarde. Eerst wordt de expressie berekend indien het vierde argument waar (true) is. Ersätt ett visst värde i ett uttryck med ett nytt värde. Uttrycket beräknas innan ersättandet om den parametern är satt till sant. 使用新值替换表达式中的特定值。如果第四个参数是真,则在替换前首先对表达式 进行计算。 Expression Expressie Uttryck 表达式 Original value Originele waarde Ursprungligt värde 原始值 New value Nieuwe waarde Nytt värde 新值 Precalculate expression Voorbereken expressie Beräkna uttrycket först 预先计算表达式 Strip Units Eenheden verwijderen Ta bort enheter 剥离单位 r:nounit,strip_units geeneenheid,eenheden_weg r:nounit,strip_units Removes all units from an expression. The expression is calculated before the removal. Verwijdert alle eenheden uit een expressie. De expressie wordt hierbij eerst berekend. Tar bort alla enheter från ett uttryck. Uttrycket beräknas innan borttagandet. 从表达式中删除全部单位。在删除之前会先对表达式进行计算。 Expression Expressie Uttryck 表达式 Process Vector Elements Vector-elementen verwerken Modifiera vektorelement 处理向量元素 r:process verwerken r:process Function Functie Funktion 函数 Element variable Elementvariabele Elementvariabel 元素变量 Vector Vector Vektor 向量 Index variable Indexvariabele Indexvariabel 下标变量 Vector variable Vectorvariabele Vektorvariabel 向量变量 Process Matrix Elements Matrix-elementen verwerken Modifiera matriselement 处理矩阵元素 r:processm r:processm Function Functie Funktion 函数 Element variable Elementvariabele Elementvariabel 元素变量 Matrix Matrix Matris 矩阵 Row variable Rijvariabele Radvariabel 行变量 Column variable Kolomvariabele Kolumnvariabel 列标量 Matrix variable Matrixvariabele Matrisvariabel 矩阵变量 Custom Sum of Elements Aangepaste som van elementen Anpassad elementsumma 元素的自定义和 r:csum csom r:csum First element Eerste element Första elementet 最后一个元素 Last element Laatste element Sista elementet 最后一个元素 Initial value Beginwaarde Initialt värde 初始值 Function Functie Funktion 函数 Value variable Waarde variabele Värdevariabel 值变量 Element variable Elementvariabele Elementvariabel 元素变量 Vector Vector Vektor 向量 Index variable Indexvariabele Indexvariabel 下标变量 Vector variable Vectorvariabele Vektorvariabel 向量变量 Select Vector Elements Vectorelementen selecteren Utvälj vektorelement 选择矩阵元素 r:select selecteer r:select Vector Vector Vektor 向量 Condition Conditie Förutsättning 条件 Element variable Elementvariabele Elementvariabel 元素变量 Select first match Eerste overeenkomst secteren Välj första matchande element 选择第一个匹配项 Function Functie Funktion 函数 r:function functie funktion r:function Expression Expressie Uttryck 表达式 Arguments Argumenten Parametrar 自变量 Title Titel Titel 标题 r:title titel titel r:title Name Naam Namn 名称 Display Error Weergavefout Visa felmeddelande 显示错误 r:error fout fel r:error Message Bericht Meddelande 信息 Display Warning Waarschuwing weergeven Visa varning 显示警告 r:warning waarschuwing varning r:warning Message Bericht Meddelande 信息 Display Message Bericht weergeven Visa meddelande 显示信息 r:message bericht meddelande r:message Message Bericht Meddelande 信息 Save as Variable Opslaan als variabele Spara som variabel 作为变量保存 r:save opslaan spara r:save Value Waarde Värde Name Naam Namn 名称 Category Categorie Kategori 类别 Title Titel Titel 标题 RPN Stack Register RPN-register in stapelgeheugen RPN-stackregister RPN栈寄存器 r:register r:register Returns the value of a RPN stack register. Retourneert de waarde in een register van het RPN-stapelgeheugen. Returnerar värdet för ett register på RPN-stacken. 返回RPN栈寄存器的值。 Index Index Index 下标 RPN Stack Vector RPN-vector in stapelgeheugen RPN-stackvektor RPN栈向量 r:stack stapelgeheugen r:stack Returns the RPN stack as a vector. Retourneert de inhoud van het RPN-stapelgeheugen als een vector. Returnerar RPN-stacken som en vektor. 将RPN栈作为向量返回。 Is Number Is een getal Är nummer 是数字 r:isNumber isGetal ärNummer r:isNumber Value Waarde Värde Is Real Is een reëel getal Är reellt 是实数 r:isReal isReëel ärReellt r:isReal Value Waarde Värde Is Rational Is een rationaal getal Är rationellt 是有理数 r:isRational isRationaal ärRationellt r:isRational Value Waarde Värde Is Integer Is een geheel getal Är heltal 是整数 r:isInteger isGeheel ärHeltal r:isInteger Value Waarde Värde Represents Number Geeft een getal weer Representar nummer 代表数字 r:representsNumber isGetal representerarNummer r:representsNumber Value Waarde Värde Represents Real Geeft een reëel getal weer Representerar reellt tal 代表实数 r:representsReal isReëel representerarReelt r:representsReal Value Waarde Värde Represents Rational Geeft een rationaal getal weer Representerar rationellt tal 代表有理数 r:representsRational isRationaalgetal representerarRationellt r:representsRational Value Waarde Värde Represents Integer Geeft een geheel getal weer Representerar ett heltal 代表整数 r:representsInteger isGeheelgetal representarHeltal r:representsInteger Value Waarde Värde Logical Logisch Logik 逻辑 For...Do For...Do För...utför For...Do r:for för r:for Initial value of counter Beginwaarde van teller Initialt värde för räknare 计数器初始值 Counter variable Tellervariabele Räknarvariabel 计数器变量 For condition For-voorwaarde Medans-villkor For条件 Counter update function Functie voor bijwerken van de teller Funktion för uppdatering av räknare 计数器更新函数 Initial value Beginwaarde Initialt värde 初始值 Do function Do-functie Funktion Do函数 Value variable Waarde variabele Värdevariabel 值变量 If...Then...Else If...Then...Else Om...då...annars If...Then...Else r:if om r:if Tests a condition and returns a value depending on the result. Test een conditie en retourneert een waarde afhankelijk van het resultaat. Testar ett villkor och returnerar ett värde beroende av result. 对一个条件进行测试,并根据测试结果返回一个值。 Condition Conditie Förutsättning 条件 Expression if condition is met Expressie indien aan conditie wordt voldaan Uttryck om villkoret uppfylls 条件满足时的表达式 Expression if condition is NOT met Expressie indien NIET aan conditie wordt voldaan Uttryck om villkoret INTE uppfylls 条件不满足时的表达式 Logical Exclusive OR Booleaanse XOR 逻辑排斥OR r:xor r:xor Value 1 Waarde 1 Värde 1 值1 Value 2 Waarde 2 Värde 2 值2 Bitwise Exclusive OR Bitsgewijs XOR 按位排斥OR r:bitxor r:bitxor Value 1 Waarde 1 Värde 1 值1 Value 2 Waarde 2 Värde 2 值2 Bitwise Shift Bitsgewijs verschuiven (shift) 按位移位 r:shift r:shift Number Nummer Nummer 数字 Bits Bits 比特 Algebra Algebra Algebra 代数 Sum Som Summa 求和 au:Σ,r:sum Σ,som au:Σ,summa au:Σ,r:sum Corresponds to the sum symbol. Adds terms for each x ranging from the lower to the upper limit. Komt overeen met symbool voor optellen. Telt termen op met een waarde tussen de kleinste en de grootste grenswaarde. Motsvarar summasymbolen. Adderar termer för varje x från den undre till den övre gränsen. 相当于求和符号Σ。将从上限到下限的每项x相加。 Term expression Expressie voor term Termuttryck 项表达式 Lower limit (i) Ondergrens (i) Undre gräns (i) 下限(i) Upper limit (n) Bovengrens (n) Övre gräns (n) 上限(n) Index variable Indexvariabele Indexvariabel 下标变量 Product Product Produkt 连乘 au:Π,r:product au:Π,produkt au:Π,r:product Corresponds to the product symbol. Multiplies factors for each x ranging from the lower to the upper limit. Komt overeen met het symbool voor vermenigvuldiging. Vermenigvuldigt met factoren met een waarde tussen de kleinste en de grootste grenswaarde. Motsvarar produktsymbolen. Multiplicerar faktorer för varje x från den undre till den övre gränsen. 相当于连乘符号Π。将从上限到下限的每项x相乘。 Factor expression Expressie voor factor Faktoruttryck 因子表达式 Lower limit (i) Ondergrens (i) Undre gräns (i) 下限(i) Upper limit (n) Bovengrens (n) Övre gräns (n) 上限(n) Index variable Indexvariabele Indexvariabel 下标变量 Solve for multiple variables Oplossen voor meerdere variabelen Lös för flera variabler 多变量求解 r:multisolve meerdereoplossen r:multisolve Equation vector Vergelijkingsvector Ekvationsvektor 方程向量 Variable vector Variabele vector Variabelvektor 变量向量 Solve equation Vergelijking oplossen Lös ekvation 方程求解 r:solve oplossen lös r:solve Equation Vergelijking Ekvation 方程 With respect to Met betrekking tot Med avseende på 关于 Solve for two variables Oplossen voor twee variabelen Lös för två variabler 双变量求解 r:solve2 oplossen2 lös2 r:solve2 Solves two equations with two unknown variables. Returns the value of the first variable. Lost twee vergelijkingen op in twee variabelen. Retourneert de waarde van de eerste variabele. Lös två ekvationer med två okända variabler. Returnerar värdet på den första variabeln. 解由两个未知数和两个方程组成方程组。返回第一个变量的值。 solve(replace(\x,\A{y},solve(\y,\A)),\Z{x}) Equation 1 Vergelijking 1 Ekvation 1 方程1 Equation 2 Vergelijking 2 Ekvation 2 方程 Variable 1 Variabele 1 Variabel 1 变量1 Variable 2 Variabele 2 Variabel 2 变量2 Find Linear Function Lineaire functie bepalen Finn linjär funktion 寻找线性函数 r:linearfunction lineairefunctie linjär_funktion r:linearfunction Finds the linear function for the straight line between two distinct points. Bepaalt de lineaire functie voor de rechte lijn tussen twee verschillende punten. Finner den linjära funktionen för den räta linjen mellan två distinkta punkter. 寻找过两点直线段的线性函数 (\a-\y)/(\z-\x)*("x"-\x)+\y x1 x1 y1 y1 x2 x2 y2 y2 Calculus Calculus Calculus 微积分 Derive Afleiden Derivera 求导 r:diff r:diff Function Functie Funktion 函数 With respect to Met betrekking tot Med avseende på 关于 Order Orde Ordning 次数 Integrate Integreren Integrera 积分 r:integrate integreren integrera r:integrate Function Functie Funktion 函数 Variable of integration Integratievariabele Variabel för integration 积分变量 Lower limit Ondergrens Undre gräns 下限 Upper limit Bovengrens Övre gräns 上限 Extreme Values Uiterste waarden Extremvärden 极限值 r:extremum uiterste r:extremum solve(diff(\x, \Y{x})=0, \Y) Function Functie Funktion 函数 With respect to Met betrekking tot Med avseende på 关于 Geometry Meetkunde Geometri 几何 Triangle Driehoek Triangel 三角形 Hypotenuse Hypotenusa Hypotenusa 斜边 r:hypot r:hypot sqrt(\x^2+\y^2) Side A Zijde A Sida A 边A Side B Zijde B Sida B 边B Triangle Area Oppervlakte van driehoek Triangelarea 三角形面积 r:triangle driehoek triangel r:triangle (\x*\y)/2 Base Grondtal Bas 基/底 Height Hoogte Höjd 高度 Triangle Perimeter Omtrek van driehoek Triangelomkrets (直角)三角形周长 r:triangle_perimeter driehoek_omtrek triangelomkrets r:triangle_perimeter \x+\y+hypot(\x,\y) Side A Zijde A Sida A 边A Side B Zijde B Sida B 边B Circle Cirkel Cirkel 圆形 Circle Area Cirkeloppervlak Cirkelarea 圆面积 r:circle cirkel cirkel r:circle Calculates the area of a circle using the radius Berekent met de straal het oppervlak van een cirkel Beräknar arean för en cirkel. 使用半径计算圆面积 \x^2*pi Radius Straal Radie 半径 Circle Circumference Cirkelomtrek Cirkelomkrets 圆周长 r:circumference cirkelomtrek omkrets r:circumference Calculates the area of a circle using the radius Berekent met de straal het oppervlak van een cirkel Beräknar arean för en cirkel. 使用半径计算圆面积 \x*2*pi Radius Straal Radie 半径 Cylinder Cilinder Cylinder 圆柱 Cylinder Volume Volume van cilinder Cylindervolym 圆柱体积 r:cylinder cilinder r:cylinder \x^2*pi*\y Radius Straal Radie 半径 Height Hoogte Höjd 高度 Surface Area of Cylinder Oppervlaktegrootte van cilinder Ytarea för en cylinder 圆柱体表面积 r:cylinder_sa cilinder_opp cylinderyta r:cylinder_sa 2*(\x^2*pi)+2*pi*\x*\y Radius Straal Radie 半径 Height Hoogte Höjd 高度 Cone Kegel Kon 圆锥 Cone Volume Volume van kegel Konvolym 圆锥体积 r:cone kegel kon r:cone \x^2*pi*\y/3 Radius Straal Radie 半径 Height Hoogte Höjd 高度 Surface Area of Cone Oppervlaktegrootte van kegel Ytarea för en kon 圆锥表面积 r:cone_sa kegel_opp konyta r:cone_sa \x^2*pi+pi*\x*abs((\y^2+\x^2)^(1/2)) Radius Straal Radie 半径 Height Hoogte Höjd 高度 Sphere Bol Sfär 球体 Sphere Volume Volume van bol Sfärvolym 球体积 r:sphere bol sfär r:sphere \x^3*pi*4/3 Radius Straal Radie 半径 Surface Area of Sphere Oppervlaktegrootte van bol Ytarea för en sfär 球体表面积 r:sphere_sa bol_oppervlak sfäryta r:sphere_sa \x^2*pi*4 Radius Straal Radie 半径 Square Vierkant Kvadrat 正方形 Square Area Oppervlakte van vierkant Kvadratarea 正方形面积 r:square vierkant kvadrat r:square \x^2 Length of side Lengte van zijde Sidans längd 边长 Square Perimeter Omtrek van vierkant Kvadratomkrets 正方形周长 r:square_perimeter vierkant_omtrek kvadratomkrets r:square_perimeter \x*4 Length of side Lengte van zijde Sidans längd 边长 Cube Derdemacht Kub 立方体 Cube Volume Volume kubus Kubvolym 立方体体积 r:cube kubus kub r:cube \x^3 Length of side Lengte van zijde Sidans längd 边长 Surface Area of Cube Oppervlaktegrootte van kubus Ytarea för en kub 立方体表面积 r:cube_sa kubus_opp kubyta r:cube_sa (\x^2)*6 Length of side Lengte van zijde Sidans längd 边长 Rectangle Rechthoek Rektangel 矩形 Rectangle Area Oppervlak rechthoek Rektangelarea 矩形面积 r:rect rektangel r:rect \x*\y Length Lengte Längd 长度 Width Breedte Bredd 宽度 Rectangle Perimeter Omtrek rechthoek Rektangelomkrets 矩形周长 r:rect_perimeter rect_omtrek rektangelomkrets r:rect_perimeter (\x+\y)*2 Length Lengte Längd 长度 Width Breedte Bredd 宽度 Prism Prisma Prism 棱柱 Volume of Rectangular Prism Inhoud van rechthoekig prisma Volym för en rektangulär prism 矩形棱柱体积 r:rectprism rectprisma rektangelprism r:rectprism Calculates the volume of a prism with rectangular base. Berekent de inhoud van een prisma met een rechthoekig basisvlak. Beräknar volymen för en prisma med rektangulär bas. 计算矩形棱柱的体积。 \x*\y*\z Length Lengte Längd 长度 Width Breedte Bredd 宽度 Height Hoogte Höjd 高度 Surface Area of Rectangular Prism Oppervlaktegrootte van rechthoekig prisma Ytarea för en rektangulär prism 矩形棱柱表面积 r:rectprism_sa rectprisma_opp rektangelprismyta r:rectprism_sa Calculates the surface area of a prism with rectangular base. Berekent de oppervlakte van een prisma met een rechthoekig basisvlak. Beräknar ytarean för en prisma med rektangulär bas. 计算矩形棱柱的表面积 (\x*\y)*2+(\x*\z)*2+(\y*\z)*2 Length Lengte Längd 长度 Width Breedte Bredd 宽度 Height Hoogte Höjd 高度 Volume of Triangular Prism Inhoud van driehoekig prisma Volym för en triangulär prism 三角棱柱体积 r:triangleprism driehoekprisma triangelprism r:triangleprism Calculates the volume of a prism with triangular base. Berekent de inhoud van een prisma met een driehoekig basisvlak. Beräknar volymen för en prisma med triangulär bas. 计算三角棱柱的体积。 \x*\y*\z/2 Length Lengte Längd 长度 Width Breedte Bredd 宽度 Height Hoogte Höjd 高度 Pyramid Piramide Pyramid 锥体 Pyramid Volume Volume van piramide Pyramidvolym 锥体体积 r:pyramid piramide r:pyramid Calculates the volume of a 3-dimensional shape standing on a rectangular base and terminating in a point at the top. Berekent de inhoud van een 3-dimensionaal lichaam met een rechthoekig basisvlak en een top in de vorm van een punt. Beräknar volymen för en 3-dimensionell form som står på en rektangulär bas och som slutar en punkt på toppen. 计算矩形锥体的体积。 \x*\y*\z/3 Length of base Lengte van basis Basens längd 底面长度 Width of base Basislengte Basens bredd 底面宽度 Height Hoogte Höjd 高度 Volume of Regular Tetrahedron Inhoud van regelmatig viervlak (tetraëder) Volym för en liksidig tetrahedron 正四面体体积 r:tetrahedron tetraëder r:tetrahedron sqrt(2)/12*\x^3 Length of side Lengte van zijde Sidans längd 边长 Surface Area of Regular Tetrahedron Oppervlaktegrootte van regelmatig viervlak (tetraëder) Ytarea för en liksidig tetrahedron 正四面体表面积 r:tetrahedron_sa tetraëder_opp tetrahedronyta r:tetrahedron_sa sqrt(3)*\x^2 Length of side Lengte van zijde Sidans längd 边长 Height of Regular Tetrahedron Hoogte van een regelmatig viervlak (tetraëder) Höjden på en liksidig tetrahedron 正四面体的高度 r:tetrahedron_height tetraëder_hoogte tetrahedronhöjd r:tetrahedron_height sqrt(6)/3*\x Length of side Lengte van zijde Sidans längd 边长 Volume of Square Pyramid Inhoud van vierkant prisma Volym för en kvadratisk pyramid 方锥体体积 r:sqpyramid vierkpiramide kvpyramid r:sqpyramid sqrt(2)/6*\x^3 Length of side Lengte van zijde Sidans längd 边长 Surface Area of Square Pyramid Oppervlaktegrootte van vierkante piramide Ytarea för en kvadratisk pyramid 方锥体表面积 r:sqpyramid_sa vierkpiramide_opp kvpyramidyta r:sqpyramid_sa (1+sqrt(3))*\x^2 Length of side Lengte van zijde Sidans längd 边长 Height of Square Pyramid Hoogte van een vierkante piramide Höjden på en kvadratisk pyramid 方角锥的高度 r:sqpyramid_height midhoogte_vierkpiramide kvpyramidhöjd r:sqpyramid_height sqrt(2)/2*\x Length of side Lengte van zijde Sidans längd 边长 Parallelogram Parallellogram Parallelogram 平行四边形 Parallelogram Area Oppervlak van parallellogram Parallelogramarea 平行四边形面积 r:parallelogram parallellogram parallellogram r:parallelogram Calculates the area of a four-sided figure whose opposite sides are both parallel and equal in length. Berekent de oppervlakte van een figuur met vier zijden waarvan de overstaande zijden zowel evenwijdig als even lang zijn. Beräknar arean för en fyrsidig figur vars motstående sidor är parallella och är lika långa. 计算平行四边形的面积。 \x*\y Base Grondtal Bas 基/底 Height Hoogte Höjd 高度 Parallelogram Perimeter Omtrek van parallellogram Parallelogramomkrets 平行四边形周长 r:parallelogram_perimeter parallellogram_omtrek parallellogramomkrets r:parallelogram_perimeter Calculates the perimeter of a four-sided figure whose opposite sides are both parallel and equal in length. Berekent de omtrek van een figuur met vier zijden waarvan de overstaande zijden zowel evenwijdig als even lang zijn. Beräknar omkretsen för en fyrsidig figur vars motstående sidor är både parallella och lika långa. 计算平行四边形的周长。 (\x+\y)*2 Side A Zijde A Sida A 边A Side B Zijde B Sida B 边B Trapezoid Trapezium Trapetsoid 梯形 Trapezoid Area Oppervlakte van trapezium Trapetsoidarea 梯形面积 r:trapezoid trapezium trapetsoid r:trapezoid Calculates the area of a four-sided figure with two parallel sides. Berekent de oppervlakte van een figuur met vier zijden waarvan twee zijden evenwijdig zijn. Beräknar arean för en fyrsidig figur med två parallella sidor. 计算梯形的面积。 (\x+\y)/2*\z Side A Zijde A Sida A 边A Side B Zijde B Sida B 边B Height Hoogte Höjd 高度 Economics Economie Ekonomi 经济学 Microeconomics Microëconomie Mikroekonomi 微观经济学 Elasticity Elasticiteit Elasticitet 弹性 r:elasticity elasticiteit elasticitet r:elasticity Calculates the demand elasticity. Also works for supply elasticity, income elasticity, cross-price elasticity, etc. Just replace demand, with supply, or price with income... Ex. elasticity(100-x^2, 3) calculates the demand elasticity when the price is 3 for the function "Q = 100 - x^2" where x is the default price variable. Berekent de vraagelasticiteit. Is ook toepasbaar op aanbodelasticiteit, inkomenselasticiteit, prijselasticiteit, enzovoorts. Vervang vraag door aanbod of prijs met inkomen... %#10; De formule elasticity(100-x^2, 3) bijvoorbeeld berekent de vraagelasticiteit als de prijs 3 is voor de functie "Q = 100 -x^2". waar x de standaard prijsvariabele is. Beräknar efterfrågeelasticitet. Fungerar lika bra för tillgång- och inkomstelasticitet, etc. Ersätt bara efterfrågan, med tillgång, eller pris med inkomst... t ex elasticity(100-x^2, 3) beräknar efterfrågeelasticiteten när priset är 3 för functionen "Q = 100 - x^2" där x är den förvalda prisvariabeln. 计算需求弹性。将需求替换成供给、收入……等,也可以用它来计算供给弹性、收入弹性、交叉价格弹性等。 例如,表达式elasticity(100-x^2, 3)计算x为价格变量的函数"Q = 100 - x^2",当价格为3时的 需求弹性。 replace(diff(\x,\Z{x}),\Z,\y,1)*\y/replace(\x,\Z,\y) Demand function Vraagfunctie Efterfrågefunktion 需求函数 Price Prijs Pris 价格 Price variable Prijsvariabele Prisvariabel 价格变量 Consumer Surplus Consumentenoverschot Konsumentöverskott 消费者剩余 r:csurplus konsumentöverskott r:csurplus select(solve(\x=\y,\z),x>=0,x,1) replace(integrate(\x-replace(\y,\Z{x},\1),\Z),\Z,\1,1) Demand function Vraagfunctie Efterfrågefunktion 需求函数 Supply function or price Aanbodfunctie of prijs Tillgångsfunktion eller pris 供给函数或价格 Quantity variabel Hoeveelheidvariabele Kvantitetsvariabel 数量变量 Producer Surplus Producentenoverschot Producentöverskott r:psurplus producentöverskott r:psurplus select(solve(\x=\y,\z),x>=0,x,1) replace(integrate(replace(\y,\Z{x},\1)-\x,\Z),\Z,\1,1) Supply function Aanbodfunctie Tillgångsfunktion 供给函数 Demand function or price Vraagfunctie of prijs Efterfrågefunktion eller pris 需求函数或价格 Quantity variabel Hoeveelheidvariabele Kvantitetsvariabel 数量变量 Finance Financiën Finans 金融 Sum-of-Years Digits Depreciation Afschrijving volgens som der jaren 年数总和折旧 r:syd r:syd Calculates the sum-of-years digits depreciation for an asset based on its cost, salvage value, anticipated life, and a particular period. This method accelerates the rate of the depreciation, so that more depreciation expense occurs in earlier periods than in later ones. The depreciable cost is the actual cost minus the salvage value. The useful life is the number of periods (typically years) over which the asset is depreciated. Berekent de afschrijving naar leeftijd voor een actief gebaseerd op de aanschafkosten, de restwaarde, de verwachte economische levensduur en een bepaalde periode. Deze methode vermindert de afschrijvingskosten naarmate het actief ouder word. De afschrijvingskosten zijn dus aan het begin het hoogst. De af te schrijven waarde wordt berekend uit het verschil tussen aanschaf- en restwaarde. De economische levensduur is het aantal perioden (meestal jaren) waarin het actief word afgeschreven. Beräknar "sum-of-years digits"-avskrivningen för en tillgång, baserat på dess kostnad, slutvärde, förväntad livslängd och en given period. Metoden accelererar värdeminskningen, så att störst värdeminskning sker i början. Den avskrivbara kostnaden är den faktiskta kostnaden minus slutvärdet. Livslängden är den period (anges ofta i år) som värdeminskningen pågår. 根据一项资产的成本、残值、预期寿命和特定周期计算它的年数总和折旧(SOYD)。 这种方法加速折旧率,因此在早期的折旧支出比晚期要多。"折旧成本"是实际的成本 减去残值。"寿命"是指该资产折旧的周期数目(通常单位为年)。 ((\x-\y)*(\z-\a+1)*2)/(\z*(\z+1)) Cost Kosten Kostnad 成本 Salvage value Restwaarde Slutvärde 残值 Life Levensduur Livslängd Period Termijn Period 周期 Straight Line Depreciation Gelijkblijvende afschrijving 直线折旧 r:sln r:sln Determines the straight line depreciation of an asset for a single period. Cost is the amount you paid for the asset. Salvage is the value of the asset at the end of the period. Life is the number of periods over which the asset is depreciated. SLN divides the cost evenly over the life of an asset. Bepaalt de waardevermindering volgens een rechte lijn van een bezit gedurende een enkele termijn. Kosten is het voor het bezit betaalde bedrag. Restwaarde is de waarde van het bezit aan het einde van de termijn. Levensduur is het aantal termijnen waarover het bezit wordt afgeschreven. Door deze vorm van afschrijven worden de kosten gelijkelijk verdeeld over de gehele afschrijvingsduur. 定义一项资产在单一周期内的直线折旧(SLN方法)。 "成本"是您购买此资产的花销。"残值"是此资产在周期 结束时的价值。"寿命"是指该资产折旧的周期数目。SLN将资产的价值 均摊到它的寿命上。 (\x-\y)/\z Cost Kosten Kostnad 成本 Salvage value Restwaarde Slutvärde 残值 Life Levensduur Livslängd Present Value Huidige waarde Nuvärde 现值 r:pv r:pv Returns the present value of an investment. If type = 1 then the payment is made at the beginning of the period, If type = 0 (or omitted) it is made at the end of each period. Berekent de huidige waarde van een investering. Indien type = 1 is de uitbetaling aan het begin van de termijn, indien type = 0 (of weggelaten) aan het einde van elke termijn. 返回一项投资的现值。 "类型" 定义了到期日期。"1"代表在每个周期的开头支付; "0"(缺省值)代表在每个周期末尾支付。 (-\A{0}-\z*(1+\x*\B{0})*(((1+\x)^\y-1)/\x))/((1+\x)^\y) Interest rate Rentepercentage Räntesats 利率 Number of periods Aantal termijnen Antal perioder 期数 Payment made each period Termijnbetaling Periodisk avbetalning 每期支付 Future value Toekomstige waarde Framtida värde 未来值 Type Type Typ 类型 Nominal Interest Rate Nominaal rentepercentage Nominell räntesats 名义利率 r:nominal nominaal r:nominal Calculates the nominal interest rate from a given effective interest rate compounded at given intervals. Berekent de nominale rente uit de effectieve rente betaald over het opgegeven tijdsinterval. Beräknar den nominella räntesatsen från en given effektiv ränta. 根据在给定时间段内复合的给定有效利率计算名义利率。 \y*(abs((\x+1)^(1/\y))-1) Effective interest rate Effectief rentepercentage Effektiv räntesats 有效利率 Periods Termijnen Antal perioder 周期 Zero Coupon Zonder coupons Nollkupong 零息 r:zero_coupon geen_coupon r:zero_coupon Calculates the value of a zero-coupon (pure discount) bond. Berekent de waarde van een obligatie zonder coupons. 计算零息债券(纯贴现债券)的值。 \x/((1+\y)^\z) Face value Nominale waarde Nominellt värde 票面价值 Interest rate Rentepercentage Räntesats 利率 Years Jaren Antal år Treasury Bill Yield Opbrengst kortlopende overheidsobligatie zonder coupons 短期债券收益 r:tbillyield r:tbillyield Returns the yield for a treasury bill. Berekent de opbrengst van een kortlopende overheidsobligatie zonder coupons. 返回短期债券的收益。 (100-\z)/\z*(360/days(\x,\y,1,1)) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Vervaldatum Mognadsdatum 到期日期 Price per $100 face value 每$100票面价值的价格 Treasury Bill Price Prijs kortlopende overheidsobligatie zonder coupons 短期债券价格 r:tbillprice r:tbillprice Returns the price per $100 value for a treasury bill. Berekent de prijs per € 100 voor een kortlopende overheidsobligatie zonder coupons. 返回一支短期债券每100美元面值的价格。 100*(1-(\z*days(\x,\y,1,1))/360) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Vervaldatum Mognadsdatum 到期日期 Discount rate Discontopercentage Diskonto 贴现率 Treasury Bill Equivalent Equivalent van kortlopende overheidsobligatie zonder coupons 短期债券等价物 r:tbilleq r:tbilleq Returns the bond equivalent for a treasury bill. Berekent het obligatie-equivalent voor een kortlopende overheidsobligatie zonder coupons. 返回与一支短期债券等值的债券。 365*\z/(360-\z*days(\x,\y,1,1)) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Vervaldatum Mognadsdatum 到期日期 Discount rate Discontopercentage Diskonto 贴现率 Interest paid on a given period of an investment (ISPMT) Rente betaald over een gegeven investeringstermijn (ISPMT) 给定投资期内要支付的利息(ISPMT) r:ispmt r:ispmt Calculates the interest paid on a given period of an investment. Berekent de betaalde rente over de opgegeven investeringstermijn. Beräknar den betalda räntan för en viss period av en investering. 计算一项投资在给定周期内支付的利息。 (-\a*\x)-((-\a*\x)/\z*\y) Periodic interest rate Periodiek rentepercentage Periodisk räntesats 周期利率 Amortizement period Amortisatieperiode Amorteringsperiod 偿还期 1 Number of periods Aantal termijnen Antal perioder 期数 1 Present value Huidige waarde Nuvärde 现值 Payment for a loan Betaling voor een lening Betalning för ett lån 贷款偿还 r:pmt r:pmt Returns the amount of payment for a loan based on a constant interest rate and constant payments (each payment is equal amount). If type = 1 then the payment is made at the beginning of the period, If type = 0 (or omitted) it is made at the end of each period. Berekent het te betalen bedrag voor een lening gebaseerd op een vast rentepercentage en gelijkblijvende betalingen (elke keer moet hetzelfde bedrag worden betaald). Indien type = 1 moet er aan het begin van de termijn worden betaald, Indien type = 0 (ofweggelaten) aan het einde van elke termijn. 返回一项利率固定并且定期偿还的贷款的偿还额。(每次偿还金额相同) "类型" 定义了到期日期。"1"代表在每个周期的开头支付; "0"(缺省值)代表在每个周期末尾支付。 (-\z*((1+\x)^\y)-\A{0})/((1+\x*\B{0})*(((1+\x)^\y-1)/\x)) Rate Rate Räntesats 利率 Number of periods Aantal termijnen Antal perioder 期数 Present value Huidige waarde Nuvärde 现值 Future value Toekomstige waarde Framtida värde 未来值 Type Type Typ 类型 Periods of an investment Termijnen van een investering Perioder för en investering 投资的期数 r:nper nterm r:nper Calculates number of periods of an investment based on periodic constant payments and a constant interest rate. Type defines the due date. 1 for payment at the beginning of a period and 0 (default) for payment at the end of a period. Berekent het aantal termijnen voor een investering op basis van periodiek gelijkblijvende betalingen en een gelijkblijvende rente. Type bepaalt de datum waarop moet worden betaald. 1 voor betalen aan het begin van een termijn en 0 (standaard) voor betalen aan het eind van een termijn. Beräknar anatalet perioder för investering baserad på periodiska, konstanta betalningar och konstant ränta. Typ anger när betalningarna sker. 1 för betalning i början av perioden och 0 (förvald) för betalning i slutet av perioden. 计算基于周期性固定支付和固定利率的投资的周期数目。 "类型" 定义了到期日期。"1"代表在每个周期的开头支付;"0"(缺省值)代表在 每个周期末尾支付。 ln((\y*(1+\x*\B{0})-\A{0}*\x)/(\z*\x+\y*(1+\x*\B)))/ln(1+\x) Interest rate Rentepercentage Räntesats 利率 Payment made each period Termijnbetaling Periodisk avbetalning 每期支付 Present value Huidige waarde Nuvärde 现值 Future value Toekomstige waarde Framtida värde 未来值 Type Type Typ 类型 Duration Duur Duration 持续时间 r:duration tijdsduur r:duration Calculates the duration of a security. Berekent de looptijd van een waardepapier. Beräknar livslängden på en säkerhet. 计算债券的持续时间。 Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Vervaldatum Mognadsdatum 到期日期 Annual coupon rate (%) Jaarlijkse couponopbrengst (%) Årlig kupongränta (%) 年息票利率(%) Annualized yield (%) Teruggerekende opbrengst per jaar (%) Årlig avkastning (%) 年度基础换算后的收益率(%) Frequency Frequentie Frekvens 频率 Day counting basis Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Periods for investment to attain desired value Termijnen waarin een investering de gewenste waarde bereikt Perioder för investering att uppnå önskat värde 要获得想要的值,需要的投资期数 r:g_duration g_duur r:g_duration Returns the number of periods needed for an investment to attain a desired value. Retourneert het aantal benodigde termijnen waarna een investering een gewenste waarde bereikt. Returnerar antalet perioder som krävs för en investering att uppnå ett önskat värde. 返回一项投资要得到想要的金额,所需要的期数。 ln(\z/\y)/ln(1+\x) Rate Rate Räntesats 利率 Present value Huidige waarde Nuvärde 现值 Future value Toekomstige waarde Framtida värde 未来值 Payment of an annuity going towards principal (PPMT) Aflossingsdeel van een termijn van een annuïteit (PPMT) Betalning för livränta som går mot kapital (PPMT) 本金的年金支付额(PPMT) r:ppmt r:ppmt Calculates the amount of a payment of an annuity going towards principal. Type defines the due date. 1 for payment at the beginning of a period and 0 (default) for payment at the end of a period. Berekent het aflossingsdeel van een periodieke betaling voor een annuïteit. Type bepaalt de vervaldatum van de betaling. 1 voor betaling aanhet het begin van de termijn en 0 (standaard) voor betaling aan het einde van de termijn. Beräknar summan av en betalning på en livränta som går mot kapital. Typ anger när betalningarna sker. 1 för betalning i början av perioden och 0 (förvald) för betalning i slutet av perioden. 计算关于本金的年金支付额。 "类型" 定义了到期日期。"1"代表在每个周期的开头支付; "0"(缺省值)代表在每个周期末尾支付。 ((-\a*(pow(1+\x,\z))-\B{0})/((1+\x*\C{0})*((pow(1+\x,\z)-1)/\x)))+(\a*pow(1+\x,(\y-1))+((-\a*(pow(1+\x,\z))-\B)/((1+\x*\C)*((pow(1+\x,\z)-1)/\x)))*((pow(1+\x,(\y-1))-1)/\x))*\x Periodic interest rate Periodiek rentepercentage Periodisk räntesats 周期利率 Amortizement period Amortisatieperiode Amorteringsperiod 偿还期 1 Number of periods Aantal termijnen Antal perioder 期数 1 Present value Huidige waarde Nuvärde 现值 Desired future value Gewenste toekomstige waarde Önskat framtida värde 期望的未来价值 Type Type Typ 类型 Effective Interest Rate Effectief rentepercentage Effektiv räntesats 有效利率 r:effect r:effect Calculates the effective interest for a given nominal rate. Berekent de effectieve rente bij een gegeven nominale rente. Beräknar den effektiva räntan från en given nominell räntesats. 根据给定的名义利率计算有效利息。 (1+\x/\y)^\y-1 Nominal interest rate Nominaal rentepercentage Nominell räntesats 名义利率 Periods Termijnen Antal perioder 周期 Future Value Toekomstige waarde Framtida värde 未来值 r:fv r:fv Computes the future value of an investment. This is based on periodic, constant payments and a constant interest rate. If type = 1 then the payment is made at the beginning of the period, If type = 0 (or omitted) it is made at the end of each period. Berekent de waarde van een investering. Dit wordt gebaseerd op periodieke gelijkblijvende betalingen en een gelijkblijvende rente. Indien type = 1 wordt er betaald aanhet het begin van de termijn, als type = 0 (of weggelaten)wordt er betaald aan het einde van elke termijn. Beräknar anatalet perioder för investering baserad på periodiska, konstanta betalningar och konstant ränta. Typ anger när betalningarna sker. 1 för betalning i början av perioden och 0 (förvald) för betalning i slutet av perioden. 计算一项价值的未来价值。这是根据周期、固定支付和固定利率计算出来的。 "type"说明了到期日期。"1"代表在每个周期的开头支付; "0"(缺省值)代表在每个周期末尾支付。 -(\A{0}*((1+\x)^\y)+\z*(1+\x*\B{0})*(((1+\x)^\y-1)/\x)) Interest rate Rentepercentage Räntesats 利率 Number of periods Aantal termijnen Antal perioder 期数 Payment made each period Termijnbetaling Periodisk avbetalning 每期支付 Present value Huidige waarde Nuvärde 现值 Type Type Typ 类型 Return on continuously compounded interest Opbrengst van continu samengestelde rente 根据连续复合利率的回报 r:continuous continu r:continuous Calculates the return on continuously compounded interest, given the principal, nominal rate and time in years. Berekent de opbrengst bij een continu samengestelde rente, gegeven de hoofdsom, nominale rente en de tijd in jaren. 根据给定的本金、名义利率和以年为单位的时间,计算连续复合利率的回报。 \x*exp(\y*\z) Principal Hoofdsom 本金 Interest rate Rentepercentage Räntesats 利率 Years Jaren Antal år Compound Samengesteld 复合值 r:compound samenstellen r:compound Returns the value of an investment, given the principal, nominal interest rate, compounding frequency and time. Berekent de waarde van een investering, gegeven de hoofdsom, nominale rente, samenstellingsfrequentie en tijdsduur. 根据给定的本金、名义利率、复合频率和时间计算并返回投资的值。 \x*(1+\y/\z)^(\z*\a) Principal Hoofdsom 本金 Nominal interest rate Nominaal rentepercentage Nominell räntesats 名义利率 Periods per year Termijnen per jaar Perioder per år 每年的期数 Years Jaren Antal år Payment of an annuity going towards interest (IPMT) Interestdeel van een termijn van een annuïteit (IPMT) Betalning för livränta som går mot ränta (IPMT) 利息的年金支付额(IPMT) r:ipmt r:ipmt Calculates the amount of a payment of an annuity going towards interest. Type defines the due date. 1 for payment at the beginning of a period and 0 (default) for payment at the end of a period. Berekent het interestdeel van een periodieke betaling voor een annuïteit. Type bepaalt de vervaldatum van de betaling. 1 voor betaling aanhet het begin van de termijn en 0 (standaard) voor betaling aan het einde van de termijn. Beräknar summan av en betalning på en livränta som går mot ränta. Typ anger när betalningarna sker. 1 för betalning i början av perioden och 0 (förvald) för betalning i slutet av perioden. 计算关于本金的年金利息支付额. "类型" 定义了到期日期。"1"代表在每个周期的开头支付; "0"(缺省值)代表在每个周期末尾支付。 -(\a*pow(1+\x,(\y-1))+((-\a*(pow(1+\x,\z))-\B)/((1+\x*\C)*((pow(1+\x,\z)-1)/\x)))*((pow(1+\x,(\y-1))-1)/\x))*\x Periodic interest rate Periodiek rentepercentage Periodisk räntesats 周期利率 Period Termijn Period 周期 1 Number of periods Aantal termijnen Antal perioder 期数 1 Present value Huidige waarde Nuvärde 现值 Future value Toekomstige waarde Framtida värde 未来值 Type Type Typ 类型 Interest rate for a fully invested security Interestpercentage voor een waardepapier waarvan de hoofdsom aan het einde vrijvalt 一项已充分投资证券的利率 r:intrate renteperc r:intrate Returns the interest rate for a fully invested security. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. Berekent het rentepercentage voor een volledig geïnvesteerd waardepapier. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. 返回一支已充分投资的证券的利率。 "基准"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。 (\a-\z)/\z/yearfrac(\x,\y,\B{0},1) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Vervaldatum Mognadsdatum 到期日期 Investment Investering Investering 投资 Redemption Aflossing Utlösande summa 偿还 Day counting basis Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Dollar Fraction Dollar fractie Dollar bråktal 美元分数 r:dollarfr r:dollarfr Converts a decimal dollar price into a dollar price expressed as a fraction. Converteert een prijs in decimale dollars naar een prijs in dollars uitgedrukt als een breuk. 将用小数表示的美元价格转化为用分数表示的价格。 int(\x)+frac(\x)*\y/10^ceil(log(\y)) Decimal dollar Decimale dollar Decimala dollar 小数表示的美元 Denominator of fraction Noemer van breuk Bråktalets nämnare 分数的分母 1 Dollar Decimal Dollar decimaal Dollar decimal 美元小数 r:dollarde r:dollarde Converts a dollar price expressed as a fraction into a dollar price expressed as a decimal number. Converteert een prijs in dollars uitgedrukt als een breuk naar een prijs uitgedrukt in een decimaal getal. 将用分数表示的美元价格转化为用小数表示的价格。 int(\x)+frac(\x)*10^ceil(log(\y))/\y Fractional dollar Dollar als breuk Bråktalsdollar 分数表示的美元 Denominator of fraction Noemer van breuk Bråktalets nämnare 分数的分母 1 Amount received at maturity for a security bond Ontvangen bedrag voor een waardepapier op vervaldatum Erhållet belopp för en säkerhet vid mognad 债券到期时获得的金额 r:received ontvangen r:received Returns the amount received at the maturity date for an invested security. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. The settlement date must be before maturity date. Berekent het te ontvangen bedrag na de afloopdatum van een investeringswaardepapier. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. De afwikkeling moet plaats vinden voor de afloopdatum. 返回一支证券到期时可得到的金额。 "基准"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。 \z/(1-\a*yearfrac(\x,\y,\B{0},1)) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Vervaldatum Mognadsdatum 到期日期 Investment Investering Investering 投资 Discount rate Discontopercentage Diskonto 贴现率 Day counting basis Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Discount rate for a security Discontopercentage voor een waardepapier Reduceringshastighet för säkerhet 证券的贴现率 r:disc kort r:disc Returns the discount rate for a security. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. Berekent het rentepercentage voor een waardepapier. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. 返回一支证券的贴现率。 "基准"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。 (\a-\z)/\a/yearfrac(\x,\y,\B{0},1)) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Vervaldatum Mognadsdatum 到期日期 Price per $100 face value 每$100票面价值的价格 Redemption Aflossing Utlösande summa 偿还 Day counting basis Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Accrued interest of security paying at maturity Totale rente van waardepapier op vervaldatum Ränta för en säkerhet från start till mognad 到期时支付的证券应计利息 r:accrintm r:accrintm Returns the accrued interest for a security which pays interest at maturity date. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. Berekent de aangegroeide rente voor een waardepapier waarvan de rente wordt uitgekeerd na de afloopdatum. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. 返回一个在到期时支付利息的证券的应计利息。 "基准"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。 \A{1000}*\z*yearfrac(\x,\y,\B{0},1) Issue date Uitgiftedatum Startdatum 发表日期 Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Annual rate of security Jaarlijkse rente van waardepapier Årlig hastighet 证券年利率 Par value Nominale waarde Nominellt värde 面值 Day counting basis Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Accrued interest of security with periodic interest payments Totale rente van waardepapier met periodieke renteuitkeringen Ränta för en säkerhet med periodisk ränta 分期支付的证券应计利息 r:accrint r:accrint Returns accrued interest for a security which pays periodic interest. Allowed frequencies are 1 - annual, 2 - semi-annual or 4 - quarterly. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. Berekent de aangegroeide rente voor een waardepapier met een periodieke rente-uitkering. Mogelijke frequenties zijn 1 - jaarlijks, 2 - halfjaarlijks of 4 - per kwartaal. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. 返回一个定期支付利息的证券的应计利息。 允许的支付频率为:1 - 年付, 2 - 半年付 或 4 - 季付。 "基准"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。 \b*\a/\c*\c*yearfrac(\x,\z,\D{0},1)+\y*0 Issue date Uitgiftedatum Startdatum 发表日期 First interest Eerste rente Första ränteinbetalning 第一笔利息 Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Annual rate of security Jaarlijkse rente van waardepapier Årlig hastighet 证券年利率 Par value Nominale waarde Nominellt värde 面值 Frequency Frequentie Frekvens 频率 1 4 Day counting basis Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Number of coupons to be paid Aantal te betalen coupons 要支付的息票数量 r:coupnum r:coupnum Returns the number of coupons to be paid between the settlement and the maturity. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. berekent het aantal te betalen coupons tussen afwikkeling en de afloopdatum. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. 返回在结算日和到期日期之间要支付的期票数量。 "基准"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。 trunc(yearfrac(\x,\y,\A{0},1)*\z) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Vervaldatum Mognadsdatum 到期日期 Frequency Frequentie Frekvens 频率 1 12 Day counting basis Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Price per $100 face value of a security bond Pris per $100 värde av en säkerhet (ränta vid mognad) 一支债券每$100票面价值的价格 r:pricedisc prijskorting r:pricedisc Calculates and returns the price per $100 face value of a security bond. The security does not pay interest at maturity. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. Beräknar och returnerar priset per $100 värde av en säkerhet. Säkerheten betalar inte ränta vid mognad. Dagsräkningssystem kan vara: 0: Amerikanskt 30/360 (förvald), 1: verkliga dagar, 2: verkliga dagar/360, 3: verkliga dagar/365, eller 4: Europeiskt 30/360 计算并返回一个债券每100美元票面价值的价格。此债券在到期时不支付利息。 "基准"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。 \a-\z*\a*yearfrac(\x,\y,\B{0},1) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Vervaldatum Mognadsdatum 到期日期 Discount Korting Diskonto 贴现 Redemption Aflossing Utlösande summa 偿还 Day counting basis Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Price per $100 face value of a security Pris per $100 värde av en säkerhet 一支证券每$100票面价值的价格 r:pricemat prijsmat r:pricemat Calculates and returns the price per $100 face value of a security. The security pays interest at maturity. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. Beräknar och returnerar priset per $100 värde av en säkerhet. Säkerheten betalar ränta vid mognad. Dagsräkningssystem kan vara: 0: Amerikanskt 30/360 (förvald), 1: verkliga dagar, 2: verkliga dagar/360, 3: verkliga dagar/365, eller 4: Europeiskt 30/360 计算并返回一个债券每100美元票面价值的价格。此债券在到期时支付利息。 "基准"是您想使用的天数计算类型:0: 美式 30/360 (缺省值), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: 欧式 30/360。 (100+yearfrac(\z,\y,\C{0},1)*\a*100)/(1+yearfrac(\x,\y,\C,1)*\b)-yearfrac(\z,\x,\C,1)*\a*100 Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Vervaldatum Mognadsdatum 到期日期 Issue date Uitgiftedatum Startdatum 发表日期 Discount rate Discontopercentage Diskonto 贴现率 Annual yield Opbrengst per jaar Årlig avkastning 年收益 Day counting basis Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Level-Coupon Bond Obligatie met gelijkblijvende coupons 息票债券 r:level_coupon gelijke_coupon r:level_coupon Calculates the value of a level-coupon bond. Berekent de waarde van een obligatie met gelijkblijvende coupons. 计算息票债券的值。 (\y*\x/\z)*((1-1/(((1+(\b/\z))^(\a*\z))))/(\b/\z))+(\x/((1+(\b/\z))^(\a*\z))) Face value Nominale waarde Nominellt värde 票面价值 Coupon rate Couponrente Kupongränta 息票利率 Coupons per year Aantal coupons per jaar Antal kuponger per år 息票数每年 Years Jaren Antal år Market interest rate Marktrente Marknadsränta 市场利率 libqalculate-0.9.7/Makefile.in0000644000175100017510000005546011320655032013170 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/libqalculate.pc.in $(top_srcdir)/configure AUTHORS \ COPYING ChangeLog INSTALL NEWS TODO config.guess config.sub \ depcomp install-sh ltmain.sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = libqalculate.pc SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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)$(pkgconfigdir)" pkgconfigDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_CPPFLAGS = @CLN_CPPFLAGS@ CLN_LIBS = @CLN_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@ INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@ INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@ INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@ INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@ INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@ INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@ INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@ INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@ INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@ INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@ INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@ INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NMEDIT = @NMEDIT@ 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@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = libqalculate src data po po-defs docs EXTRA_DIST = \ autogen.sh \ TODO \ README.translate \ intltool-extract.in \ intltool-merge.in \ intltool-update.in \ omf.make \ xmldocs.make \ libqalculate.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libqalculate.pc all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 libqalculate.pc: $(top_builddir)/config.status $(srcdir)/libqalculate.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ 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; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { 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: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; nonempty = 1; } \ END { if (nonempty) { 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) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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 list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ distclean distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-pkgconfigDATA # 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: libqalculate-0.9.7/install-sh0000755000175100017510000003246410753066007013135 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-12-25.00 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: libqalculate-0.9.7/configure0000755000175100017510000312723311320655033013034 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # 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 tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="configure.in" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE LN_S CPP GREP EGREP INTLTOOL_DESKTOP_RULE INTLTOOL_DIRECTORY_RULE INTLTOOL_KEYS_RULE INTLTOOL_PROP_RULE INTLTOOL_OAF_RULE INTLTOOL_PONG_RULE INTLTOOL_SERVER_RULE INTLTOOL_SHEET_RULE INTLTOOL_SOUNDLIST_RULE INTLTOOL_UI_RULE INTLTOOL_XAM_RULE INTLTOOL_KBD_RULE INTLTOOL_XML_RULE INTLTOOL_XML_NOMERGE_RULE INTLTOOL_CAVES_RULE INTLTOOL_SCHEMAS_RULE INTLTOOL_THEME_RULE INTLTOOL_SERVICE_RULE INTLTOOL_POLICY_RULE XGETTEXT MSGMERGE MSGFMT INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE INTLTOOL_PERL ALL_LINGUAS DATADIRNAME build build_cpu build_vendor build_os host host_cpu host_vendor host_os SED ECHO AR RANLIB DSYMUTIL NMEDIT CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL QALCULATE_CURRENT QALCULATE_REVISION QALCULATE_AGE PKG_CONFIG GLIB_CFLAGS GLIB_LIBS CLN_CFLAGS CLN_LIBS CLN_CPPFLAGS READLINE_LIBS QALCULATE_TEXT LN_QALCULATE QALCULATE_DEFS2DOC GETTEXT_PACKAGE USE_NLS MSGFMT_OPTS GMSGFMT CATALOGS CATOBJEXT GMOFILES INSTOBJEXT INTLLIBS PO_IN_DATADIR_TRUE PO_IN_DATADIR_FALSE POFILES POSUB MKINSTALLDIRS INTLTOOL_QALCULATE_DEFINITIONS_RULE LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP CXXCPP F77 FFLAGS PKG_CONFIG GLIB_CFLAGS GLIB_LIBS CLN_CFLAGS CLN_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-textport Disable compiling the text port --enable-defs2doc Enable compiling the definitions documentation generator --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-readline turn on readline default=yes, default tries -lncurses, -lcurses, -ltermcap Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags PKG_CONFIG path to pkg-config utility GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config CLN_CFLAGS C compiler flags for CLN, overriding pkg-config CLN_LIBS linker flags for CLN, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.10' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # 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". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` 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= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi 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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi 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 # Define the identity of the package. PACKAGE=libqalculate VERSION=0.9.7 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # 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. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" { echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Check whether --enable-textport was given. if test "${enable_textport+set}" = set; then enableval=$enable_textport; enable_textport=$enableval else enable_textport="yes" fi # Check whether --enable-defs2doc was given. if test "${enable_defs2doc+set}" = set; then enableval=$enable_defs2doc; enable_defs2doc=$enableval else enable_defs2doc="no" fi DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" 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. { echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } 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 { echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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_CC_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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_strerror+set}" = set; then break fi done if test "${ac_cv_search_strerror+set}" = set; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 echo "${ECHO_T}$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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_CC_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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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_CXX_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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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_CC_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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi case "$am__api_version" in 1.01234) { { echo "$as_me:$LINENO: error: Automake 1.5 or newer is required to use intltool" >&5 echo "$as_me: error: Automake 1.5 or newer is required to use intltool" >&2;} { (exit 1); exit 1; }; } ;; *) ;; esac if test -n ""; then { echo "$as_me:$LINENO: checking for intltool >= " >&5 echo $ECHO_N "checking for intltool >= ... $ECHO_C" >&6; } INTLTOOL_REQUIRED_VERSION_AS_INT=`echo | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in` INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split($ 2, VERSION, "."); print VERSION[1] * 1000 + VERSION[2] * 100 + VERSION[3];}' ${ac_aux_dir}/intltool-update.in` { echo "$as_me:$LINENO: result: $INTLTOOL_APPLIED_VERSION found" >&5 echo "${ECHO_T}$INTLTOOL_APPLIED_VERSION found" >&6; } test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || { { echo "$as_me:$LINENO: error: Your intltool is too old. You need intltool or later." >&5 echo "$as_me: error: Your intltool is too old. You need intltool or later." >&2;} { (exit 1); exit 1; }; } fi INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< $@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< $@' INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' # Check the gettext tools to make sure they are GNU # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $XGETTEXT in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XGETTEXT=$ac_cv_path_XGETTEXT if test -n "$XGETTEXT"; then { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MSGMERGE in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MSGMERGE=$ac_cv_path_MSGMERGE if test -n "$MSGMERGE"; then { echo "$as_me:$LINENO: result: $MSGMERGE" >&5 echo "${ECHO_T}$MSGMERGE" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MSGFMT=$ac_cv_path_MSGFMT if test -n "$MSGFMT"; then { echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then { { echo "$as_me:$LINENO: error: GNU gettext tools not found; required for intltool" >&5 echo "$as_me: error: GNU gettext tools not found; required for intltool" >&2;} { (exit 1); exit 1; }; } fi xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then { { echo "$as_me:$LINENO: error: GNU gettext tools not found; required for intltool" >&5 echo "$as_me: error: GNU gettext tools not found; required for intltool" >&2;} { (exit 1); exit 1; }; } fi # Use the tools built into the package, not the ones that are installed. INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract' INTLTOOL_MERGE='$(top_builddir)/intltool-merge' INTLTOOL_UPDATE='$(top_builddir)/intltool-update' # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_INTLTOOL_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $INTLTOOL_PERL in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_PERL="$INTLTOOL_PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL if test -n "$INTLTOOL_PERL"; then { echo "$as_me:$LINENO: result: $INTLTOOL_PERL" >&5 echo "${ECHO_T}$INTLTOOL_PERL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -z "$INTLTOOL_PERL"; then { { echo "$as_me:$LINENO: error: perl not found; required for intltool" >&5 echo "$as_me: error: perl not found; required for intltool" >&2;} { (exit 1); exit 1; }; } fi if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then { { echo "$as_me:$LINENO: error: perl 5.x required for intltool" >&5 echo "$as_me: error: perl 5.x required for intltool" >&2;} { (exit 1); exit 1; }; } fi if test "x" != "xno-xml"; then { echo "$as_me:$LINENO: checking for XML::Parser" >&5 echo $ECHO_N "checking for XML::Parser... $ECHO_C" >&6; } if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then { echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6; } else { { echo "$as_me:$LINENO: error: XML::Parser perl module is required for intltool" >&5 echo "$as_me: error: XML::Parser perl module is required for intltool" >&2;} { (exit 1); exit 1; }; } fi fi # Substitute ALL_LINGUAS so we can use it in po/Makefile # Set DATADIRNAME correctly if it is not set yet # (copied from glib-gettext.m4) if test -z "$DATADIRNAME"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then DATADIRNAME=share else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $host in *-*-solaris*) { echo "$as_me:$LINENO: checking for bind_textdomain_codeset" >&5 echo $ECHO_N "checking for bind_textdomain_codeset... $ECHO_C" >&6; } if test "${ac_cv_func_bind_textdomain_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define bind_textdomain_codeset to an innocuous variant, in case declares bind_textdomain_codeset. For example, HP-UX 11i declares gettimeofday. */ #define bind_textdomain_codeset innocuous_bind_textdomain_codeset /* System header to define __stub macros and hopefully few prototypes, which can conflict with char bind_textdomain_codeset (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef bind_textdomain_codeset /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bind_textdomain_codeset (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_bind_textdomain_codeset || defined __stub___bind_textdomain_codeset choke me #endif int main () { return bind_textdomain_codeset (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_bind_textdomain_codeset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_bind_textdomain_codeset=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_bind_textdomain_codeset" >&5 echo "${ECHO_T}$ac_cv_func_bind_textdomain_codeset" >&6; } if test $ac_cv_func_bind_textdomain_codeset = yes; then DATADIRNAME=share else DATADIRNAME=lib fi ;; *) DATADIRNAME=lib ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_config_commands="$ac_config_commands intltool" # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; 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 else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; 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 else enable_static=yes fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval=$enable_fast_install; 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 else enable_fast_install=yes fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # 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 { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$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 fi SED=$lt_cv_path_SED { echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6; } # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } 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 { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 &5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi { echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac { echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 fi { echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" { echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /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 ;; interix[3-9]*) # 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* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) 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 ;; rdos*) 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 fi { echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } 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 # 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 # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 7376 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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-*kfreebsd*-gnu|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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; 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-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; 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" { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments { echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then 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` else 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` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } else { echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6; } fi # Check for command to grab the raw symbol name followed by C symbol from nm. { echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # 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* | k*bsd*-gnu) 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 <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && 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_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && 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" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf 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 fi 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 { echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6; } else { echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6; } fi { echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 fi { echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir 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" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi 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_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 for cc_temp in $compiler""; 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-%%"` # 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 { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" 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 fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" 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 fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 echo "${ECHO_T}$DSYMUTIL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_NMEDIT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { echo "$as_me:$LINENO: result: $NMEDIT" >&5 echo "${ECHO_T}$NMEDIT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 echo "${ECHO_T}$ac_ct_NMEDIT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. echo "int foo(void){return 1;}" > conftest.c $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib ${wl}-single_module conftest.c if test -f libconftest.dylib; then lt_cv_apple_cc_single_mod=yes rm -rf libconftest.dylib* fi rm conftest.c fi fi { echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; } { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_ld_exported_symbols_list=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; } case $host_os in rhapsody* | darwin1.[0123]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil="~$DSYMUTIL \$lib || :" else _lt_dsymutil= fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # 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 # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$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* ac_outfile=conftest.$ac_objext echo "$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 -r conftest* lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # 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:9551: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:9555: \$? = $ac_status" >&5 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 lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-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_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; interix[3-9]*) # 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_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-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_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-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_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | cygwin* | 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_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-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_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # 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:9841: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:9845: \$? = $ac_status" >&5 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 lt_cv_prog_compiler_pic_works=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$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>&5 $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 lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$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:9945: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:9949: \$? = $ac_status" >&5 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_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $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* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } 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 { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$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 include_expsyms= # 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'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # 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. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; 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-%%"` 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 ld_shlibs=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 hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${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 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= 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 aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=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*) archive_cmds='$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)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=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. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$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... archive_expsym_cmds='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 ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${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. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='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' ;; gnu* | linux* | k*bsd*-gnu) 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 whole_archive_flag_spec='${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 whole_archive_flag_spec='${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 case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs=no else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$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 ld_shlibs=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 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=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 hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$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. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) 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 export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$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].*|aix[5-9]*) 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. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=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 : else # We have old collect2 hardcode_direct=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 hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= 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. always_export_symbols=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. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # 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 "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$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 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$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. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # 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 "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${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. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$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*) archive_cmds='$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)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-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. hardcode_libdir_flag_spec=' ' allow_undefined_flag=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. archive_cmds='$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. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds='$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 archive_expsym_cmds='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 $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='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}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=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*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$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 archive_cmds='$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 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$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*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$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 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$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 archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$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' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$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 allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$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 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$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' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$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' archive_expsym_cmds='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 hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$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='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$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 hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=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. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$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. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds 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. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } 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 case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$lt_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. lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`echo $lt_search_path_spec` 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' ;; aix[4-9]*) 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`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" 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 ;; 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 ;; *) # from 4.6 on, and DragonFly 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' ;; interix[3-9]*) 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* | k*bsd*-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' 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 # 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/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $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' ;; netbsdelf*-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='NetBSD ld.elf_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" ;; rdos*) dynamic_linker=no ;; 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 { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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 { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != 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, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6; } if test "$hardcode_action" = 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 striplib= old_striplib= { echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } 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" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } 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" old_striplib="$STRIP -S" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi ;; *) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } ;; esac fi 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 { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shl_load || defined __stub___shl_load choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else { echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; 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" { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } 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 # Report which library types will actually be built { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } 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 ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ compiler_lib_search_dirs \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ fix_srcfile_path \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $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, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # 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 # 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=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # 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_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # 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_prog_compiler_wl # 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_prog_compiler_pic 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_cv_prog_compiler_c_o # 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_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # 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_old_archive_cmds 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_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds 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_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # 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=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # 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_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # 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=$hardcode_action # 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_hardcode_libdir_flag_spec # 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_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # 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=$hardcode_automatic # 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=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # 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_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # 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_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ 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_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags was given. if test "${with_tags+set}" = set; then withval=$with_tags; tagnames="$withval" fi if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} 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 "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } 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_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= compiler_lib_search_dirs_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # 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 # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$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* ac_outfile=conftest.$ac_objext echo "$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 -r conftest* # 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 compiler_CXX=$CC for cc_temp in $compiler""; 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-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } 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 { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 &5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_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 archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${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 whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= 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. archive_cmds_CXX='$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 { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) 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].*|aix[5-9]*) 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. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=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 : else # We have old collect2 hardcode_direct_CXX=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 hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= 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. always_export_symbols_CXX=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. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # 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 "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$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 hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$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. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # 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 "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${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. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$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 allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$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... archive_expsym_cmds_CXX='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 ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" if test "$GXX" = yes ; then output_verbose_link_cmd='echo' archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$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${_lt_dsymutil}" archive_expsym_cmds_CXX="sed '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${_lt_dar_export_syms}${_lt_dsymutil}" fi else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_CXX='$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 archive_expsym_cmds_CXX='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 $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='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}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=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 ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$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 archive_cmds_CXX='$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 ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=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 ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$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*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$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 ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${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. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='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++ archive_cmds_CXX='$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. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$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 archive_cmds_CXX='$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 link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux* | k*bsd*-gnu) 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. archive_cmds_CXX='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' archive_expsym_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$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."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$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' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${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++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # 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' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. 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. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=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 ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' else ld_shlibs_CXX=no fi ;; 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. archive_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$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' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # 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 allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$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' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # 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 ld_shlibs_CXX=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. archive_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$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' archive_expsym_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # 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 allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$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' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # 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 ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$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' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=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. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$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. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$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. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$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. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$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 ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext compiler_lib_search_dirs_CXX= if test -n "$compiler_lib_search_path_CXX"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix[3-9]*) # 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_prog_compiler_pic_CXX=-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_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+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_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # 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:14823: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:14827: \$? = $ac_status" >&5 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 lt_cv_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$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>&5 $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 lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$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:14927: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:14931: \$? = $ac_status" >&5 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_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $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* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } 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 { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[4-9]*) # 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 export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$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' ;; linux* | k*bsd*-gnu) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX 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. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } 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" 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' ;; aix[4-9]*) 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`' 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 ;; 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 ;; *) # from 4.6 on, and DragonFly 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' ;; interix[3-9]*) 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* | k*bsd*-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' 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 # 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/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $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' ;; netbsdelf*-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='NetBSD ld.elf_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" ;; rdos*) dynamic_linker=no ;; 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 { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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 { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != 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, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = 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 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ compiler_lib_search_dirs_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### 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=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # 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_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # 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_prog_compiler_wl_CXX # 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_prog_compiler_pic_CXX 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_cv_prog_compiler_c_o_CXX # 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_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # 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_old_archive_cmds_CXX 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_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX 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_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # 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=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # 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_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # 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=$hardcode_action_CXX # 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_hardcode_libdir_flag_spec_CXX # 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_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # 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=$hardcode_automatic_CXX # 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=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # 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_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # 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_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ 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_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu 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 else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. # 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 # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$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* ac_outfile=conftest.$ac_objext echo "$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 -r conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; 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-%%"` { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } 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 ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-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_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; interix[3-9]*) # 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_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-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_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-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_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | cygwin* | 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_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-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_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; rdos*) lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # 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:16525: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16529: \$? = $ac_status" >&5 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 lt_cv_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_F77" >&6; } if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$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>&5 $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 lt_cv_prog_compiler_static_works_F77=yes fi else lt_cv_prog_compiler_static_works_F77=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works_F77" >&6; } if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$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:16629: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:16633: \$? = $ac_status" >&5 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_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $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* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } 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 { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$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 include_expsyms_F77= # 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'. exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # 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. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; 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-%%"` 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 ld_shlibs_F77=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 hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${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 whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= 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 aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=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*) archive_cmds_F77='$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)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=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. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$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... archive_expsym_cmds_F77='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 ld_shlibs_F77=no fi ;; interix[3-9]*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${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. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='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' ;; gnu* | linux* | k*bsd*-gnu) 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 whole_archive_flag_spec_F77='${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 whole_archive_flag_spec_F77='${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 case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_F77=no else ld_shlibs_F77=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$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 ld_shlibs_F77=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 archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=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 hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$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. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix[4-9]*) 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 export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$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].*|aix[5-9]*) 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. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=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 : else # We have old collect2 hardcode_direct_F77=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 hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= 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. always_export_symbols_F77=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. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # 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 "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$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 hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$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. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # 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 "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${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. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$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*) archive_cmds_F77='$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)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-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. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=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. archive_cmds_F77='$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. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_F77='$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 archive_expsym_cmds_F77='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 $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='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}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=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*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$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 archive_cmds_F77='$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 hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$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*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$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 hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$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 archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_F77=no fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$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' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$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 allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$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 hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$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' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$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' archive_expsym_cmds_F77='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 hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$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='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$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 hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_F77=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. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$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. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 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. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } 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" 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' ;; aix[4-9]*) 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`' 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 ;; 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 ;; *) # from 4.6 on, and DragonFly 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' ;; interix[3-9]*) 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* | k*bsd*-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' 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 # 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/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $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' ;; netbsdelf*-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='NetBSD ld.elf_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" ;; rdos*) dynamic_linker=no ;; 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 { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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 { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != 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, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = 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 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ compiler_lib_search_dirs_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ fix_srcfile_path_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### 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=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # 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_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # 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_prog_compiler_wl_F77 # 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_prog_compiler_pic_F77 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_cv_prog_compiler_c_o_F77 # 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_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # 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_old_archive_cmds_F77 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_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 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_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # 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=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # 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_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # 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=$hardcode_action_F77 # 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_hardcode_libdir_flag_spec_F77 # 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_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # 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=$hardcode_automatic_F77 # 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=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # 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_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # 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_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ 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_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # 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 # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$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* ac_outfile=conftest.$ac_objext echo "$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 -r conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; 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-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # 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:18849: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:18853: \$? = $ac_status" >&5 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 lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-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_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; interix[3-9]*) # 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_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-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_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-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_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | cygwin* | 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). ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-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_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' lt_prog_compiler_wl_GCJ='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' lt_prog_compiler_wl_GCJ='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; rdos*) lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # 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:19139: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:19143: \$? = $ac_status" >&5 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 lt_cv_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_GCJ" >&6; } if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$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>&5 $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 lt_cv_prog_compiler_static_works_GCJ=yes fi else lt_cv_prog_compiler_static_works_GCJ=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works_GCJ" >&6; } if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$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:19243: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:19247: \$? = $ac_status" >&5 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_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . 2>&5 $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* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } 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 { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$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 include_expsyms_GCJ= # 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'. exclude_expsyms_GCJ='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # 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. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; 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-%%"` 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 ld_shlibs_GCJ=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 hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${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 whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= 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 aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=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*) archive_cmds_GCJ='$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)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=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. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$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... archive_expsym_cmds_GCJ='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 ld_shlibs_GCJ=no fi ;; interix[3-9]*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${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. archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_GCJ='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' ;; gnu* | linux* | k*bsd*-gnu) 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 whole_archive_flag_spec_GCJ='${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 whole_archive_flag_spec_GCJ='${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 case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_GCJ=no else ld_shlibs_GCJ=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$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 ld_shlibs_GCJ=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 archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=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 hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$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. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix[4-9]*) 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 export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$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].*|aix[5-9]*) 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. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=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 : else # We have old collect2 hardcode_direct_GCJ=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 hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= 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. always_export_symbols_GCJ=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. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # 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 "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$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 hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$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. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # 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 "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${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. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$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*) archive_cmds_GCJ='$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)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-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. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=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. archive_cmds_GCJ='$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. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_GCJ="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_GCJ="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_GCJ="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_GCJ='$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 archive_expsym_cmds_GCJ='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 $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='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}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=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*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$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 archive_cmds_GCJ='$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 hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$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*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$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 hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$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 archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_GCJ=no fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$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' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$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 allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$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 hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$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' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$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' archive_expsym_cmds_GCJ='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 hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$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='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$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 hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_GCJ=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. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$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. no_undefined_flag_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ 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. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } 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" 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' ;; aix[4-9]*) 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`' 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 ;; 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 ;; *) # from 4.6 on, and DragonFly 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' ;; interix[3-9]*) 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* | k*bsd*-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' 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 # 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/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $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' ;; netbsdelf*-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='NetBSD ld.elf_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" ;; rdos*) dynamic_linker=no ;; 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 { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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 { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != 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, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6; } if test "$hardcode_action_GCJ" = 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 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ compiler_lib_search_dirs_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ fix_srcfile_path_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### 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=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # 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_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # 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_prog_compiler_wl_GCJ # 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_prog_compiler_pic_GCJ 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_cv_prog_compiler_c_o_GCJ # 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_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # 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_old_archive_cmds_GCJ 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_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ 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_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # 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=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # 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_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # 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=$hardcode_action_GCJ # 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_hardcode_libdir_flag_spec_GCJ # 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_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # 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=$hardcode_automatic_GCJ # 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=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # 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_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # 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_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ 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_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # 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 # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$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* ac_outfile=conftest.$ac_objext echo "$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 -r conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; 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_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ compiler_lib_search_dirs_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ fix_srcfile_path_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### 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=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # 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_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # 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_prog_compiler_wl_RC # 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_prog_compiler_pic_RC 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_cv_prog_compiler_c_o_RC # 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_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # 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_old_archive_cmds_RC 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_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC 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_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # 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=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # 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_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # 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=$hardcode_action_RC # 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_hardcode_libdir_flag_spec_RC # 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_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # 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=$hardcode_automatic_RC # 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=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # 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_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # 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_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ 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_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; 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" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # 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' # Prevent multiple expansion if test "x$GCC" = "xyes"; then case $CFLAGS in *-Os*) CFLAGS="$CFLAGS -O2" ;; esac case $CXXFLAGS in *-Os*) CXXFLAGS="$CXXFLAGS -O2" ;; esac fi if test "x$GCC" = "xyes"; then case " $CFLAGS " in *[\ \ ]-Wall[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wall" ;; esac fi QALCULATE_CURRENT=5 QALCULATE_REVISION=0 QALCULATE_AGE=0 { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_create=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; } if test $ac_cv_lib_pthread_pthread_create = yes; then LIBS="$LIBS -lpthread" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { echo "$as_me:$LINENO: checking for GLIB" >&5 echo $ECHO_N "checking for GLIB... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \" glib-2.0 libxml-2.0 >= 2.3.8 \"") >&5 ($PKG_CONFIG --exists --print-errors " glib-2.0 libxml-2.0 >= 2.3.8 ") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags " glib-2.0 libxml-2.0 >= 2.3.8 " 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$GLIB_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \" glib-2.0 libxml-2.0 >= 2.3.8 \"") >&5 ($PKG_CONFIG --exists --print-errors " glib-2.0 libxml-2.0 >= 2.3.8 ") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs " glib-2.0 libxml-2.0 >= 2.3.8 " 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors " glib-2.0 libxml-2.0 >= 2.3.8 "` else GLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors " glib-2.0 libxml-2.0 >= 2.3.8 "` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 { { echo "$as_me:$LINENO: error: Package requirements ( glib-2.0 libxml-2.0 >= 2.3.8 ) were not met: $GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 echo "$as_me: error: Package requirements ( glib-2.0 libxml-2.0 >= 2.3.8 ) were not met: $GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { echo "$as_me:$LINENO: error: 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. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 echo "$as_me: error: 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. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } : fi pkg_failed=no { echo "$as_me:$LINENO: checking for CLN" >&5 echo $ECHO_N "checking for CLN... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then if test -n "$CLN_CFLAGS"; then pkg_cv_CLN_CFLAGS="$CLN_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \" cln >= 1.2 \"") >&5 ($PKG_CONFIG --exists --print-errors " cln >= 1.2 ") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_CLN_CFLAGS=`$PKG_CONFIG --cflags " cln >= 1.2 " 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$CLN_LIBS"; then pkg_cv_CLN_LIBS="$CLN_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \" cln >= 1.2 \"") >&5 ($PKG_CONFIG --exists --print-errors " cln >= 1.2 ") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_CLN_LIBS=`$PKG_CONFIG --libs " cln >= 1.2 " 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CLN_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors " cln >= 1.2 "` else CLN_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors " cln >= 1.2 "` fi # Put the nasty error message in config.log where it belongs echo "$CLN_PKG_ERRORS" >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } have_recent_cln=no elif test $pkg_failed = untried; then have_recent_cln=no else CLN_CFLAGS=$pkg_cv_CLN_CFLAGS CLN_LIBS=$pkg_cv_CLN_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } have_recent_cln=yes fi if test "$have_recent_cln" = "yes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_RECENT_CLN 1 _ACEOF LIBS="$LIBS $CLN_LIBS" CPPFLAGS="$CPPFLAGS $CLN_CPPFLAGS" fi QALCULATE_TEXT="" LN_QALCULATE="" USE_READLINE="yes" READLINE_LIBS="" if test "x$enable_textport" = "xyes" ; then QALCULATE_TEXT="qalc" LN_QALCULATE="qalc" { echo "$as_me:$LINENO: checking whether to use readline" >&5 echo $ECHO_N "checking whether to use readline... $ECHO_C" >&6; } # Check whether --with-readline was given. if test "${with_readline+set}" = set; then withval=$with_readline; case "${withval}" in yes) USE_READLINE="yes" ; { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } ;; no) USE_READLINE="no" ; { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } ;; only) USE_READLINE="yes" EXTRA_LIBREADLINE_DEPS=" " { echo "$as_me:$LINENO: result: yes (using only readline)" >&5 echo "${ECHO_T}yes (using only readline)" >&6; } ;; *) USE_READLINE="yes" EXTRA_LIBREADLINE_DEPS="${withval}" { echo "$as_me:$LINENO: result: yes (using extra libraries ${withval})" >&5 echo "${ECHO_T}yes (using extra libraries ${withval})" >&6; } ;; esac else { echo "$as_me:$LINENO: result: ${USE_READLINE}" >&5 echo "${ECHO_T}${USE_READLINE}" >&6; } fi if test "$USE_READLINE" = yes ; then for ac_header in readline/readline.h readline/history.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "x${ac_cv_header_readline_readline_h}" != "xyes" -o "x${ac_cv_header_readline_history_h}" != "xyes"; then { echo "$as_me:$LINENO: WARNING: Could not find the headers for libreadline." >&5 echo "$as_me: WARNING: Could not find the headers for libreadline." >&2;} else if test "$EXTRA_LIBREADLINE_DEPS" = "" ; then unset ac_cv_lib_readline_readline { echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6; } if test "${ac_cv_lib_readline_readline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline -lncurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_readline_readline=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6; } if test $ac_cv_lib_readline_readline = yes; then HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -lncurses" EXTRA_LIBREADLINE_DEPS=-lncurses cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF else unset ac_cv_lib_readline_readline { echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6; } if test "${ac_cv_lib_readline_readline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline -lcurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_readline_readline=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6; } if test $ac_cv_lib_readline_readline = yes; then HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -lcurses" EXTRA_LIBREADLINE_DEPS=-lcurses cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF else unset ac_cv_lib_readline_readline { echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6; } if test "${ac_cv_lib_readline_readline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline -ltermcap $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_readline_readline=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6; } if test $ac_cv_lib_readline_readline = yes; then HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -ltermcap" EXTRA_LIBREADLINE_DEPS=-ltermcap cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF else unset ac_cv_lib_readline_readline { echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6; } if test "${ac_cv_lib_readline_readline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_readline_readline=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6; } if test $ac_cv_lib_readline_readline = yes; then HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF fi fi fi fi else unset ac_cv_lib_readline_readline { echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6; } if test "${ac_cv_lib_readline_readline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline ${EXTRA_LIBREADLINE_DEPS} $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_readline_readline=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6; } if test $ac_cv_lib_readline_readline = yes; then HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline ${EXTRA_LIBREADLINE_DEPS}" cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF fi fi if test x${HAVE_LIBREADLINE} = xtrue; then READLINE_LIBS="-lreadline -lhistory ${EXTRA_LIBREADLINE_DEPS}" else { echo "$as_me:$LINENO: WARNING: Could not find libreadline." >&5 echo "$as_me: WARNING: Could not find libreadline." >&2;} fi fi fi fi QALCULATE_DEFS2DOC="" if test "x$enable_defs2doc" = "xyes" ; then QALCULATE_DEFS2DOC="defs2doc" fi GETTEXT_PACKAGE=libqalculate cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" _ACEOF ALL_LINGUAS="fr nl sv zh_CN" for ac_header in locale.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test $ac_cv_header_locale_h = yes; then { echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6; } if test "${am_cv_val_LC_MESSAGES+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return LC_MESSAGES ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then am_cv_val_LC_MESSAGES=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_val_LC_MESSAGES=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6; } if test $am_cv_val_LC_MESSAGES = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LC_MESSAGES 1 _ACEOF fi fi USE_NLS=yes gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= if test "${ac_cv_header_libintl_h+set}" = set; then { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking libintl.h usability" >&5 echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking libintl.h presence" >&5 echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_libintl_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } fi if test $ac_cv_header_libintl_h = yes; then gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # { echo "$as_me:$LINENO: checking for ngettext in libc" >&5 echo $ECHO_N "checking for ngettext in libc... $ECHO_C" >&6; } if test "${gt_cv_func_ngettext_libc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return !ngettext ("","", 1) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_func_ngettext_libc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_ngettext_libc=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_func_ngettext_libc" >&5 echo "${ECHO_T}$gt_cv_func_ngettext_libc" >&6; } if test "$gt_cv_func_ngettext_libc" = "yes" ; then { echo "$as_me:$LINENO: checking for dgettext in libc" >&5 echo $ECHO_N "checking for dgettext in libc... $ECHO_C" >&6; } if test "${gt_cv_func_dgettext_libc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return !dgettext ("","") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_func_dgettext_libc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_dgettext_libc=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_func_dgettext_libc" >&5 echo "${ECHO_T}$gt_cv_func_dgettext_libc" >&6; } fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then for ac_func in bind_textdomain_codeset do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then { echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5 echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6; } if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bindtextdomain (); int main () { return bindtextdomain (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_intl_bindtextdomain=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_bindtextdomain=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5 echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6; } if test $ac_cv_lib_intl_bindtextdomain = yes; then { echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5 echo $ECHO_N "checking for ngettext in -lintl... $ECHO_C" >&6; } if test "${ac_cv_lib_intl_ngettext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_intl_ngettext=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_ngettext=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5 echo "${ECHO_T}$ac_cv_lib_intl_ngettext" >&6; } if test $ac_cv_lib_intl_ngettext = yes; then { echo "$as_me:$LINENO: checking for dgettext in -lintl" >&5 echo $ECHO_N "checking for dgettext in -lintl... $ECHO_C" >&6; } if test "${ac_cv_lib_intl_dgettext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dgettext (); int main () { return dgettext (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_intl_dgettext=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_dgettext=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dgettext" >&5 echo "${ECHO_T}$ac_cv_lib_intl_dgettext" >&6; } if test $ac_cv_lib_intl_dgettext = yes; then gt_cv_func_dgettext_libintl=yes fi fi fi if test "$gt_cv_func_dgettext_libintl" != "yes" ; then { echo "$as_me:$LINENO: checking if -liconv is needed to use gettext" >&5 echo $ECHO_N "checking if -liconv is needed to use gettext... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: " >&5 echo "${ECHO_T}" >&6; } { echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5 echo $ECHO_N "checking for ngettext in -lintl... $ECHO_C" >&6; } if test "${ac_cv_lib_intl_ngettext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_intl_ngettext=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_ngettext=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5 echo "${ECHO_T}$ac_cv_lib_intl_ngettext" >&6; } if test $ac_cv_lib_intl_ngettext = yes; then { echo "$as_me:$LINENO: checking for dcgettext in -lintl" >&5 echo $ECHO_N "checking for dcgettext in -lintl... $ECHO_C" >&6; } if test "${ac_cv_lib_intl_dcgettext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dcgettext (); int main () { return dcgettext (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_intl_dcgettext=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_dcgettext=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dcgettext" >&5 echo "${ECHO_T}$ac_cv_lib_intl_dcgettext" >&6; } if test $ac_cv_lib_intl_dcgettext = yes; then gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv else : fi else : fi fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset for ac_func in bind_textdomain_codeset do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs" fi if test "$gt_cv_have_gettext" = "yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 _ACEOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in /*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then ac_cv_path_MSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != "no"; then { echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" for ac_func in dcgettext do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done MSGFMT_OPTS= { echo "$as_me:$LINENO: checking if msgfmt accepts -c" >&5 echo $ECHO_N "checking if msgfmt accepts -c... $ECHO_C" >&6; } cat >conftest.foo <<_ACEOF msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" _ACEOF if { (echo "$as_me:$LINENO: \$MSGFMT -c -o /dev/null conftest.foo") >&5 ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then MSGFMT_OPTS=-c; { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } echo "$as_me: failed input was:" >&5 sed 's/^/| /' conftest.foo >&5 fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 echo "${ECHO_T}$GMSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then CATOBJEXT=.gmo DATADIRNAME=share else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $host in *-*-solaris*) { echo "$as_me:$LINENO: checking for bind_textdomain_codeset" >&5 echo $ECHO_N "checking for bind_textdomain_codeset... $ECHO_C" >&6; } if test "${ac_cv_func_bind_textdomain_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define bind_textdomain_codeset to an innocuous variant, in case declares bind_textdomain_codeset. For example, HP-UX 11i declares gettimeofday. */ #define bind_textdomain_codeset innocuous_bind_textdomain_codeset /* System header to define __stub macros and hopefully few prototypes, which can conflict with char bind_textdomain_codeset (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef bind_textdomain_codeset /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bind_textdomain_codeset (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_bind_textdomain_codeset || defined __stub___bind_textdomain_codeset choke me #endif int main () { return bind_textdomain_codeset (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_bind_textdomain_codeset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_bind_textdomain_codeset=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_bind_textdomain_codeset" >&5 echo "${ECHO_T}$ac_cv_func_bind_textdomain_codeset" >&6; } if test $ac_cv_func_bind_textdomain_codeset = yes; then CATOBJEXT=.gmo DATADIRNAME=share else CATOBJEXT=.mo DATADIRNAME=lib fi ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi fi if test "$gt_cv_have_gettext" = "yes" ; then cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else { echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po ac_config_commands="$ac_config_commands default-1" for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else { echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6; } NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS { echo "$as_me:$LINENO: result: $LINGUAS" >&5 echo "${ECHO_T}$LINGUAS" >&6; } fi if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES { echo "$as_me:$LINENO: checking locale directory" >&5 echo $ECHO_N "checking locale directory... $ECHO_C" >&6; } if test "x$prefix" = "xNONE"; then PACKAGE_LOCALE_DIR=$ac_default_prefix/share/locale else PACKAGE_LOCALE_DIR=$prefix/share/locale fi cat >>confdefs.h <<_ACEOF #define PACKAGE_LOCALE_DIR "$PACKAGE_LOCALE_DIR" _ACEOF { echo "$as_me:$LINENO: result: \"$PACKAGE_LOCALE_DIR\"" >&5 echo "${ECHO_T}\"$PACKAGE_LOCALE_DIR\"" >&6; } INTLTOOL_QALCULATE_DEFINITIONS_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po-defs/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po-defs/.intltool-merge-cache $(top_srcdir)/po-defs $< $@' ac_config_files="$ac_config_files Makefile src/Makefile libqalculate/Makefile data/Makefile po/Makefile.in po-defs/Makefile docs/Makefile docs/reference/Makefile libqalculate.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi ac_config_commands="$ac_config_commands po/stamp-it" : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}' prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir" INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "intltool") CONFIG_COMMANDS="$CONFIG_COMMANDS intltool" ;; "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "libqalculate/Makefile") CONFIG_FILES="$CONFIG_FILES libqalculate/Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "po-defs/Makefile") CONFIG_FILES="$CONFIG_FILES po-defs/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/reference/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/Makefile" ;; "libqalculate.pc") CONFIG_FILES="$CONFIG_FILES libqalculate.pc" ;; "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim MAINT!$MAINT$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CXXDEPMODE!$CXXDEPMODE$ac_delim am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim LN_S!$LN_S$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim INTLTOOL_DESKTOP_RULE!$INTLTOOL_DESKTOP_RULE$ac_delim INTLTOOL_DIRECTORY_RULE!$INTLTOOL_DIRECTORY_RULE$ac_delim INTLTOOL_KEYS_RULE!$INTLTOOL_KEYS_RULE$ac_delim INTLTOOL_PROP_RULE!$INTLTOOL_PROP_RULE$ac_delim INTLTOOL_OAF_RULE!$INTLTOOL_OAF_RULE$ac_delim INTLTOOL_PONG_RULE!$INTLTOOL_PONG_RULE$ac_delim INTLTOOL_SERVER_RULE!$INTLTOOL_SERVER_RULE$ac_delim INTLTOOL_SHEET_RULE!$INTLTOOL_SHEET_RULE$ac_delim INTLTOOL_SOUNDLIST_RULE!$INTLTOOL_SOUNDLIST_RULE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF INTLTOOL_UI_RULE!$INTLTOOL_UI_RULE$ac_delim INTLTOOL_XAM_RULE!$INTLTOOL_XAM_RULE$ac_delim INTLTOOL_KBD_RULE!$INTLTOOL_KBD_RULE$ac_delim INTLTOOL_XML_RULE!$INTLTOOL_XML_RULE$ac_delim INTLTOOL_XML_NOMERGE_RULE!$INTLTOOL_XML_NOMERGE_RULE$ac_delim INTLTOOL_CAVES_RULE!$INTLTOOL_CAVES_RULE$ac_delim INTLTOOL_SCHEMAS_RULE!$INTLTOOL_SCHEMAS_RULE$ac_delim INTLTOOL_THEME_RULE!$INTLTOOL_THEME_RULE$ac_delim INTLTOOL_SERVICE_RULE!$INTLTOOL_SERVICE_RULE$ac_delim INTLTOOL_POLICY_RULE!$INTLTOOL_POLICY_RULE$ac_delim XGETTEXT!$XGETTEXT$ac_delim MSGMERGE!$MSGMERGE$ac_delim MSGFMT!$MSGFMT$ac_delim INTLTOOL_EXTRACT!$INTLTOOL_EXTRACT$ac_delim INTLTOOL_MERGE!$INTLTOOL_MERGE$ac_delim INTLTOOL_UPDATE!$INTLTOOL_UPDATE$ac_delim INTLTOOL_PERL!$INTLTOOL_PERL$ac_delim ALL_LINGUAS!$ALL_LINGUAS$ac_delim DATADIRNAME!$DATADIRNAME$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim SED!$SED$ac_delim ECHO!$ECHO$ac_delim AR!$AR$ac_delim RANLIB!$RANLIB$ac_delim DSYMUTIL!$DSYMUTIL$ac_delim NMEDIT!$NMEDIT$ac_delim CXXCPP!$CXXCPP$ac_delim F77!$F77$ac_delim FFLAGS!$FFLAGS$ac_delim ac_ct_F77!$ac_ct_F77$ac_delim LIBTOOL!$LIBTOOL$ac_delim QALCULATE_CURRENT!$QALCULATE_CURRENT$ac_delim QALCULATE_REVISION!$QALCULATE_REVISION$ac_delim QALCULATE_AGE!$QALCULATE_AGE$ac_delim PKG_CONFIG!$PKG_CONFIG$ac_delim GLIB_CFLAGS!$GLIB_CFLAGS$ac_delim GLIB_LIBS!$GLIB_LIBS$ac_delim CLN_CFLAGS!$CLN_CFLAGS$ac_delim CLN_LIBS!$CLN_LIBS$ac_delim CLN_CPPFLAGS!$CLN_CPPFLAGS$ac_delim READLINE_LIBS!$READLINE_LIBS$ac_delim QALCULATE_TEXT!$QALCULATE_TEXT$ac_delim LN_QALCULATE!$LN_QALCULATE$ac_delim QALCULATE_DEFS2DOC!$QALCULATE_DEFS2DOC$ac_delim GETTEXT_PACKAGE!$GETTEXT_PACKAGE$ac_delim USE_NLS!$USE_NLS$ac_delim MSGFMT_OPTS!$MSGFMT_OPTS$ac_delim GMSGFMT!$GMSGFMT$ac_delim CATALOGS!$CATALOGS$ac_delim CATOBJEXT!$CATOBJEXT$ac_delim GMOFILES!$GMOFILES$ac_delim INSTOBJEXT!$INSTOBJEXT$ac_delim INTLLIBS!$INTLLIBS$ac_delim PO_IN_DATADIR_TRUE!$PO_IN_DATADIR_TRUE$ac_delim PO_IN_DATADIR_FALSE!$PO_IN_DATADIR_FALSE$ac_delim POFILES!$POFILES$ac_delim POSUB!$POSUB$ac_delim MKINSTALLDIRS!$MKINSTALLDIRS$ac_delim INTLTOOL_QALCULATE_DEFINITIONS_RULE!$INTLTOOL_QALCULATE_DEFINITIONS_RULE$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 68; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_arg=$ac_file _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` 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_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "intltool":C) for file in intltool-extract intltool-merge intltool-update; do sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \ -e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \ -e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \ < ${ac_aux_dir}/${file}.in > ${file}.out if cmp -s ${file} ${file}.out 2>/dev/null; then rm -f ${file}.out else mv -f ${file}.out ${file} fi chmod ugo+x ${file} chmod u+w ${file} done ;; "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac ;; "po/stamp-it":C) rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp" >"po/stamp-it.tmp" sed '/^#/d s/^[[].*] *// /^[ ]*$/d '"s|^| $ac_top_srcdir/|" \ "$srcdir/po/POTFILES.in" | sed '$!s/$/ \\/' >"po/POTFILES" if test ! -f "po/Makefile"; then { { echo "$as_me:$LINENO: error: po/Makefile is not ready." >&5 echo "$as_me: error: po/Makefile is not ready." >&2;} { (exit 1); exit 1; }; } fi mv "po/Makefile" "po/Makefile.tmp" sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r po/POTFILES } ' "po/Makefile.tmp" >"po/Makefile" rm -f "po/Makefile.tmp" mv "po/stamp-it.tmp" "po/stamp-it" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi libqalculate-0.9.7/intltool-merge.in0000644000175100017510000011474611320655025014421 00000000000000#!@INTLTOOL_PERL@ -w # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*- # # The Intltool Message Merger # # Copyright (C) 2000, 2003 Free Software Foundation. # Copyright (C) 2000, 2001 Eazel, Inc # # Intltool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # version 2 published by the Free Software Foundation. # # Intltool 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., 675 Mass Ave, Cambridge, MA 02139, 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. # # Authors: Maciej Stachowiak # Kenneth Christiansen # Darin Adler # # Proper XML UTF-8'ification written by Cyrille Chepelov # ## Release information my $PROGRAM = "intltool-merge"; my $PACKAGE = "intltool"; my $VERSION = "0.37.1"; ## Loaded modules use strict; use Getopt::Long; use Text::Wrap; use File::Basename; my $must_end_tag = -1; my $last_depth = -1; my $translation_depth = -1; my @tag_stack = (); my @entered_tag = (); my @translation_strings = (); my $leading_space = ""; ## Scalars used by the option stuff my $HELP_ARG = 0; my $VERSION_ARG = 0; my $BA_STYLE_ARG = 0; my $XML_STYLE_ARG = 0; my $KEYS_STYLE_ARG = 0; my $DESKTOP_STYLE_ARG = 0; my $SCHEMAS_STYLE_ARG = 0; my $RFC822DEB_STYLE_ARG = 0; my $QUOTED_STYLE_ARG = 0; my $QUOTEDXML_STYLE_ARG = 0; my $QUIET_ARG = 0; my $PASS_THROUGH_ARG = 0; my $UTF8_ARG = 0; my $MULTIPLE_OUTPUT = 0; my $cache_file; ## Handle options GetOptions ( "help" => \$HELP_ARG, "version" => \$VERSION_ARG, "quiet|q" => \$QUIET_ARG, "oaf-style|o" => \$BA_STYLE_ARG, ## for compatibility "ba-style|b" => \$BA_STYLE_ARG, "xml-style|x" => \$XML_STYLE_ARG, "keys-style|k" => \$KEYS_STYLE_ARG, "desktop-style|d" => \$DESKTOP_STYLE_ARG, "schemas-style|s" => \$SCHEMAS_STYLE_ARG, "rfc822deb-style|r" => \$RFC822DEB_STYLE_ARG, "quoted-style" => \$QUOTED_STYLE_ARG, "quotedxml-style" => \$QUOTEDXML_STYLE_ARG, "pass-through|p" => \$PASS_THROUGH_ARG, "utf8|u" => \$UTF8_ARG, "multiple-output|m" => \$MULTIPLE_OUTPUT, "cache|c=s" => \$cache_file ) or &error; my $PO_DIR; my $FILE; my $OUTFILE; my %po_files_by_lang = (); my %translations = (); my $iconv = $ENV{"ICONV"} || "iconv"; my $devnull = ($^O eq 'MSWin32' ? 'NUL:' : '/dev/null'); sub isProgramInPath { my ($file) = @_; # If either a file exists, or when run it returns 0 exit status return 1 if ((-x $file) or (system("$file -l >$devnull") == 0)); return 0; } if (! isProgramInPath ("$iconv")) { print STDERR " *** iconv is not found on this system!\n". " *** Without it, intltool-merge can not convert encodings.\n"; exit; } # Use this instead of \w for XML files to handle more possible characters. my $w = "[-A-Za-z0-9._:]"; # XML quoted string contents my $q = "[^\\\"]*"; ## Check for options. if ($VERSION_ARG) { &print_version; } elsif ($HELP_ARG) { &print_help; } elsif ($BA_STYLE_ARG && @ARGV > 2) { &utf8_sanity_check; &preparation; &print_message; &ba_merge_translations; &finalize; } elsif ($XML_STYLE_ARG && @ARGV > 2) { &utf8_sanity_check; &preparation; &print_message; &xml_merge_output; &finalize; } elsif ($KEYS_STYLE_ARG && @ARGV > 2) { &utf8_sanity_check; &preparation; &print_message; &keys_merge_translations; &finalize; } elsif ($DESKTOP_STYLE_ARG && @ARGV > 2) { &utf8_sanity_check; &preparation; &print_message; &desktop_merge_translations; &finalize; } elsif ($SCHEMAS_STYLE_ARG && @ARGV > 2) { &utf8_sanity_check; &preparation; &print_message; &schemas_merge_translations; &finalize; } elsif ($RFC822DEB_STYLE_ARG && @ARGV > 2) { &preparation; &print_message; &rfc822deb_merge_translations; &finalize; } elsif (($QUOTED_STYLE_ARG || $QUOTEDXML_STYLE_ARG) && @ARGV > 2) { &utf8_sanity_check; &preparation; &print_message; "ed_merge_translations($QUOTEDXML_STYLE_ARG); &finalize; } else { &print_help; } exit; ## Sub for printing release information sub print_version { print <<_EOF_; ${PROGRAM} (${PACKAGE}) ${VERSION} Written by Maciej Stachowiak, Darin Adler and Kenneth Christiansen. Copyright (C) 2000-2003 Free Software Foundation, Inc. Copyright (C) 2000-2001 Eazel, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. _EOF_ exit; } ## Sub for printing usage information sub print_help { print <<_EOF_; Usage: ${PROGRAM} [OPTION]... PO_DIRECTORY FILENAME OUTPUT_FILE Generates an output file that includes some localized attributes from an untranslated source file. Mandatory options: (exactly one must be specified) -b, --ba-style includes translations in the bonobo-activation style -d, --desktop-style includes translations in the desktop style -k, --keys-style includes translations in the keys style -s, --schemas-style includes translations in the schemas style -r, --rfc822deb-style includes translations in the RFC822 style --quoted-style includes translations in the quoted string style --quotedxml-style includes translations in the quoted xml string style -x, --xml-style includes translations in the standard xml style Other options: -u, --utf8 convert all strings to UTF-8 before merging (default for everything except RFC822 style) -p, --pass-through deprecated, does nothing and issues a warning -m, --multiple-output output one localized file per locale, instead of a single file containing all localized elements -c, --cache=FILE specify cache file name (usually \$top_builddir/po/.intltool-merge-cache) -q, --quiet suppress most messages --help display this help and exit --version output version information and exit Report bugs to http://bugzilla.gnome.org/ (product name "$PACKAGE") or send email to . _EOF_ exit; } ## Sub for printing error messages sub print_error { print STDERR "Try `${PROGRAM} --help' for more information.\n"; exit; } sub print_message { print "Merging translations into $OUTFILE.\n" unless $QUIET_ARG; } sub preparation { $PO_DIR = $ARGV[0]; $FILE = $ARGV[1]; $OUTFILE = $ARGV[2]; &gather_po_files; &get_translation_database; } # General-purpose code for looking up translations in .po files sub po_file2lang { my ($tmp) = @_; $tmp =~ s/^.*\/(.*)\.po$/$1/; return $tmp; } sub gather_po_files { if (my $linguas = $ENV{"LINGUAS"}) { for my $lang (split / /, $linguas) { my $po_file = $PO_DIR . "/" . $lang . ".po"; if (-e $po_file) { $po_files_by_lang{$lang} = $po_file; } } } else { if (open LINGUAS_FILE, "$PO_DIR/LINGUAS") { while () { next if /^#/; for my $lang (split) { chomp ($lang); my $po_file = $PO_DIR . "/" . $lang . ".po"; if (-e $po_file) { $po_files_by_lang{$lang} = $po_file; } } } close LINGUAS_FILE; } else { for my $po_file (glob "$PO_DIR/*.po") { $po_files_by_lang{po_file2lang($po_file)} = $po_file; } } } } sub get_local_charset { my ($encoding) = @_; my $alias_file = $ENV{"G_CHARSET_ALIAS"} || "@INTLTOOL_LIBDIR@/charset.alias"; # seek character encoding aliases in charset.alias (glib) if (open CHARSET_ALIAS, $alias_file) { while () { next if /^\#/; return $1 if (/^\s*([-._a-zA-Z0-9]+)\s+$encoding\b/i) } close CHARSET_ALIAS; } # if not found, return input string return $encoding; } sub get_po_encoding { my ($in_po_file) = @_; my $encoding = ""; open IN_PO_FILE, $in_po_file or die; while () { ## example: "Content-Type: text/plain; charset=ISO-8859-1\n" if (/Content-Type\:.*charset=([-a-zA-Z0-9]+)\\n/) { $encoding = $1; last; } } close IN_PO_FILE; if (!$encoding) { print STDERR "Warning: no encoding found in $in_po_file. Assuming ISO-8859-1\n" unless $QUIET_ARG; $encoding = "ISO-8859-1"; } system ("$iconv -f $encoding -t UTF-8 <$devnull 2>$devnull"); if ($?) { $encoding = get_local_charset($encoding); } return $encoding } sub utf8_sanity_check { print STDERR "Warning: option --pass-through has been removed.\n" if $PASS_THROUGH_ARG; $UTF8_ARG = 1; } sub get_translation_database { if ($cache_file) { &get_cached_translation_database; } else { &create_translation_database; } } sub get_newest_po_age { my $newest_age; foreach my $file (values %po_files_by_lang) { my $file_age = -M $file; $newest_age = $file_age if !$newest_age || $file_age < $newest_age; } $newest_age = 0 if !$newest_age; return $newest_age; } sub create_cache { print "Generating and caching the translation database\n" unless $QUIET_ARG; &create_translation_database; open CACHE, ">$cache_file" || die; print CACHE join "\x01", %translations; close CACHE; } sub load_cache { print "Found cached translation database\n" unless $QUIET_ARG; my $contents; open CACHE, "<$cache_file" || die; { local $/; $contents = ; } close CACHE; %translations = split "\x01", $contents; } sub get_cached_translation_database { my $cache_file_age = -M $cache_file; if (defined $cache_file_age) { if ($cache_file_age <= &get_newest_po_age) { &load_cache; return; } print "Found too-old cached translation database\n" unless $QUIET_ARG; } &create_cache; } sub create_translation_database { for my $lang (keys %po_files_by_lang) { my $po_file = $po_files_by_lang{$lang}; if ($UTF8_ARG) { my $encoding = get_po_encoding ($po_file); if (lc $encoding eq "utf-8") { open PO_FILE, "<$po_file"; } else { print "NOTICE: $po_file is not in UTF-8 but $encoding, converting...\n" unless $QUIET_ARG;; open PO_FILE, "$iconv -f $encoding -t UTF-8 $po_file|"; } } else { open PO_FILE, "<$po_file"; } my $nextfuzzy = 0; my $inmsgid = 0; my $inmsgstr = 0; my $msgid = ""; my $msgstr = ""; while () { $nextfuzzy = 1 if /^#, fuzzy/; if (/^msgid "((\\.|[^\\]+)*)"/ ) { $translations{$lang, $msgid} = $msgstr if $inmsgstr && $msgid && $msgstr; $msgid = ""; $msgstr = ""; if ($nextfuzzy) { $inmsgid = 0; } else { $msgid = unescape_po_string($1); $inmsgid = 1; } $inmsgstr = 0; $nextfuzzy = 0; } if (/^msgstr "((\\.|[^\\]+)*)"/) { $msgstr = unescape_po_string($1); $inmsgstr = 1; $inmsgid = 0; } if (/^"((\\.|[^\\]+)*)"/) { $msgid .= unescape_po_string($1) if $inmsgid; $msgstr .= unescape_po_string($1) if $inmsgstr; } } $translations{$lang, $msgid} = $msgstr if $inmsgstr && $msgid && $msgstr; } } sub finalize { } sub unescape_one_sequence { my ($sequence) = @_; return "\\" if $sequence eq "\\\\"; return "\"" if $sequence eq "\\\""; return "\n" if $sequence eq "\\n"; return "\r" if $sequence eq "\\r"; return "\t" if $sequence eq "\\t"; return "\b" if $sequence eq "\\b"; return "\f" if $sequence eq "\\f"; return "\a" if $sequence eq "\\a"; return chr(11) if $sequence eq "\\v"; # vertical tab, see ascii(7) return chr(hex($1)) if ($sequence =~ /\\x([0-9a-fA-F]{2})/); return chr(oct($1)) if ($sequence =~ /\\([0-7]{3})/); # FIXME: Is \0 supported as well? Kenneth and Rodney don't want it, see bug #48489 return $sequence; } sub unescape_po_string { my ($string) = @_; $string =~ s/(\\x[0-9a-fA-F]{2}|\\[0-7]{3}|\\.)/unescape_one_sequence($1)/eg; return $string; } sub entity_decode { local ($_) = @_; s/'/'/g; # ' s/"/"/g; # " s/<//g; s/&/&/g; return $_; } # entity_encode: (string) # # Encode the given string to XML format (encode '<' etc). sub entity_encode { my ($pre_encoded) = @_; my @list_of_chars = unpack ('C*', $pre_encoded); # with UTF-8 we only encode minimalistic return join ('', map (&entity_encode_int_minimalist, @list_of_chars)); } sub entity_encode_int_minimalist { return """ if $_ == 34; return "&" if $_ == 38; return "'" if $_ == 39; return "<" if $_ == 60; return ">" if $_ == 62; return chr $_; } sub entity_encoded_translation { my ($lang, $string) = @_; my $translation = $translations{$lang, $string}; return $string if !$translation; return entity_encode ($translation); } ## XML (bonobo-activation specific) merge code sub ba_merge_translations { my $source; { local $/; # slurp mode open INPUT, "<$FILE" or die "can't open $FILE: $!"; $source = ; close INPUT; } open OUTPUT, ">$OUTFILE" or die "can't open $OUTFILE: $!"; # Binmode so that selftest works ok if using a native Win32 Perl... binmode (OUTPUT) if $^O eq 'MSWin32'; while ($source =~ s|^(.*?)([ \t]*<\s*$w+\s+($w+\s*=\s*"$q"\s*)+/?>)([ \t]*\n)?||s) { print OUTPUT $1; my $node = $2 . "\n"; my @strings = (); $_ = $node; while (s/(\s)_($w+\s*=\s*"($q)")/$1$2/s) { push @strings, entity_decode($3); } print OUTPUT; my %langs; for my $string (@strings) { for my $lang (keys %po_files_by_lang) { $langs{$lang} = 1 if $translations{$lang, $string}; } } for my $lang (sort keys %langs) { $_ = $node; s/(\sname\s*=\s*)"($q)"/$1"$2-$lang"/s; s/(\s)_($w+\s*=\s*")($q)"/$1 . $2 . entity_encoded_translation($lang, $3) . '"'/seg; print OUTPUT; } } print OUTPUT $source; close OUTPUT; } ## XML (non-bonobo-activation) merge code # Process tag attributes # Only parameter is a HASH containing attributes -> values mapping sub getAttributeString { my $sub = shift; my $do_translate = shift || 0; my $language = shift || ""; my $result = ""; my $translate = shift; foreach my $e (reverse(sort(keys %{ $sub }))) { my $key = $e; my $string = $sub->{$e}; my $quote = '"'; $string =~ s/^[\s]+//; $string =~ s/[\s]+$//; if ($string =~ /^'.*'$/) { $quote = "'"; } $string =~ s/^['"]//g; $string =~ s/['"]$//g; if ($do_translate && $key =~ /^_/) { $key =~ s|^_||g; if ($language) { # Handle translation my $decode_string = entity_decode($string); my $translation = $translations{$language, $decode_string}; if ($translation) { $translation = entity_encode($translation); $string = $translation; } $$translate = 2; } else { $$translate = 2 if ($translate && (!$$translate)); # watch not to "overwrite" $translate } } $result .= " $key=$quote$string$quote"; } return $result; } # Returns a translatable string from XML node, it works on contents of every node in XML::Parser tree sub getXMLstring { my $ref = shift; my $spacepreserve = shift || 0; my @list = @{ $ref }; my $result = ""; my $count = scalar(@list); my $attrs = $list[0]; my $index = 1; $spacepreserve = 1 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/)); $spacepreserve = 0 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?default["']?$/)); while ($index < $count) { my $type = $list[$index]; my $content = $list[$index+1]; if (! $type ) { # We've got CDATA if ($content) { # lets strip the whitespace here, and *ONLY* here $content =~ s/\s+/ /gs if (!$spacepreserve); $result .= $content; } } elsif ( "$type" ne "1" ) { # We've got another element $result .= "<$type"; $result .= getAttributeString(@{$content}[0], 0); # no nested translatable elements if ($content) { my $subresult = getXMLstring($content, $spacepreserve); if ($subresult) { $result .= ">".$subresult . ""; } else { $result .= "/>"; } } else { $result .= "/>"; } } $index += 2; } return $result; } # Translate list of nodes if necessary sub translate_subnodes { my $fh = shift; my $content = shift; my $language = shift || ""; my $singlelang = shift || 0; my $spacepreserve = shift || 0; my @nodes = @{ $content }; my $count = scalar(@nodes); my $index = 0; while ($index < $count) { my $type = $nodes[$index]; my $rest = $nodes[$index+1]; if ($singlelang) { my $oldMO = $MULTIPLE_OUTPUT; $MULTIPLE_OUTPUT = 1; traverse($fh, $type, $rest, $language, $spacepreserve); $MULTIPLE_OUTPUT = $oldMO; } else { traverse($fh, $type, $rest, $language, $spacepreserve); } $index += 2; } } sub isWellFormedXmlFragment { my $ret = eval 'require XML::Parser'; if(!$ret) { die "You must have XML::Parser installed to run $0\n\n"; } my $fragment = shift; return 0 if (!$fragment); $fragment = "$fragment"; my $xp = new XML::Parser(Style => 'Tree'); my $tree = 0; eval { $tree = $xp->parse($fragment); }; return $tree; } sub traverse { my $fh = shift; my $nodename = shift; my $content = shift; my $language = shift || ""; my $spacepreserve = shift || 0; if (!$nodename) { if ($content =~ /^[\s]*$/) { $leading_space .= $content; } print $fh $content; } else { # element my @all = @{ $content }; my $attrs = shift @all; my $translate = 0; my $outattr = getAttributeString($attrs, 1, $language, \$translate); if ($nodename =~ /^_/) { $translate = 1; $nodename =~ s/^_//; } my $lookup = ''; $spacepreserve = 0 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?default["']?$/)); $spacepreserve = 1 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/)); print $fh "<$nodename", $outattr; if ($translate) { $lookup = getXMLstring($content, $spacepreserve); if (!$spacepreserve) { $lookup =~ s/^\s+//s; $lookup =~ s/\s+$//s; } if ($lookup || $translate == 2) { my $translation = $translations{$language, $lookup} if isWellFormedXmlFragment($translations{$language, $lookup}); if ($MULTIPLE_OUTPUT && ($translation || $translate == 2)) { $translation = $lookup if (!$translation); print $fh " xml:lang=\"", $language, "\"" if $language; print $fh ">"; if ($translate == 2) { translate_subnodes($fh, \@all, $language, 1, $spacepreserve); } else { print $fh $translation; } print $fh ""; return; # this means there will be no same translation with xml:lang="$language"... # if we want them both, just remove this "return" } else { print $fh ">"; if ($translate == 2) { translate_subnodes($fh, \@all, $language, 1, $spacepreserve); } else { print $fh $lookup; } print $fh ""; } } else { print $fh "/>"; } for my $lang (sort keys %po_files_by_lang) { if ($MULTIPLE_OUTPUT && $lang ne "$language") { next; } if ($lang) { # Handle translation # my $translate = 0; my $localattrs = getAttributeString($attrs, 1, $lang, \$translate); my $translation = $translations{$lang, $lookup} if isWellFormedXmlFragment($translations{$lang, $lookup}); if ($translate && !$translation) { $translation = $lookup; } if ($translation || $translate) { print $fh "\n"; $leading_space =~ s/.*\n//g; print $fh $leading_space; print $fh "<", $nodename, " xml:lang=\"", $lang, "\"", $localattrs, ">"; if ($translate == 2) { translate_subnodes($fh, \@all, $lang, 1, $spacepreserve); } else { print $fh $translation; } print $fh ""; } } } } else { my $count = scalar(@all); if ($count > 0) { print $fh ">"; my $index = 0; while ($index < $count) { my $type = $all[$index]; my $rest = $all[$index+1]; traverse($fh, $type, $rest, $language, $spacepreserve); $index += 2; } print $fh ""; } else { print $fh "/>"; } } } } sub intltool_tree_comment { my $expat = shift; my $data = shift; my $clist = $expat->{Curlist}; my $pos = $#$clist; push @$clist, 1 => $data; } sub intltool_tree_cdatastart { my $expat = shift; my $clist = $expat->{Curlist}; my $pos = $#$clist; push @$clist, 0 => $expat->original_string(); } sub intltool_tree_cdataend { my $expat = shift; my $clist = $expat->{Curlist}; my $pos = $#$clist; $clist->[$pos] .= $expat->original_string(); } sub intltool_tree_char { my $expat = shift; my $text = shift; my $clist = $expat->{Curlist}; my $pos = $#$clist; # Use original_string so that we retain escaped entities # in CDATA sections. # if ($pos > 0 and $clist->[$pos - 1] eq '0') { $clist->[$pos] .= $expat->original_string(); } else { push @$clist, 0 => $expat->original_string(); } } sub intltool_tree_start { my $expat = shift; my $tag = shift; my @origlist = (); # Use original_string so that we retain escaped entities # in attribute values. We must convert the string to an # @origlist array to conform to the structure of the Tree # Style. # my @original_array = split /\x/, $expat->original_string(); my $source = $expat->original_string(); # Remove leading tag. # $source =~ s|^\s*<\s*(\S+)||s; # Grab attribute key/value pairs and push onto @origlist array. # while ($source) { if ($source =~ /^\s*([\w:-]+)\s*[=]\s*["]/) { $source =~ s|^\s*([\w:-]+)\s*[=]\s*["]([^"]*)["]||s; push @origlist, $1; push @origlist, '"' . $2 . '"'; } elsif ($source =~ /^\s*([\w:-]+)\s*[=]\s*[']/) { $source =~ s|^\s*([\w:-]+)\s*[=]\s*[']([^']*)[']||s; push @origlist, $1; push @origlist, "'" . $2 . "'"; } else { last; } } my $ol = [ { @origlist } ]; push @{ $expat->{Lists} }, $expat->{Curlist}; push @{ $expat->{Curlist} }, $tag => $ol; $expat->{Curlist} = $ol; } sub readXml { my $filename = shift || return; if(!-f $filename) { die "ERROR Cannot find filename: $filename\n"; } my $ret = eval 'require XML::Parser'; if(!$ret) { die "You must have XML::Parser installed to run $0\n\n"; } my $xp = new XML::Parser(Style => 'Tree'); $xp->setHandlers(Char => \&intltool_tree_char); $xp->setHandlers(Start => \&intltool_tree_start); $xp->setHandlers(CdataStart => \&intltool_tree_cdatastart); $xp->setHandlers(CdataEnd => \&intltool_tree_cdataend); my $tree = $xp->parsefile($filename); # Hello thereHowdydo # would be: # [foo, [{}, head, [{id => "a"}, 0, "Hello ", em, [{}, 0, "there"]], bar, [{}, # 0, "Howdy", ref, [{}]], 0, "do" ] ] return $tree; } sub print_header { my $infile = shift; my $fh = shift; my $source; if(!-f $infile) { die "ERROR Cannot find filename: $infile\n"; } print $fh qq{\n}; { local $/; open DOCINPUT, "<${FILE}" or die; $source = ; close DOCINPUT; } if ($source =~ /()/s) { print $fh "$1\n"; } elsif ($source =~ /(]*>)/s) { print $fh "$1\n"; } } sub parseTree { my $fh = shift; my $ref = shift; my $language = shift || ""; my $name = shift @{ $ref }; my $cont = shift @{ $ref }; while (!$name || "$name" eq "1") { $name = shift @{ $ref }; $cont = shift @{ $ref }; } my $spacepreserve = 0; my $attrs = @{$cont}[0]; $spacepreserve = 1 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/)); traverse($fh, $name, $cont, $language, $spacepreserve); } sub xml_merge_output { my $source; if ($MULTIPLE_OUTPUT) { for my $lang (sort keys %po_files_by_lang) { if ( ! -d $lang ) { mkdir $lang or -d $lang or die "Cannot create subdirectory $lang: $!\n"; } open OUTPUT, ">$lang/$OUTFILE" or die "Cannot open $lang/$OUTFILE: $!\n"; binmode (OUTPUT) if $^O eq 'MSWin32'; my $tree = readXml($FILE); print_header($FILE, \*OUTPUT); parseTree(\*OUTPUT, $tree, $lang); close OUTPUT; print "CREATED $lang/$OUTFILE\n" unless $QUIET_ARG; } if ( ! -d "C" ) { mkdir "C" or -d "C" or die "Cannot create subdirectory C: $!\n"; } open OUTPUT, ">C/$OUTFILE" or die "Cannot open C/$OUTFILE: $!\n"; binmode (OUTPUT) if $^O eq 'MSWin32'; my $tree = readXml($FILE); print_header($FILE, \*OUTPUT); parseTree(\*OUTPUT, $tree); close OUTPUT; print "CREATED C/$OUTFILE\n" unless $QUIET_ARG; } else { open OUTPUT, ">$OUTFILE" or die "Cannot open $OUTFILE: $!\n"; binmode (OUTPUT) if $^O eq 'MSWin32'; my $tree = readXml($FILE); print_header($FILE, \*OUTPUT); parseTree(\*OUTPUT, $tree); close OUTPUT; print "CREATED $OUTFILE\n" unless $QUIET_ARG; } } sub keys_merge_translation { my ($lang) = @_; if ( ! -d $lang && $MULTIPLE_OUTPUT) { mkdir $lang or -d $lang or die "Cannot create subdirectory $lang: $!\n"; } open INPUT, "<${FILE}" or die "Cannot open ${FILE}: $!\n"; open OUTPUT, ">$lang/$OUTFILE" or die "Cannot open $lang/$OUTFILE: $!\n"; binmode (OUTPUT) if $^O eq 'MSWin32'; while () { if (s/^(\s*)_(\w+=(.*))/$1$2/) { my $string = $3; if (!$MULTIPLE_OUTPUT) { print OUTPUT; my $non_translated_line = $_; for my $lang (sort keys %po_files_by_lang) { my $translation = $translations{$lang, $string}; next if !$translation; $_ = $non_translated_line; s/(\w+)=.*/[$lang]$1=$translation/; print OUTPUT; } } else { my $non_translated_line = $_; my $translation = $translations{$lang, $string}; $translation = $string if !$translation; $_ = $non_translated_line; s/(\w+)=.*/$1=$translation/; print OUTPUT; } } else { print OUTPUT; } } close OUTPUT; close INPUT; print "CREATED $lang/$OUTFILE\n" unless $QUIET_ARG; } sub keys_merge_translations { if ($MULTIPLE_OUTPUT) { for my $lang (sort keys %po_files_by_lang) { keys_merge_translation ($lang); } keys_merge_translation ("C"); } else { keys_merge_translation ("."); } } sub desktop_merge_translations { open INPUT, "<${FILE}" or die; open OUTPUT, ">${OUTFILE}" or die; binmode (OUTPUT) if $^O eq 'MSWin32'; while () { if (s/^(\s*)_(\w+=(.*))/$1$2/) { my $string = $3; print OUTPUT; my $non_translated_line = $_; for my $lang (sort keys %po_files_by_lang) { my $translation = $translations{$lang, $string}; next if !$translation; $_ = $non_translated_line; s/(\w+)=.*/${1}[$lang]=$translation/; print OUTPUT; } } else { print OUTPUT; } } close OUTPUT; close INPUT; } sub schemas_merge_translations { my $source; { local $/; # slurp mode open INPUT, "<$FILE" or die "can't open $FILE: $!"; $source = ; close INPUT; } open OUTPUT, ">$OUTFILE" or die; binmode (OUTPUT) if $^O eq 'MSWin32'; # FIXME: support attribute translations # Empty nodes never need translation, so unmark all of them. # For example, <_foo/> is just replaced by . $source =~ s|<\s*_($w+)\s*/>|<$1/>|g; while ($source =~ s/ (.*?) (\s+)((\s*) (\s*(?:\s*)?(.*?)\s*<\/default>)?(\s*) (\s*(?:\s*)?(.*?)\s*<\/short>)?(\s*) (\s*(?:\s*)?(.*?)\s*<\/long>)?(\s*) <\/locale>) //sx) { print OUTPUT $1; my $locale_start_spaces = $2 ? $2 : ''; my $default_spaces = $4 ? $4 : ''; my $short_spaces = $7 ? $7 : ''; my $long_spaces = $10 ? $10 : ''; my $locale_end_spaces = $13 ? $13 : ''; my $c_default_block = $3 ? $3 : ''; my $default_string = $6 ? $6 : ''; my $short_string = $9 ? $9 : ''; my $long_string = $12 ? $12 : ''; print OUTPUT "$locale_start_spaces$c_default_block"; $default_string =~ s/\s+/ /g; $default_string = entity_decode($default_string); $short_string =~ s/\s+/ /g; $short_string = entity_decode($short_string); $long_string =~ s/\s+/ /g; $long_string = entity_decode($long_string); for my $lang (sort keys %po_files_by_lang) { my $default_translation = $translations{$lang, $default_string}; my $short_translation = $translations{$lang, $short_string}; my $long_translation = $translations{$lang, $long_string}; next if (!$default_translation && !$short_translation && !$long_translation); print OUTPUT "\n$locale_start_spaces"; print OUTPUT "$default_spaces"; if ($default_translation) { $default_translation = entity_encode($default_translation); print OUTPUT "$default_translation"; } print OUTPUT "$short_spaces"; if ($short_translation) { $short_translation = entity_encode($short_translation); print OUTPUT "$short_translation"; } print OUTPUT "$long_spaces"; if ($long_translation) { $long_translation = entity_encode($long_translation); print OUTPUT "$long_translation"; } print OUTPUT "$locale_end_spaces"; } } print OUTPUT $source; close OUTPUT; } sub rfc822deb_merge_translations { my %encodings = (); for my $lang (keys %po_files_by_lang) { $encodings{$lang} = ($UTF8_ARG ? 'UTF-8' : get_po_encoding($po_files_by_lang{$lang})); } my $source; $Text::Wrap::huge = 'overflow'; $Text::Wrap::break = qr/\n|\s(?=\S)/; { local $/; # slurp mode open INPUT, "<$FILE" or die "can't open $FILE: $!"; $source = ; close INPUT; } open OUTPUT, ">${OUTFILE}" or die; binmode (OUTPUT) if $^O eq 'MSWin32'; while ($source =~ /(^|\n+)(_*)([^:\s]+)(:[ \t]*)(.*?)(?=\n[\S\n]|$)/sg) { my $sep = $1; my $non_translated_line = $3.$4; my $string = $5; my $underscore = length($2); next if $underscore eq 0 && $non_translated_line =~ /^#/; # Remove [] dummy strings my $stripped = $string; $stripped =~ s/\[\s[^\[\]]*\],/,/g if $underscore eq 2; $stripped =~ s/\[\s[^\[\]]*\]$//; $non_translated_line .= $stripped; print OUTPUT $sep.$non_translated_line; if ($underscore) { my @str_list = rfc822deb_split($underscore, $string); for my $lang (sort keys %po_files_by_lang) { my $is_translated = 1; my $str_translated = ''; my $first = 1; for my $str (@str_list) { my $translation = $translations{$lang, $str}; if (!$translation) { $is_translated = 0; last; } # $translation may also contain [] dummy # strings, mostly to indicate an empty string $translation =~ s/\[\s[^\[\]]*\]$//; if ($first) { if ($underscore eq 2) { $str_translated .= $translation; } else { $str_translated .= Text::Tabs::expand($translation) . "\n"; } } else { if ($underscore eq 2) { $str_translated .= ', ' . $translation; } else { $str_translated .= Text::Tabs::expand( Text::Wrap::wrap(' ', ' ', $translation)) . "\n .\n"; } } $first = 0; # To fix some problems with Text::Wrap::wrap $str_translated =~ s/(\n )+\n/\n .\n/g; } next unless $is_translated; $str_translated =~ s/\n \.\n$//; $str_translated =~ s/\s+$//; $_ = $non_translated_line; s/^(\w+):\s*.*/$sep${1}-$lang.$encodings{$lang}: $str_translated/s; print OUTPUT; } } } print OUTPUT "\n"; close OUTPUT; close INPUT; } sub rfc822deb_split { # Debian defines a special way to deal with rfc822-style files: # when a value contain newlines, it consists of # 1. a short form (first line) # 2. a long description, all lines begin with a space, # and paragraphs are separated by a single dot on a line # This routine returns an array of all paragraphs, and reformat # them. # When first argument is 2, the string is a comma separated list of # values. my $type = shift; my $text = shift; $text =~ s/^[ \t]//mg; return (split(/, */, $text, 0)) if $type ne 1; return ($text) if $text !~ /\n/; $text =~ s/([^\n]*)\n//; my @list = ($1); my $str = ''; for my $line (split (/\n/, $text)) { chomp $line; if ($line =~ /^\.\s*$/) { # New paragraph $str =~ s/\s*$//; push(@list, $str); $str = ''; } elsif ($line =~ /^\s/) { # Line which must not be reformatted $str .= "\n" if length ($str) && $str !~ /\n$/; $line =~ s/\s+$//; $str .= $line."\n"; } else { # Continuation line, remove newline $str .= " " if length ($str) && $str !~ /\n$/; $str .= $line; } } $str =~ s/\s*$//; push(@list, $str) if length ($str); return @list; } sub quoted_translation { my ($xml_mode, $lang, $string) = @_; $string = entity_decode($string) if $xml_mode; $string =~ s/\\\"/\"/g; my $translation = $translations{$lang, $string}; $translation = $string if !$translation; $translation = entity_encode($translation) if $xml_mode; $translation =~ s/\"/\\\"/g; return $translation } sub quoted_merge_translations { my ($xml_mode) = @_; if (!$MULTIPLE_OUTPUT) { print "Quoted only supports Multiple Output.\n"; exit(1); } for my $lang (sort keys %po_files_by_lang) { if ( ! -d $lang ) { mkdir $lang or -d $lang or die "Cannot create subdirectory $lang: $!\n"; } open INPUT, "<${FILE}" or die; open OUTPUT, ">$lang/$OUTFILE" or die "Cannot open $lang/$OUTFILE: $!\n"; binmode (OUTPUT) if $^O eq 'MSWin32'; while () { s/\"(([^\"]|\\\")*[^\\\"])\"/"\"" . "ed_translation($xml_mode, $lang, $1) . "\""/ge; print OUTPUT; } close OUTPUT; close INPUT; } } libqalculate-0.9.7/mkinstalldirs0000755000175100017510000000370411320655025013725 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" 1>&2 exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # End: # mkinstalldirs ends here libqalculate-0.9.7/depcomp0000755000175100017510000004271310753066007012504 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2007-03-29.01 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: